You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
178 lines
6.8 KiB
XML
178 lines
6.8 KiB
XML
<?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.op.quality.mapper.QcCheckTaskUserMapper">
|
|
|
|
<resultMap type="QcCheckTaskUser" id="QcCheckTaskUserResult">
|
|
<result property="recordId" column="record_id" />
|
|
<result property="checkNo" column="check_no" />
|
|
<result property="checkManCode" column="check_man_code" />
|
|
<result property="checkManName" column="check_man_name" />
|
|
<result property="attr1" column="attr1" />
|
|
<result property="attr2" column="attr2" />
|
|
<result property="attr3" column="attr3" />
|
|
<result property="attr4" column="attr4" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="factoryCode" column="factory_code" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectQcCheckTaskUserVo">
|
|
select record_id, check_no, check_man_code, check_man_name, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_task_user
|
|
</sql>
|
|
|
|
<select id="selectQcCheckTaskUserList" parameterType="QcCheckTaskUser" resultMap="QcCheckTaskUserResult">
|
|
<include refid="selectQcCheckTaskUserVo"/>
|
|
<where>
|
|
<if test="checkNo != null and checkNo != ''"> and check_no = #{checkNo}</if>
|
|
<if test="checkManCode != null and checkManCode != ''"> and check_man_code = #{checkManCode}</if>
|
|
<if test="checkManName != null and checkManName != ''"> and check_man_name like concat('%', #{checkManName}, '%')</if>
|
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
|
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectQcCheckTaskUserByRecordId" parameterType="String" resultMap="QcCheckTaskUserResult">
|
|
<include refid="selectQcCheckTaskUserVo"/>
|
|
where record_id = #{recordId}
|
|
</select>
|
|
|
|
<insert id="insertQcCheckTaskUser" parameterType="QcCheckTaskUser">
|
|
insert into qc_check_task_user
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="recordId != null">record_id,</if>
|
|
<if test="checkNo != null">check_no,</if>
|
|
<if test="checkManCode != null">check_man_code,</if>
|
|
<if test="checkManName != null">check_man_name,</if>
|
|
<if test="attr1 != null">attr1,</if>
|
|
<if test="attr2 != null">attr2,</if>
|
|
<if test="attr3 != null">attr3,</if>
|
|
<if test="attr4 != null">attr4,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="belongTo != null">belong_to,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="recordId != null">#{recordId},</if>
|
|
<if test="checkNo != null">#{checkNo},</if>
|
|
<if test="checkManCode != null">#{checkManCode},</if>
|
|
<if test="checkManName != null">#{checkManName},</if>
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
<if test="attr2 != null">#{attr2},</if>
|
|
<if test="attr3 != null">#{attr3},</if>
|
|
<if test="attr4 != null">#{attr4},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="belongTo != null">#{belongTo},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateQcCheckTaskUser" parameterType="QcCheckTaskUser">
|
|
update qc_check_task_user
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="checkNo != null">check_no = #{checkNo},</if>
|
|
<if test="checkManCode != null">check_man_code = #{checkManCode},</if>
|
|
<if test="checkManName != null">check_man_name = #{checkManName},</if>
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
<if test="attr2 != null">attr2 = #{attr2},</if>
|
|
<if test="attr3 != null">attr3 = #{attr3},</if>
|
|
<if test="attr4 != null">attr4 = #{attr4},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="belongTo != null">belong_to = #{belongTo},</if>
|
|
</trim>
|
|
where record_id = #{recordId}
|
|
</update>
|
|
|
|
<delete id="deleteQcCheckTaskUserByRecordId" parameterType="String">
|
|
delete from qc_check_task_user where record_id = #{recordId}
|
|
</delete>
|
|
|
|
<delete id="deleteQcCheckTaskUserByRecordIds" parameterType="String">
|
|
delete from qc_check_task_user where record_id in
|
|
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
|
#{recordId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<delete id="deleteQcCheckTaskUserByBelongTo" parameterType="String">
|
|
delete from qc_check_task_user where belong_to = #{belongTo}
|
|
</delete>
|
|
|
|
<insert id="insertQcCheckTaskUserList" parameterType="List">
|
|
insert into qc_check_task_user(
|
|
record_id,
|
|
check_no,
|
|
check_man_code,
|
|
check_man_name,
|
|
attr1,
|
|
attr2,
|
|
attr3,
|
|
attr4,
|
|
create_by,
|
|
create_time,
|
|
update_by,
|
|
update_time,
|
|
factory_code,
|
|
del_flag,
|
|
belong_to
|
|
)
|
|
values
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
(
|
|
#{item.recordId},
|
|
#{item.checkNo},
|
|
#{item.checkManCode},
|
|
#{item.checkManName},
|
|
#{item.attr1},
|
|
#{item.attr2},
|
|
#{item.attr3},
|
|
#{item.attr4},
|
|
#{item.createBy},
|
|
#{item.createTime},
|
|
#{item.updateBy},
|
|
#{item.updateTime},
|
|
#{item.factoryCode},
|
|
#{item.delFlag},
|
|
#{item.belongTo}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<select id="selectQcCheckTaskUserByBelongTo" parameterType="String" resultMap="QcCheckTaskUserResult">
|
|
select
|
|
STRING_AGG(check_man_code,',') AS 'manCodes',
|
|
STRING_AGG(check_man_name,',') AS 'manNames',
|
|
belong_to
|
|
from qc_check_task_user
|
|
where belong_to = #{belongTo}
|
|
group by belong_to
|
|
</select>
|
|
|
|
<delete id="deleteQcCheckTaskUserByBelongTos" parameterType="String">
|
|
delete from qc_check_task_user where belong_to in
|
|
<foreach item="belongTo" collection="Array" open="(" separator="," close=")">
|
|
#{belongTo}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |