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.

132 lines
6.1 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.QcCheckUnqualifiedMapper">
<resultMap type="QcCheckUnqualified" id="QcCheckUnqualifiedResult">
<result property="id" column="id" />
<result property="taskId" column="task_id" />
<result property="status" column="status" />
<result property="nextNodeCode" column="next_node_code" />
<result property="nextNodeName" column="next_node_name" />
<result property="remark" column="remark" />
<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="selectQcCheckUnqualifiedVo">
select id, task_id, status, next_node_code, next_node_name, remark,
attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag
from qc_check_unqualified
</sql>
<select id="selectQcCheckUnqualifiedList" parameterType="QcCheckUnqualified" resultMap="QcCheckUnqualifiedResult">
select id, task_id, status, next_node_code, next_node_name, remark,
attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag
from qc_check_unqualified
<where>
<if test="taskId != null and taskId != ''"> and task_id like concat('%', #{taskId}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="nextNodeCode != null and nextNodeCode != ''"> and next_node_code = #{nextNodeCode}</if>
<if test="nextNodeName != null and nextNodeName != ''"> and next_node_name like concat('%', #{nextNodeName}, '%')</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>
and del_flag = #{delFlag}
<if test="checkTimeStart != null "> and CONVERT(varchar(30),create_time, 120) >= #{checkTimeStart}</if>
<if test="checkTimeEnd != null "> and #{checkTimeEnd} > CONVERT(varchar(30),create_time, 120)</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectQcCheckUnqualifiedById" parameterType="String" resultMap="QcCheckUnqualifiedResult">
<include refid="selectQcCheckUnqualifiedVo"/>
where id = #{id}
</select>
<insert id="insertQcCheckUnqualified" parameterType="QcCheckUnqualified">
insert into qc_check_unqualified
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="taskId != null">task_id,</if>
<if test="status != null">status,</if>
<if test="type != null">type,</if>
<if test="nextNodeCode != null">next_node_code,</if>
<if test="nextNodeName != null">next_node_name,</if>
<if test="remark != null">remark,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="taskId != null">#{taskId},</if>
<if test="status != null">#{status},</if>
<if test="type != null">#{type},</if>
<if test="nextNodeCode != null">#{nextNodeCode},</if>
<if test="nextNodeName != null">#{nextNodeName},</if>
<if test="remark != null">#{remark},</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>
</trim>
</insert>
<update id="updateQcCheckUnqualified" parameterType="QcCheckUnqualified">
update qc_check_unqualified
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="status != null">status = #{status},</if>
<if test="nextNodeCode != null">next_node_code = #{nextNodeCode},</if>
<if test="nextNodeName != null">next_node_name = #{nextNodeName},</if>
<if test="remark != null">remark = #{remark},</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>
</trim>
where id = #{id}
</update>
<delete id="deleteQcCheckUnqualifiedById" parameterType="String">
delete from qc_check_unqualified where id = #{id}
</delete>
<delete id="deleteQcCheckUnqualifiedByIds" parameterType="String">
delete from qc_check_unqualified where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>