|
|
|
@ -11,9 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<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="sampleQuality" column="sample_quality" />
|
|
|
|
|
<result property="noOkQuality" column="noOk_quality" />
|
|
|
|
|
<result property="quality" column="quality" />
|
|
|
|
|
<result property="unit" column="unit" />
|
|
|
|
|
<result property="supplierCode" column="supplier_code" />
|
|
|
|
|
<result property="supplierName" column="supplier_name" />
|
|
|
|
@ -35,9 +33,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<result property="checkType" column="check_type" />
|
|
|
|
|
<result property="checkName" column="check_name" />
|
|
|
|
|
<result property="sampleQuality" column="sample_quality" />
|
|
|
|
|
<result property="checkName" column="check_name" />
|
|
|
|
|
<result property="checkType" column="check_type"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap type="QcCheckReportIncome" id="QcCheckReportIncomeResult">
|
|
|
|
|
<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" />
|
|
|
|
|
<result property="sampleQuality" column="sample_quality" />
|
|
|
|
|
<result property="checkName" column="check_name" />
|
|
|
|
|
<result property="checkType" column="check_type"/>
|
|
|
|
|
<result property="createTimeStr" column="createTimeStr" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectQcCheckTaskProduceVo">
|
|
|
|
@ -266,4 +299,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
#{recordId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectQcCheckReportIncomeList" parameterType="QcCheckReportIncome" resultMap="QcCheckReportIncomeResult">
|
|
|
|
|
select * from (
|
|
|
|
|
select qct.record_id, qct.check_no, qct.income_batch_no,
|
|
|
|
|
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
|
|
|
|
|
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
|
|
|
|
|
qct.check_time, qct.check_result, qct.check_type,'首件检验' check_name,
|
|
|
|
|
CONVERT(varchar(10),qct.create_time, 120) createTimeStr
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
<where>
|
|
|
|
|
<if test="checkNo != null and checkNo != ''"> and qct.check_no = #{checkNo}</if>
|
|
|
|
|
<if test="incomeBatchNo != null and incomeBatchNo != ''"> and qct.income_batch_no = #{incomeBatchNo}</if>
|
|
|
|
|
<if test="orderNo != null and orderNo != ''"> and qct.order_no = #{orderNo}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and qct.material_code = #{materialCode}</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''"> and qct.material_name like concat('%', #{materialName}, '%')</if>
|
|
|
|
|
<if test="supplierCode != null and supplierCode != ''"> and qct.supplier_code = #{supplierCode}</if>
|
|
|
|
|
<if test="supplierName != null and supplierName != ''"> and qct.supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
|
|
|
<if test="checkLoc != null and checkLoc != ''"> and qct.check_loc = #{checkLoc}</if>
|
|
|
|
|
<if test="checkStatus != null and checkStatus != ''"> and qct.check_status = #{checkStatus}</if>
|
|
|
|
|
<if test="checkManCode != null and checkManCode != ''"> and qct.check_man_code = #{checkManCode}</if>
|
|
|
|
|
<if test="checkManName != null and checkManName != ''"> and qct.check_man_name like concat('%', #{checkManName}, '%')</if>
|
|
|
|
|
<if test="checkResult != null and checkResult != ''"> and qct.check_result = #{checkResult}</if>
|
|
|
|
|
<if test="incomeTimeStart != null "> and CONVERT(varchar(30),qct.income_time, 120) >= #{incomeTimeStart}</if>
|
|
|
|
|
<if test="incomeTimeEnd != null "> and #{incomeTimeEnd} > CONVERT(varchar(30),qct.income_time, 120)</if>
|
|
|
|
|
<if test="checkTimeStart != null "> and CONVERT(varchar(30),qct.create_time, 120) >= #{checkTimeStart}</if>
|
|
|
|
|
<if test="checkTimeEnd != null "> and #{checkTimeEnd} > CONVERT(varchar(30),qct.create_time, 120)</if>
|
|
|
|
|
and qct.check_type = 'checkTypeSC'
|
|
|
|
|
</where>
|
|
|
|
|
union ALL
|
|
|
|
|
select
|
|
|
|
|
'','','',
|
|
|
|
|
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
|
|
|
|
|
qct.supplier_code, qct.supplier_name, qct.income_time,'','',
|
|
|
|
|
'','', qct.check_type,'巡检检验' check_name,CONVERT(varchar(10),qct.create_time, 120) createTimeStr
|
|
|
|
|
from qc_check_task qct
|
|
|
|
|
<where>
|
|
|
|
|
<if test="checkNo != null and checkNo != ''"> and qct.check_no = #{checkNo}</if>
|
|
|
|
|
<if test="incomeBatchNo != null and incomeBatchNo != ''"> and qct.income_batch_no = #{incomeBatchNo}</if>
|
|
|
|
|
<if test="orderNo != null and orderNo != ''"> and qct.order_no = #{orderNo}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and qct.material_code = #{materialCode}</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''"> and qct.material_name like concat('%', #{materialName}, '%')</if>
|
|
|
|
|
<if test="supplierCode != null and supplierCode != ''"> and qct.supplier_code = #{supplierCode}</if>
|
|
|
|
|
<if test="supplierName != null and supplierName != ''"> and qct.supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
|
|
|
<if test="checkLoc != null and checkLoc != ''"> and qct.check_loc = #{checkLoc}</if>
|
|
|
|
|
<if test="checkStatus != null and checkStatus != ''"> and qct.check_status = #{checkStatus}</if>
|
|
|
|
|
<if test="checkManCode != null and checkManCode != ''"> and qct.check_man_code = #{checkManCode}</if>
|
|
|
|
|
<if test="checkManName != null and checkManName != ''"> and qct.check_man_name like concat('%', #{checkManName}, '%')</if>
|
|
|
|
|
<if test="checkResult != null and checkResult != ''"> and qct.check_result = #{checkResult}</if>
|
|
|
|
|
<if test="incomeTimeStart != null "> and CONVERT(varchar(30),qct.income_time, 120) >= #{incomeTimeStart}</if>
|
|
|
|
|
<if test="incomeTimeEnd != null "> and #{incomeTimeEnd} > CONVERT(varchar(30),qct.income_time, 120)</if>
|
|
|
|
|
<if test="checkTimeStart != null "> and CONVERT(varchar(30),qct.create_time, 120) >= #{checkTimeStart}</if>
|
|
|
|
|
<if test="checkTimeEnd != null "> and #{checkTimeEnd} > CONVERT(varchar(30),qct.create_time, 120)</if>
|
|
|
|
|
and qct.check_type = 'checkTypeSCXJ'
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
|
|
|
|
|
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_type,CONVERT(varchar(10),qct.create_time, 120)
|
|
|
|
|
) t order by t.order_no,t.createTimeStr desc
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|