12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.zhyc.xps.aqpt.mapper.EntRiskPointDangerMapper">
- <resultMap id="RiskPointDangerDtoResultMap" type="com.zhyc.xps.aqpt.dto.EntDangerDto" >
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="risk_point_id" property="riskPointId" jdbcType="BIGINT" />
- <result column="risk_point_title" property="riskPointTitle" jdbcType="VARCHAR" />
- <result column="danger_id" property="dangerId" jdbcType="BIGINT" />
- <result column="danger_code" property="dangerCode" jdbcType="VARCHAR" />
- <result column="danger_title" property="dangerTitle" jdbcType="VARCHAR" />
- <result column="danger_desc" property="dangerDesc" jdbcType="VARCHAR" />
- <result column="danger_cat_id" property="dangerCatId" jdbcType="BIGINT" />
- <result column="danger_level" property="dangerLevel" jdbcType="BIGINT" />
- <result column="status" property="status" jdbcType="BIGINT" />
- <result column="danger_deadline" property="dangerDeadLine" jdbcType="DATE" />
- </resultMap>
- <sql id="RiskPointDangerDto_Cols">
- A.oc_id,
- A.risk_point_id,
- B.risk_point_title,
- A.danger_id,
- C.danger_code,
- C.danger_title,
- C.danger_desc,
- C.danger_cat_id,
- C.danger_level,
- C.status,
- C.danger_deadline
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="RiskPointDangerDtoResultMap">
- SELECT
- <include refid="RiskPointDangerDto_Cols"/>
- FROM ent_danger AS A
- LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
- LEFT JOIN ent_danger AS C ON (A.oc_id = C.oc_id AND A.danger_id = C.danger_id)
- WHERE 1 = 1
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="dangerId != null">
- AND A.danger_id = #{dangerId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="RiskPointDangerDtoResultMap">
- SELECT
- <include refid="RiskPointDangerDto_Cols"/>
- FROM ent_danger AS A
- LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
- LEFT JOIN ent_danger AS C ON (A.oc_id = C.oc_id AND A.danger_id = C.danger_id)
- WHERE 1 = 1
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="riskPointId != null">
- AND A.risk_point_id = #{riskPointId ,jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- ORDER BY A.risk_point_id ASC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="RiskPointDangerDtoResultMap">
- SELECT
- <include refid="RiskPointDangerDto_Cols"/>
- FROM ent_danger AS A
- LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
- LEFT JOIN ent_danger AS C ON (A.oc_id = C.oc_id AND A.danger_id = C.danger_id)
- WHERE 1 = 1
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="riskPointId != null">
- AND A.risk_point_id = #{riskPointId ,jdbcType=BIGINT}
- </if>
- <if test="hazardId != null">
- AND A.hazard_id = #{hazardId ,jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND A.status = #{status,jdbcType=BIGINT}
- </if>
- ORDER BY A.risk_point_id ASC
- </select>
- </mapper>
|