|
|
|
@ -1,46 +1,7 @@
|
|
|
|
|
<?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.glxp.api.dao.trace.TraceManuOrderMapper">
|
|
|
|
|
<select id="filterTraces2" parameterType="com.glxp.api.req.trace.TraceManuOrderRequest"
|
|
|
|
|
resultType="com.glxp.api.res.trace.TraceManuOrderResponse">
|
|
|
|
|
-- 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 trace_record_log tr ON tr.recordCode = tmo.recordCode
|
|
|
|
|
LEFT JOIN trace_product_record trd ON trd.id = tr.traceProductIdFk
|
|
|
|
|
<where>
|
|
|
|
|
<if test="recordCode != '' and recordCode != null">
|
|
|
|
|
and mid.recordCode = #{recordCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="companyName != '' and companyName != null">
|
|
|
|
|
AND companyName LIKE CONCAT('%', #{companyName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != '' and nameCode != null">
|
|
|
|
|
and nameCode = #{nameCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="cpmctymc != '' and cpmctymc != null">
|
|
|
|
|
and cpmctymc = #{cpmctymc}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ggxh != '' and ggxh != null">
|
|
|
|
|
and ggxh = #{ggxh}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
|
|
|
|
and ylqxzcrbarmc = #{ylqxzcrbarmc}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
|
|
|
|
|
and zczbhhzbapzbh = #{zczbhhzbapzbh}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
AND trd.batchNo IS NOT NULL
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="filterTraces" parameterType="com.glxp.api.req.trace.TraceManuOrderRequest"
|
|
|
|
|
resultType="com.glxp.api.res.trace.TraceManuOrderResponse">
|
|
|
|
|
SELECT *
|
|
|
|
|