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.
145 lines
6.6 KiB
XML
145 lines
6.6 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.QcCheckProjectMapper">
|
|
|
|
<resultMap type="QcCheckProject" id="QcCheckProjectResult">
|
|
<result property="id" column="id" />
|
|
<result property="orderNum" column="order_num" />
|
|
<result property="ruleName" column="rule_name" />
|
|
<result property="propertyCode" column="property_code" />
|
|
<result property="checkMode" column="check_mode" />
|
|
<result property="checkTool" column="check_tool" />
|
|
<result property="unitCode" column="unit_code" />
|
|
<result property="checkStandard" column="check_standard" />
|
|
<result property="attr1" column="attr1" />
|
|
<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" />
|
|
<result property="samplePlan" column="sample_plan" />
|
|
<result property="judge" column="judge" />
|
|
<result property="defectLevel" column="defect_level" />
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectQcCheckProjectVo">
|
|
select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard,
|
|
attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan,
|
|
judge,defect_level
|
|
from qc_check_project
|
|
</sql>
|
|
|
|
<select id="selectQcCheckProjectList" parameterType="QcCheckProject" resultMap="QcCheckProjectResult">
|
|
<include refid="selectQcCheckProjectVo"/>
|
|
<where>
|
|
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum}</if>
|
|
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
|
|
<if test="propertyCode != null and propertyCode != ''"> and property_code = #{propertyCode}</if>
|
|
<if test="checkMode != null and checkMode != ''"> and check_mode = #{checkMode}</if>
|
|
<if test="checkTool != null and checkTool != ''"> and check_tool = #{checkTool}</if>
|
|
<if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode}</if>
|
|
<if test="checkStandard != null and checkStandard != ''"> and check_standard = #{checkStandard}</if>
|
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
<if test="judge != null and judge != ''"> and judge = #{judge}</if>
|
|
</where>
|
|
order by create_time
|
|
</select>
|
|
|
|
<select id="selectQcCheckProjectById" parameterType="String" resultMap="QcCheckProjectResult">
|
|
<include refid="selectQcCheckProjectVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertQcCheckProject" parameterType="QcCheckProject">
|
|
insert into qc_check_project
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="orderNum != null">order_num,</if>
|
|
<if test="ruleName != null">rule_name,</if>
|
|
<if test="propertyCode != null">property_code,</if>
|
|
<if test="checkMode != null">check_mode,</if>
|
|
<if test="checkTool != null">check_tool,</if>
|
|
<if test="unitCode != null">unit_code,</if>
|
|
<if test="checkStandard != null">check_standard,</if>
|
|
<if test="attr1 != null">attr1,</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="samplePlan != null">sample_plan,</if>
|
|
<if test="judge != null">judge,</if>
|
|
<if test="defectLevel != null">defect_level,</if>
|
|
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
<if test="ruleName != null">#{ruleName},</if>
|
|
<if test="propertyCode != null">#{propertyCode},</if>
|
|
<if test="checkMode != null">#{checkMode},</if>
|
|
<if test="checkTool != null">#{checkTool},</if>
|
|
<if test="unitCode != null">#{unitCode},</if>
|
|
<if test="checkStandard != null">#{checkStandard},</if>
|
|
<if test="attr1 != null">#{attr1},</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="samplePlan != null">#{samplePlan},</if>
|
|
<if test="judge != null">#{judge},</if>
|
|
<if test="defectLevel != null">#{defectLevel},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateQcCheckProject" parameterType="QcCheckProject">
|
|
update qc_check_project
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="ruleName != null">rule_name = #{ruleName},</if>
|
|
<if test="propertyCode != null">property_code = #{propertyCode},</if>
|
|
<if test="checkMode != null">check_mode = #{checkMode},</if>
|
|
<if test="checkTool != null">check_tool = #{checkTool},</if>
|
|
<if test="unitCode != null">unit_code = #{unitCode},</if>
|
|
<if test="checkStandard != null">check_standard = #{checkStandard},</if>
|
|
<if test="attr1 != null">attr1 = #{attr1},</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="samplePlan != null">sample_plan = #{samplePlan},</if>
|
|
<if test="judge != null">judge = #{judge},</if>
|
|
<if test="defectLevel != null">defect_level = #{defectLevel},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteQcCheckProjectById" parameterType="String">
|
|
delete from qc_check_project where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteQcCheckProjectByIds" parameterType="String">
|
|
delete from qc_check_project where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectSerialNumber" resultType="com.op.quality.domain.QcCheckProject">
|
|
SELECT COUNT(id)+1 AS serialNumber
|
|
FROM qc_check_project
|
|
WHERE CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
|
|
</select>
|
|
|
|
</mapper>
|