|
|
|
@ -3,38 +3,15 @@
|
|
|
|
|
<mapper namespace="com.glxp.api.dao.trace.TraceRecordMapper">
|
|
|
|
|
<select id="filterTraces" parameterType="com.glxp.api.req.trace.TraceRecordRequest"
|
|
|
|
|
resultType="com.glxp.api.res.trace.TraceRecordResponse">
|
|
|
|
|
select *
|
|
|
|
|
from trace_record
|
|
|
|
|
inner join trace_record_detail
|
|
|
|
|
on trace_record.id = trace_record_detail.recordIdFk
|
|
|
|
|
SELECT tr.recordCode,tr.remark,trd.*,mid.*
|
|
|
|
|
FROM trace_record tr
|
|
|
|
|
LEFT JOIN trace_record_detail trd ON trd.recordIdFk = tr.id
|
|
|
|
|
LEFT JOIN (SELECT tor.recordCodeFk,tor.fromCorp,tor.toCorp,tor.createUser,uc.companyName
|
|
|
|
|
FROM trace_order tor LEFT JOIN user_company uc ON uc.id = tor.companyIdFk) mid ON mid.recordCodeFk = tr.recordCode
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != '' and id != null">
|
|
|
|
|
and id = #{id}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="recordCode != '' and recordCode != null">
|
|
|
|
|
and recordCode = #{recordCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fromType != '' and fromType != null">
|
|
|
|
|
and fromType = #{fromType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createUser != '' and createUser != null">
|
|
|
|
|
and `createUser` = #{createUser}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="traceType != '' and traceType != null">
|
|
|
|
|
and traceType = #{traceType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="udiCode != '' and udiCode != null">
|
|
|
|
|
and udiCode = #{udiCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditNum != '' and creditNum != null">
|
|
|
|
|
and creditNum = #{creditNum}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
|
|
|
|
and `ylqxzcrbarmc` = #{ylqxzcrbarmc}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != '' and nameCode != null">
|
|
|
|
|
and nameCode = #{nameCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="cpmctymc != '' and cpmctymc != null">
|
|
|
|
|
and cpmctymc = #{cpmctymc}
|
|
|
|
|
</if>
|
|
|
|
@ -45,6 +22,5 @@
|
|
|
|
|
and `batchNo` = #{batchNo}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY id DESC
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|