@@ -2101,7 +2101,29 @@
</if>
<if test="orderStatusList != null">
and <foreach collection="orderStatusList" item="item" open="(" separator="or" close=")">
- DECODE(OO.ORDER_STATUS ,2,'作业已完成',4,'物流公司已派单',5,'司机已接单',0,'未派发',7,'已关闭',8,'已关闭') like '%${item}%'
+ (CASE
+ when OO.ORDER_STATUS =2
+ then '作业已完成'
+ when OO.ORDER_STATUS=4
+ then '物流公司已派单'
+ when nvl(OO.ORDER_STATUS,0)=0
+ then '未派发'
+ when OO.ORDER_STATUS=7
+ then '已关闭'
+ when OO.ORDER_STATUS=8
+ WHEN TRR.INSERT_TIME IS NOT NULL
+ THEN '已完成'
+ WHEN TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+ THEN '已出厂'
+ WHEN TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
+ THEN '已进厂'
+ when OO.ORDER_STATUS=5
+ then '司机已接单'
+ WHEN TER.INSERT_TIME IS NULL
+ THEN ' '
+ WHEN TLFR.INSERT_TIME IS NULL THEN ' '
+ END) like '%${item}%'
</foreach>
<if test="addressPlaceList != null">