|
|
|
@ -3,14 +3,21 @@
|
|
|
|
|
<mapper namespace="com.glxp.api.dao.trace.TraceManuOrderMapper">
|
|
|
|
|
<select id="filterTraces" parameterType="com.glxp.api.req.trace.TraceManuOrderRequest"
|
|
|
|
|
resultType="com.glxp.api.res.trace.TraceManuOrderResponse">
|
|
|
|
|
SELECT tmo.*, mid.*, uc.companyName
|
|
|
|
|
-- SELECT tmo.*, mid.*, uc.companyName
|
|
|
|
|
-- FROM trace_manu_order tmo
|
|
|
|
|
-- LEFT JOIN user_company uc ON uc.id = tmo.companyIdFk
|
|
|
|
|
-- LEFT JOIN (
|
|
|
|
|
-- SELECT tr.recordCode, tr.createUser, tr.remark, trd.batchNo, trd.traceType
|
|
|
|
|
-- FROM trace_record_log tr
|
|
|
|
|
-- LEFT JOIN trace_product_record trd ON trd.id = tr.traceProductIdFk
|
|
|
|
|
-- ) mid ON mid.recordCode = tmo.recordCode
|
|
|
|
|
SELECT tmo.*, trd.batchNo, trd.traceType, tr.createUser, tr.remark, uc.companyName
|
|
|
|
|
FROM trace_manu_order tmo
|
|
|
|
|
LEFT JOIN user_company uc ON uc.id = tmo.companyIdFk
|
|
|
|
|
LEFT JOIN (
|
|
|
|
|
SELECT tr.recordCode, tr.createUser, tr.remark, trd.batchNo, trd.traceType
|
|
|
|
|
FROM trace_record_log tr
|
|
|
|
|
LEFT JOIN trace_record_log tr ON tr.recordCode = tmo.recordCode
|
|
|
|
|
LEFT JOIN trace_product_record trd ON trd.id = tr.traceProductIdFk
|
|
|
|
|
) mid ON mid.recordCode = tmo.recordCode
|
|
|
|
|
WHERE trd.batchNo IS NOT NULL
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
<if test="recordCode != '' and recordCode != null">
|
|
|
|
|
and mid.recordCode = #{recordCode}
|
|
|
|
|