2026-04-24 17:49:38 +08:00
|
|
|
<?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.nflg.wms.repository.mapper.QmsIncomingInspectionTaskNonconformanceMapper">
|
|
|
|
|
|
|
|
|
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskNonconformanceVO">
|
|
|
|
|
SELECT
|
2026-04-28 10:09:43 +08:00
|
|
|
t.id as task_id,
|
2026-05-09 10:39:00 +08:00
|
|
|
it.id as ticket_id,
|
2026-04-28 10:09:43 +08:00
|
|
|
t.task_no,
|
|
|
|
|
it.ticket_no,
|
|
|
|
|
it.ticket_title,
|
|
|
|
|
t.material_id,
|
|
|
|
|
m.material_no,
|
|
|
|
|
m.material_desc,
|
|
|
|
|
m.drawing_no_ver,
|
2026-05-09 10:48:14 +08:00
|
|
|
qis.version,
|
2026-04-28 10:09:43 +08:00
|
|
|
t.supplier_code,
|
|
|
|
|
t.supplier_name,
|
|
|
|
|
t.delivery_order_no,
|
|
|
|
|
t.delivery_order_line,
|
|
|
|
|
t.purchase_order_no,
|
|
|
|
|
t.purchase_order_line,
|
|
|
|
|
t.factory,
|
|
|
|
|
t.inspection_type,
|
|
|
|
|
t.inspection_qty,
|
|
|
|
|
t.qualified_qty,
|
|
|
|
|
t.unqualified_qty,
|
|
|
|
|
t.inspection_status,
|
|
|
|
|
t.inspection_result,
|
|
|
|
|
t.inspector_id,
|
|
|
|
|
t.inspector_name,
|
|
|
|
|
t.submit_time,
|
|
|
|
|
t.inspection_start_time,
|
|
|
|
|
t.inspection_finish_time,
|
|
|
|
|
t.required_finish_time,
|
|
|
|
|
t.is_overdue,
|
2026-05-09 10:39:00 +08:00
|
|
|
CASE WHEN it.status IS NULL THEN 0 ELSE it.status END AS status,
|
|
|
|
|
it.association_task_no
|
2026-04-28 10:09:43 +08:00
|
|
|
FROM qms_incoming_inspection_task t
|
|
|
|
|
LEFT JOIN qms_issue_ticket it ON it.source_id = t.id
|
2026-04-24 17:49:38 +08:00
|
|
|
INNER JOIN qms_qc_material m ON t.material_id = m.id
|
2026-05-09 10:48:14 +08:00
|
|
|
LEFT JOIN qms_inspection_standard qis ON t.inspection_standard_id = qis.id
|
2026-04-28 10:09:43 +08:00
|
|
|
WHERE t.inspection_status=2 and t.inspection_result=false
|
|
|
|
|
AND ((t.inspection_type=0 and t.purchase_group=#{request.purchaseGroup}) or (t.inspection_type=1 and #{request.isWarehouseManager}=true))
|
|
|
|
|
<if test="request.dataType != null">
|
|
|
|
|
AND t.data_type = #{request.dataType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.materialNo != null and request.materialNo != ''">
|
|
|
|
|
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.purchaseOrderNo != null and request.purchaseOrderNo != ''">
|
|
|
|
|
AND t.purchase_order_no ilike concat('%', #{request.purchaseOrderNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.supplierName != null and request.supplierName != ''">
|
|
|
|
|
AND t.supplier_name ilike concat('%', #{request.supplierName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.inspectorName != null and request.inspectorName != ''">
|
|
|
|
|
AND t.inspector_name ilike concat('%', #{request.inspectorName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.inspectionStatus != null">
|
|
|
|
|
AND t.inspection_status = #{request.inspectionStatus}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.factory != null and request.factory != ''">
|
|
|
|
|
AND t.factory = #{request.factory}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.warehouse != null and request.warehouse != ''">
|
|
|
|
|
AND t.warehouse = #{request.warehouse}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.deliveryOrderNo != null and request.deliveryOrderNo != ''">
|
|
|
|
|
AND t.delivery_order_no ilike concat('%', #{request.deliveryOrderNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.inspectionResult != null">
|
|
|
|
|
AND t.inspection_result = #{request.inspectionResult}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.isOverdue != null">
|
|
|
|
|
AND t.is_overdue = #{request.isOverdue}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.submitStartDate != null">
|
|
|
|
|
AND t.submit_time >= #{request.submitStartDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.submitEndDate != null">
|
|
|
|
|
AND t.submit_time < #{request.submitEndDate} + INTERVAL '1 day'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.inspectionBeginStartDate != null">
|
|
|
|
|
AND t.inspection_start_time >= #{request.inspectionBeginStartDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.inspectionBeginEndDate != null">
|
|
|
|
|
AND t.inspection_start_time < #{request.inspectionBeginEndDate} + INTERVAL '1 day'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.inspectionStartDate != null">
|
|
|
|
|
AND t.inspection_finish_time >= #{request.inspectionStartDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.inspectionEndDate != null">
|
|
|
|
|
AND t.inspection_finish_time < #{request.inspectionEndDate} + INTERVAL '1 day'
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY t.id DESC
|
2026-04-24 17:49:38 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|