2026-04-21 17:55:14 +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.QmsIncomingInspectionTaskMapper">
|
|
|
|
|
|
|
|
|
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO">
|
|
|
|
|
SELECT
|
|
|
|
|
t.id,
|
|
|
|
|
t.task_no,
|
|
|
|
|
t.material_id,
|
|
|
|
|
m.material_no,
|
|
|
|
|
m.material_desc,
|
|
|
|
|
m.drawing_no_ver,
|
|
|
|
|
t.inspection_standard_id,
|
|
|
|
|
s.version AS standard_version,
|
|
|
|
|
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.agent_id,
|
|
|
|
|
t.agent_name,
|
|
|
|
|
t.submit_time,
|
|
|
|
|
t.inspection_start_time,
|
|
|
|
|
t.inspection_finish_time,
|
|
|
|
|
t.required_finish_time,
|
|
|
|
|
t.is_overdue,
|
|
|
|
|
t.related_task_no,
|
|
|
|
|
t.update_user_id,
|
|
|
|
|
t.update_user_name,
|
|
|
|
|
t.update_time
|
|
|
|
|
FROM qms_incoming_inspection_task t
|
|
|
|
|
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
|
|
|
|
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
|
|
|
|
<where>
|
|
|
|
|
<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.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.inspectionType != null">
|
|
|
|
|
AND t.inspection_type = #{request.inspectionType}
|
|
|
|
|
</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>
|
2026-04-23 13:46:08 +08:00
|
|
|
<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>
|
2026-04-21 17:55:14 +08:00
|
|
|
<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>
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY t.id DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
2026-04-23 09:58:48 +08:00
|
|
|
<select id="todoSearch" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO">
|
|
|
|
|
SELECT
|
|
|
|
|
t.id,
|
|
|
|
|
t.task_no,
|
|
|
|
|
t.material_id,
|
|
|
|
|
m.material_no,
|
|
|
|
|
m.material_desc,
|
|
|
|
|
m.drawing_no_ver,
|
|
|
|
|
t.inspection_standard_id,
|
|
|
|
|
s.version AS standard_version,
|
|
|
|
|
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.agent_id,
|
|
|
|
|
t.agent_name,
|
|
|
|
|
t.submit_time,
|
|
|
|
|
t.inspection_start_time,
|
|
|
|
|
t.inspection_finish_time,
|
|
|
|
|
t.required_finish_time,
|
|
|
|
|
t.is_overdue,
|
|
|
|
|
t.related_task_no,
|
|
|
|
|
t.update_user_id,
|
|
|
|
|
t.update_user_name,
|
|
|
|
|
t.update_time
|
|
|
|
|
FROM qms_incoming_inspection_task t
|
|
|
|
|
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
|
|
|
|
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
|
|
|
|
<where>
|
2026-04-23 17:51:06 +08:00
|
|
|
<choose>
|
|
|
|
|
<when test="request.inspectionStatus != null">
|
|
|
|
|
t.inspection_status = #{request.inspectionStatus}
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
t.inspection_status IN (0, 1)
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
2026-04-23 09:58:48 +08:00
|
|
|
AND (t.inspector_id = #{inspectorId} OR t.agent_id = #{inspectorId})
|
2026-04-23 17:51:06 +08:00
|
|
|
<if test="request.isOverdue != null">
|
|
|
|
|
AND t.is_overdue = #{request.isOverdue}
|
|
|
|
|
</if>
|
2026-04-23 09:58:48 +08:00
|
|
|
<if test="request.materialNo != null and request.materialNo != ''">
|
|
|
|
|
AND m.material_no ilike concat('%', #{request.materialNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.drawingNo != null and request.drawingNo != ''">
|
|
|
|
|
AND m.drawing_no ilike concat('%', #{request.drawingNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.taskNo != null and request.taskNo != ''">
|
|
|
|
|
AND t.task_no ilike concat('%', #{request.taskNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.supplierCode != null and request.supplierCode != ''">
|
|
|
|
|
AND t.supplier_code ilike concat('%', #{request.supplierCode}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.supplierName != null and request.supplierName != ''">
|
|
|
|
|
AND t.supplier_name ilike concat('%', #{request.supplierName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY t.required_finish_time ASC
|
|
|
|
|
</select>
|
|
|
|
|
|
2026-04-23 17:51:06 +08:00
|
|
|
<select id="getDetail" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO">
|
|
|
|
|
SELECT
|
|
|
|
|
t.id,
|
|
|
|
|
t.task_no,
|
|
|
|
|
t.material_id,
|
|
|
|
|
m.material_no,
|
|
|
|
|
m.material_desc,
|
|
|
|
|
m.drawing_no_ver,
|
|
|
|
|
t.inspection_standard_id,
|
|
|
|
|
s.version AS standard_version,
|
|
|
|
|
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.agent_id,
|
|
|
|
|
t.agent_name,
|
|
|
|
|
t.submit_time,
|
|
|
|
|
t.inspection_start_time,
|
|
|
|
|
t.inspection_finish_time,
|
|
|
|
|
t.required_finish_time,
|
|
|
|
|
t.is_overdue,
|
|
|
|
|
t.related_task_no,
|
|
|
|
|
t.update_user_id,
|
|
|
|
|
t.update_user_name,
|
|
|
|
|
t.update_time
|
|
|
|
|
FROM qms_incoming_inspection_task t
|
|
|
|
|
LEFT JOIN qms_qc_material m ON t.material_id = m.id
|
|
|
|
|
LEFT JOIN qms_inspection_standard s ON t.inspection_standard_id = s.id
|
|
|
|
|
WHERE t.id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
2026-04-21 17:55:14 +08:00
|
|
|
</mapper>
|