|
|
|
@ -23,15 +23,17 @@
|
|
|
|
|
ico.splitMsg,
|
|
|
|
|
ico.fromCorpName,
|
|
|
|
|
ico.tagMsg,
|
|
|
|
|
sys_workplace_document.busName busTypeName,
|
|
|
|
|
thr_bustype_origin.name actionName,
|
|
|
|
|
sys_workplace_document.busName busTypeName,
|
|
|
|
|
thr_bustype_origin.name actionName,
|
|
|
|
|
sw.workplaceName,
|
|
|
|
|
ico.id,
|
|
|
|
|
ico.orderTime,
|
|
|
|
|
ico.uploadStatus,
|
|
|
|
|
ico.uploadError,
|
|
|
|
|
ico.errorMsg,
|
|
|
|
|
row_number() over ( order by case when ico.orderTime is null then ico.createTime else ico.orderTime end desc ) as orderSequence
|
|
|
|
|
row_number() over ( order by case
|
|
|
|
|
when ico.orderTime is null then ico.createTime
|
|
|
|
|
else ico.orderTime end desc ) as orderSequence
|
|
|
|
|
FROM io_collect_order ico
|
|
|
|
|
left join sys_workplace_document on ico.busType = sys_workplace_document.documentTypeCode
|
|
|
|
|
left join thr_bustype_origin on sys_workplace_document.documentTypeCode = thr_bustype_origin.action
|
|
|
|
@ -49,7 +51,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="fromCorp != '' and fromCorp != null">
|
|
|
|
|
AND ( fromCorp LIKE concat('%', #{fromCorp}, '%') or fromCorpName LIKE concat('%', #{fromCorp}, '%') )
|
|
|
|
|
AND (fromCorp LIKE concat('%', #{fromCorp}, '%') or fromCorpName LIKE concat('%', #{fromCorp}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fromType != '' and fromType != null">
|
|
|
|
|
AND fromType LIKE concat('%', #{fromType}, '%')
|
|
|
|
@ -65,7 +67,8 @@
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="excludeWorkCode != null and excludeWorkCode != ''">
|
|
|
|
|
AND ico.workPlaceCode is not null and ico.workPlaceCode not in (#{excludeWorkCode})
|
|
|
|
|
AND ico.workPlaceCode is not null
|
|
|
|
|
and ico.workPlaceCode not in (#{excludeWorkCode})
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="chargeUser != null">
|
|
|
|
@ -76,10 +79,10 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unionKey != null">
|
|
|
|
|
AND (
|
|
|
|
|
ico.billNo like concat( #{unionKey})
|
|
|
|
|
ico.billNo like concat(#{unionKey})
|
|
|
|
|
or ico.fromCorp like concat(#{unionKey})
|
|
|
|
|
or ico.fromCorpName like concat(#{unionKey})
|
|
|
|
|
or ico.backupOrderRemark1 like concat( #{unionKey})
|
|
|
|
|
or ico.backupOrderRemark1 like concat(#{unionKey})
|
|
|
|
|
or ico.backupOrderRemark2 like concat(#{unionKey})
|
|
|
|
|
or ico.backupOrderRemark3 like concat(#{unionKey})
|
|
|
|
|
or ico.backupOrderRemark4 like concat(#{unionKey})
|
|
|
|
@ -107,10 +110,10 @@
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invAlert != null and invAlert != 1">
|
|
|
|
|
and ico.invAlert =#{invAlert}
|
|
|
|
|
and ico.invAlert = #{invAlert}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invAlert == 1">
|
|
|
|
|
and ico.invAlert in (0,1)
|
|
|
|
|
and ico.invAlert in (0, 1)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invAlerts != null and invAlerts.size() > 0">
|
|
|
|
|
and ico.invAlert in
|
|
|
|
@ -123,12 +126,12 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="keyWords != null and keyWords != ''">
|
|
|
|
|
and (ico.billNo like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.fromCorp like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.fromCorpName like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.workPlaceCode like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.busType like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.fromCorpName like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.fromType like concat('%', #{keyWords}, '%'))
|
|
|
|
|
or ico.fromCorp like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.fromCorpName like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.workPlaceCode like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.busType like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.fromCorpName like concat('%', #{keyWords}, '%')
|
|
|
|
|
or ico.fromType like concat('%', #{keyWords}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="shipperName != '' and shipperName != null">
|
|
|
|
|
AND ico.shipperName LIKE concat('%', #{shipperName}, '%')
|
|
|
|
@ -136,19 +139,18 @@
|
|
|
|
|
<if test="fromCorpName != '' and fromCorpName != null">
|
|
|
|
|
AND ico.fromCorpName LIKE concat('%', #{fromCorpName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime != null">
|
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and ico.billTime >= DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
]]>
|
|
|
|
|
and ico.billTime >= DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endTime != null">
|
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and ico.billTime <= DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
]]>
|
|
|
|
|
and ico.billTime <= DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY
|
|
|
|
|
ico.billNo
|
|
|
|
|
GROUP BY ico.billNo
|
|
|
|
|
order by case when ico.orderTime is null then ico.createTime else ico.orderTime end desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -178,7 +180,6 @@
|
|
|
|
|
TRUNCATE io_collect_order_biz_origin;
|
|
|
|
|
TRUNCATE io_collect_order_backup;
|
|
|
|
|
TRUNCATE io_collect_order_biz_backup;
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateInvAlert" parameterType="map">
|
|
|
|
|