|
|
|
@ -230,17 +230,28 @@ |
|
|
|
AND h.request_no = #{requestNo} |
|
|
|
</select> |
|
|
|
<select id="getQcPersonList" resultType="com.xujie.modules.inspection.entity.QcPersonList"> |
|
|
|
SELECT username, user_display |
|
|
|
FROM sys_user |
|
|
|
SELECT DISTINCT |
|
|
|
a.username AS userName, |
|
|
|
a.user_display AS userDisplay |
|
|
|
FROM sys_user a |
|
|
|
INNER JOIN access_role ar |
|
|
|
ON ar.username = a.username |
|
|
|
AND ar.site = #{qc.site} |
|
|
|
AND ar.role_no = 'QC' |
|
|
|
INNER JOIN business_role br |
|
|
|
ON br.site = ar.site |
|
|
|
AND br.role_no = ar.role_no |
|
|
|
AND ISNULL(br.active, 'Y') = 'Y' |
|
|
|
<where> |
|
|
|
a.status = 1 |
|
|
|
<if test="qc.userName != null and qc.userName != ''"> |
|
|
|
AND username LIKE CONCAT('%', #{qc.userName}, '%') |
|
|
|
AND a.username LIKE CONCAT('%', #{qc.userName}, '%') |
|
|
|
</if> |
|
|
|
<if test="qc.userDisplay != null and qc.userDisplay != ''"> |
|
|
|
AND user_display LIKE CONCAT('%', #{qc.userDisplay}, '%') |
|
|
|
AND a.user_display LIKE CONCAT('%', #{qc.userDisplay}, '%') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY username |
|
|
|
ORDER BY a.username |
|
|
|
</select> |
|
|
|
|
|
|
|
<delete id="deleteByRequestNo"> |
|
|
|
@ -292,17 +303,31 @@ |
|
|
|
SELECT |
|
|
|
h.request_no AS requestNo, |
|
|
|
s.supplier_name AS supplierName, |
|
|
|
d.poNo AS poNo, |
|
|
|
h.inspect_address AS inspectAddress, |
|
|
|
h.plan_start_date AS planStartDate, |
|
|
|
h.plan_end_date AS planEndDate |
|
|
|
FROM srm_inspection_request_header h |
|
|
|
LEFT JOIN srm_supplier s |
|
|
|
ON h.supplier_no = s.supplier_no |
|
|
|
WHERE h.qc_operator = #{qcOperator} |
|
|
|
ON h.supplier_no = s.supplier_no |
|
|
|
AND h.site = s.site |
|
|
|
LEFT JOIN ( |
|
|
|
SELECT |
|
|
|
site, |
|
|
|
request_no, |
|
|
|
MIN(order_ref1) AS poNo |
|
|
|
FROM srm_inspect_request_detail |
|
|
|
GROUP BY site, request_no |
|
|
|
) d |
|
|
|
ON d.site = h.site |
|
|
|
AND d.request_no = h.request_no |
|
|
|
WHERE h.site = #{site} |
|
|
|
AND h.qc_operator = #{qcOperator} |
|
|
|
AND h.status_db = 'Scheduled' |
|
|
|
AND h.plan_start_date IS NOT NULL |
|
|
|
AND h.plan_end_date IS NOT NULL |
|
|
|
AND h.plan_end_date >= GETDATE() |
|
|
|
AND CAST(h.plan_end_date AS DATE) >= CAST(#{startDate} AS DATE) |
|
|
|
AND CAST(#{endDate} AS DATE) >= CAST(h.plan_start_date AS DATE) |
|
|
|
ORDER BY h.plan_start_date ASC |
|
|
|
|
|
|
|
</select> |
|
|
|
|