|
|
|
<?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.QcCheckTaskIncomeMapper">
|
|
|
|
|
|
|
|
<resultMap type="QcCheckTaskIncome" id="QcCheckTaskIncomeResult">
|
|
|
|
<result property="recordId" column="record_id" />
|
|
|
|
<result property="checkNo" column="check_no" />
|
|
|
|
<result property="incomeBatchNo" column="income_batch_no" />
|
|
|
|
<result property="orderNo" column="order_no" />
|
|
|
|
<result property="materialCode" column="material_code" />
|
|
|
|
<result property="materialName" column="material_name" />
|
|
|
|
<result property="quality" column="quality" />
|
|
|
|
<result property="unit" column="unit" />
|
|
|
|
<result property="supplierCode" column="supplier_code" />
|
|
|
|
<result property="supplierName" column="supplier_name" />
|
|
|
|
<result property="incomeTime" column="income_time" />
|
|
|
|
<result property="checkLoc" column="check_loc" />
|
|
|
|
<result property="checkStatus" column="check_status" />
|
|
|
|
<result property="checkManCode" column="check_man_code" />
|
|
|
|
<result property="checkManName" column="check_man_name" />
|
|
|
|
<result property="checkTime" column="check_time" />
|
|
|
|
<result property="checkResult" column="check_result" />
|
|
|
|
<result property="status" column="status" />
|
|
|
|
<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="selectQcCheckTaskIncomeVo">
|
|
|
|
select record_id, check_no, income_batch_no, order_no, material_code, material_name, quality, unit, supplier_code, supplier_name, income_time, check_loc, check_status, check_man_code, check_man_name, check_time, check_result, status, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_task_income
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectQcCheckTaskIncomeList" parameterType="QcCheckTaskIncome" resultMap="QcCheckTaskIncomeResult">
|
|
|
|
<include refid="selectQcCheckTaskIncomeVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="checkNo != null and checkNo != ''"> and check_no = #{checkNo}</if>
|
|
|
|
<if test="incomeBatchNo != null and incomeBatchNo != ''"> and income_batch_no = #{incomeBatchNo}</if>
|
|
|
|
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
|
|
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
|
|
<if test="quality != null "> and quality = #{quality}</if>
|
|
|
|
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
|
|
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
|
|
|
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
|
|
<if test="incomeTime != null "> and income_time = #{incomeTime}</if>
|
|
|
|
<if test="checkLoc != null and checkLoc != ''"> and check_loc = #{checkLoc}</if>
|
|
|
|
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</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="checkTime != null "> and check_time = #{checkTime}</if>
|
|
|
|
<if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</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="selectQcCheckTaskIncomeByRecordId" parameterType="String" resultMap="QcCheckTaskIncomeResult">
|
|
|
|
<include refid="selectQcCheckTaskIncomeVo"/>
|
|
|
|
where record_id = #{recordId}
|
|
|
|
</select>
|
|
|
|
<select id="getQcListBom" resultType="com.op.quality.domain.QcBomComponent">
|
|
|
|
select product_code component,product_desc_zh componentName
|
|
|
|
from base_product
|
|
|
|
where del_flag = '0'
|
|
|
|
<if test="component != null and component != ''"> and product_code like concat('%', #{component}, '%')</if>
|
|
|
|
<if test="componentName != null and componentName != ''"> and product_desc_zh like concat('%', #{componentName}, '%')</if>
|
|
|
|
</select>
|
|
|
|
<select id="getQcListSupplier" resultType="com.op.quality.domain.QcSupplier">
|
|
|
|
select supplier_code supplierCode,
|
|
|
|
zh_desc supplierName,
|
|
|
|
address,
|
|
|
|
contact_phone contactPhone
|
|
|
|
from base_supplier where active_flag = '1' and del_flag ='0'
|
|
|
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
|
|
|
|
<if test="supplierName != null and supplierName != ''"> and zh_desc like concat('%', #{supplierName}, '%')</if>
|
|
|
|
</select>
|
|
|
|
<select id="getQcListUser" resultType="com.op.system.api.domain.SysUser">
|
|
|
|
select user_id userId,
|
|
|
|
user_name userCode,
|
|
|
|
nick_name userName,
|
|
|
|
phonenumber
|
|
|
|
from sys_user where del_flag = '0' and status = '0'
|
|
|
|
<if test="userCode != null and userCode != ''"> and user_name like concat('%', #{userCode}, '%')</if>
|
|
|
|
<if test="userName != null and userName != ''"> and nick_name like concat('%', #{userName}, '%')</if>
|
|
|
|
</select>
|
|
|
|
<select id="getTodayMaxNum" resultType="java.lang.Integer">
|
|
|
|
select count(0)+1
|
|
|
|
from qc_check_task_income
|
|
|
|
where CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertQcCheckTaskIncome" parameterType="QcCheckTaskIncome">
|
|
|
|
insert into qc_check_task_income
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="recordId != null">record_id,</if>
|
|
|
|
<if test="checkNo != null">check_no,</if>
|
|
|
|
<if test="incomeBatchNo != null">income_batch_no,</if>
|
|
|
|
<if test="orderNo != null">order_no,</if>
|
|
|
|
<if test="materialCode != null">material_code,</if>
|
|
|
|
<if test="materialName != null">material_name,</if>
|
|
|
|
<if test="quality != null">quality,</if>
|
|
|
|
<if test="unit != null">unit,</if>
|
|
|
|
<if test="supplierCode != null">supplier_code,</if>
|
|
|
|
<if test="supplierName != null">supplier_name,</if>
|
|
|
|
<if test="incomeTime != null">income_time,</if>
|
|
|
|
<if test="checkLoc != null">check_loc,</if>
|
|
|
|
<if test="checkStatus != null">check_status,</if>
|
|
|
|
<if test="checkManCode != null">check_man_code,</if>
|
|
|
|
<if test="checkManName != null">check_man_name,</if>
|
|
|
|
<if test="checkTime != null">check_time,</if>
|
|
|
|
<if test="checkResult != null">check_result,</if>
|
|
|
|
<if test="status != null">status,</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="recordId != null">#{recordId},</if>
|
|
|
|
<if test="checkNo != null">#{checkNo},</if>
|
|
|
|
<if test="incomeBatchNo != null">#{incomeBatchNo},</if>
|
|
|
|
<if test="orderNo != null">#{orderNo},</if>
|
|
|
|
<if test="materialCode != null">#{materialCode},</if>
|
|
|
|
<if test="materialName != null">#{materialName},</if>
|
|
|
|
<if test="quality != null">#{quality},</if>
|
|
|
|
<if test="unit != null">#{unit},</if>
|
|
|
|
<if test="supplierCode != null">#{supplierCode},</if>
|
|
|
|
<if test="supplierName != null">#{supplierName},</if>
|
|
|
|
<if test="incomeTime != null">#{incomeTime},</if>
|
|
|
|
<if test="checkLoc != null">#{checkLoc},</if>
|
|
|
|
<if test="checkStatus != null">#{checkStatus},</if>
|
|
|
|
<if test="checkManCode != null">#{checkManCode},</if>
|
|
|
|
<if test="checkManName != null">#{checkManName},</if>
|
|
|
|
<if test="checkTime != null">#{checkTime},</if>
|
|
|
|
<if test="checkResult != null">#{checkResult},</if>
|
|
|
|
<if test="status != null">#{status},</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="updateQcCheckTaskIncome" parameterType="QcCheckTaskIncome">
|
|
|
|
update qc_check_task_income
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="checkNo != null">check_no = #{checkNo},</if>
|
|
|
|
<if test="incomeBatchNo != null">income_batch_no = #{incomeBatchNo},</if>
|
|
|
|
<if test="orderNo != null">order_no = #{orderNo},</if>
|
|
|
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
|
|
|
<if test="materialName != null">material_name = #{materialName},</if>
|
|
|
|
<if test="quality != null">quality = #{quality},</if>
|
|
|
|
<if test="unit != null">unit = #{unit},</if>
|
|
|
|
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
|
|
|
|
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
|
|
|
<if test="incomeTime != null">income_time = #{incomeTime},</if>
|
|
|
|
<if test="checkLoc != null">check_loc = #{checkLoc},</if>
|
|
|
|
<if test="checkStatus != null">check_status = #{checkStatus},</if>
|
|
|
|
<if test="checkManCode != null">check_man_code = #{checkManCode},</if>
|
|
|
|
<if test="checkManName != null">check_man_name = #{checkManName},</if>
|
|
|
|
<if test="checkTime != null">check_time = #{checkTime},</if>
|
|
|
|
<if test="checkResult != null">check_result = #{checkResult},</if>
|
|
|
|
<if test="status != null">status = #{status},</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 record_id = #{recordId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteQcCheckTaskIncomeByRecordId" parameterType="String">
|
|
|
|
delete from qc_check_task_income where record_id = #{recordId}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteQcCheckTaskIncomeByRecordIds" parameterType="String">
|
|
|
|
delete from qc_check_task_income where record_id in
|
|
|
|
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
|
|
|
#{recordId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|