123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <?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.sys.mapper.ChecklistItemPointMapper">
- <resultMap id="ChecklistItemPointDtoResultMap" type="com.zhyc.xps.sys.dto.ChecklistItemPointDto">
- <result column="checklist_id" property="checklistId" jdbcType="BIGINT" />
- <result column="item_id" property="itemId" jdbcType="BIGINT" />
- <result column="item_title" property="itemTitle" jdbcType="VARCHAR" />
- <result column="point_id" property="pointId" jdbcType="BIGINT" />
- <result column="point_code" property="pointCode" jdbcType="VARCHAR" />
- <result column="point_content" property="pointContent" jdbcType="VARCHAR" />
- <result column="point_reference" property="pointReference" jdbcType="VARCHAR" />
- <result column="point_remark" property="pointRemark" jdbcType="VARCHAR" />
- <result column="sort_no" property="sortNo" jdbcType="BIGINT" />
- </resultMap>
- <sql id="ChecklistItemPointDto_Cols">
- A.checklist_id,
- A.item_id,
- B.item_title,
- A.point_id,
- A.point_code,
- A.point_content,
- A.point_reference,
- A.point_remark,
- A.sort_no
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="ChecklistItemPointDtoResultMap">
- SELECT
- <include refid="ChecklistItemPointDto_Cols"/>
- FROM checklist_item_point AS A
- LEFT JOIN checklist_item AS B ON (A.oc_id = B.oc_id AND A.checklist_id = B.checklist_id AND A.item_id = B.item_id)
- WHERE A.deleted_flag = 0
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- AND A.checklist_id = #{checklistId ,jdbcType=BIGINT}
- AND A.item_id = #{itemId ,jdbcType=BIGINT}
- AND A.point_id = #{pointId,jdbcType=BIGINT}
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="ChecklistItemPointDtoResultMap">
- SELECT
- <include refid="ChecklistItemPointDto_Cols"/>
- FROM checklist_item_point AS A
- LEFT JOIN checklist_item AS B ON (A.oc_id = B.oc_id AND A.checklist_id = B.checklist_id AND A.item_id = B.item_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="checklistId != null">
- AND A.checklist_id = #{checklistId ,jdbcType=BIGINT}
- </if>
- <if test="itemId != null">
- AND A.item_id = #{itemId ,jdbcType=BIGINT}
- </if>
- <if test="pointId != null">
- AND A.point_id = #{pointId,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.point_content like "%"#{keywords}"%"
- </if>
- ORDER BY A.item_id, A.sort_no
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="ChecklistItemPointDtoResultMap" >
- SELECT
- <include refid="ChecklistItemPointDto_Cols"/>
- FROM checklist_item_point AS A
- LEFT JOIN checklist_item AS B ON (A.oc_id = B.oc_id AND A.checklist_id = B.checklist_id AND A.item_id = B.item_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="checklistId != null">
- AND A.checklist_id = #{checklistId ,jdbcType=BIGINT}
- </if>
- <if test="itemId != null">
- AND A.item_id = #{itemId ,jdbcType=BIGINT}
- </if>
- <if test="pointId != null">
- AND A.point_id = #{pointId,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.point_content like "%"#{keywords}"%"
- </if>
- ORDER BY A.item_id, A.sort_no
- </select>
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.ChecklistItemPoint">
- INSERT INTO checklist_item_point
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="checklistId != null">
- checklist_id,
- </if>
- <if test="itemId != null">
- item_id,
- </if>
- <if test="pointId != null">
- point_id,
- </if>
- <if test="pointContent != null and pointContent != ''">
- point_content,
- </if>
- <if test="pointCode != null and pointCode != ''">
- point_code,
- </if>
- <if test="pointReference != null and pointReference != ''">
- point_reference,
- </if>
- <if test="pointRemark != null and pointRemark != ''">
- point_remark,
- </if>
- <if test="sortNo != null">
- sort_no,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId, jdbcType=BIGINT},
- </if>
- <if test="checklistId != null">
- #{checklistId, jdbcType=BIGINT},
- </if>
- <if test="itemId != null">
- #{itemId ,jdbcType=BIGINT},
- </if>
- <if test="pointId != null">
- #{pointId ,jdbcType=BIGINT},
- </if>
- <if test="pointContent != null and pointContent != ''">
- #{pointContent ,jdbcType=VARCHAR},
- </if>
- <if test="pointCode != null and pointCode != ''">
- #{pointCode ,jdbcType=VARCHAR},
- </if>
- <if test="pointReference != null and pointReference != ''">
- #{pointReference ,jdbcType=VARCHAR},
- </if>
- <if test="pointRemark != null and pointRemark != ''">
- #{pointRemark, jdbcType=VARCHAR},
- </if>
- <if test="sortNo != null">
- #{sortNo ,jdbcType=BIGINT},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.ChecklistItemPoint">
- UPDATE checklist_item_point
- <trim suffixOverrides=",">
- <set>
- <if test="pointContent != null and pointContent != ''">
- point_content = #{pointContent, jdbcType=VARCHAR},
- </if>
- <if test="pointCode != null and pointCode != ''">
- point_code = #{pointCode ,jdbcType=VARCHAR},
- </if>
- <if test="pointReference != null and pointReference != ''">
- point_reference = #{pointReference ,jdbcType=VARCHAR},
- </if>
- <if test="pointRemark != null and pointRemark != ''">
- point_remark = #{pointRemark, jdbcType=VARCHAR},
- </if>
- <if test="sortNo != null">
- sort_no = #{sortNo ,jdbcType=BIGINT},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- AND checklist_id = #{checklistId ,jdbcType=BIGINT}
- AND item_id = #{itemId ,jdbcType=BIGINT}
- AND point_id = #{pointId ,jdbcType=BIGINT}
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE checklist_item_point
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- <if test="checklistId != null">
- AND checklist_id = #{checklistId ,jdbcType=BIGINT}
- </if>
- <if test="itemId != null">
- AND item_id = #{itemId ,jdbcType=BIGINT}
- </if>
- <if test="pointId != null">
- AND point_id = #{pointId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|