|
@@ -2017,13 +2017,13 @@
|
|
RRA.ADDRESS_TOWN "addressTown",
|
|
RRA.ADDRESS_TOWN "addressTown",
|
|
OO.ORDER_LINE_SEQUENCE "lineSqe",
|
|
OO.ORDER_LINE_SEQUENCE "lineSqe",
|
|
OO.DRIVER_TEL "capacityTel",
|
|
OO.DRIVER_TEL "capacityTel",
|
|
- (CASE WHEN
|
|
|
|
- OO.ORDER_STATUS = 2 and TTR.ORDER_STATUS = '已出厂'
|
|
|
|
|
|
+ (CASE
|
|
|
|
+ WHEN OIR.SALE_MATERIAL_ID IS NOT NULL
|
|
|
|
+ THEN '已入库'
|
|
|
|
+ WHEN OO.ORDER_STATUS = 2
|
|
THEN '已完成'
|
|
THEN '已完成'
|
|
WHEN TTR.ORDER_STATUS IS NULL
|
|
WHEN TTR.ORDER_STATUS IS NULL
|
|
THEN '未派发'
|
|
THEN '未派发'
|
|
- WHEN OIR.SALE_MATERIAL_ID IS NOT NULL
|
|
|
|
- THEN '已入库'
|
|
|
|
ELSE TTR.ORDER_STATUS
|
|
ELSE TTR.ORDER_STATUS
|
|
END) "orderStatusActually",
|
|
END) "orderStatusActually",
|
|
QQR.RESULT_START_TIME "queueStartTime",
|
|
QQR.RESULT_START_TIME "queueStartTime",
|
|
@@ -2347,9 +2347,9 @@
|
|
and <foreach collection="orderStatusList" item="item" open="(" separator="or" close=")">
|
|
and <foreach collection="orderStatusList" item="item" open="(" separator="or" close=")">
|
|
(CASE
|
|
(CASE
|
|
when OO.ORDER_STATUS =2
|
|
when OO.ORDER_STATUS =2
|
|
- then '作业已完成'
|
|
|
|
|
|
+ then '已完成'
|
|
when OO.ORDER_STATUS=4
|
|
when OO.ORDER_STATUS=4
|
|
- then '物流公司已派单'
|
|
|
|
|
|
+ then '已派单'
|
|
when nvl(OO.ORDER_STATUS,0)=0
|
|
when nvl(OO.ORDER_STATUS,0)=0
|
|
then '未派发'
|
|
then '未派发'
|
|
when OO.ORDER_STATUS=7
|
|
when OO.ORDER_STATUS=7
|
|
@@ -2365,7 +2365,7 @@
|
|
WHEN QQR.RESULT_START_TIME IS NOT NULL
|
|
WHEN QQR.RESULT_START_TIME IS NOT NULL
|
|
THEN '排队中'
|
|
THEN '排队中'
|
|
when OO.ORDER_STATUS=5
|
|
when OO.ORDER_STATUS=5
|
|
- then '司机已接单'
|
|
|
|
|
|
+ then '已接单'
|
|
WHEN TER.INSERT_TIME IS NULL
|
|
WHEN TER.INSERT_TIME IS NULL
|
|
THEN ' '
|
|
THEN ' '
|
|
WHEN TLFR.INSERT_TIME IS NULL THEN ' '
|
|
WHEN TLFR.INSERT_TIME IS NULL THEN ' '
|
|
@@ -2374,8 +2374,10 @@
|
|
</if>
|
|
</if>
|
|
<if test="orderStatusActuallyList != null and orderStatusActuallyList.size > 0">
|
|
<if test="orderStatusActuallyList != null and orderStatusActuallyList.size > 0">
|
|
and <foreach collection="orderStatusActuallyList" item="item" open="(" separator="or" close=")">
|
|
and <foreach collection="orderStatusActuallyList" item="item" open="(" separator="or" close=")">
|
|
- (CASE WHEN
|
|
|
|
- OO.ORDER_STATUS = 2 and TTR.ORDER_STATUS = '已出厂'
|
|
|
|
|
|
+ (CASE
|
|
|
|
+ WHEN OIR.SALE_MATERIAL_ID IS NOT NULL
|
|
|
|
+ THEN '已入库'
|
|
|
|
+ WHEN OO.ORDER_STATUS = 2
|
|
THEN '已完成'
|
|
THEN '已完成'
|
|
WHEN TTR.ORDER_STATUS IS NULL
|
|
WHEN TTR.ORDER_STATUS IS NULL
|
|
THEN '未派发'
|
|
THEN '未派发'
|
|
@@ -6529,6 +6531,10 @@
|
|
THEN '已放行'
|
|
THEN '已放行'
|
|
ELSE TTR.ORDER_STATUS
|
|
ELSE TTR.ORDER_STATUS
|
|
END) "orderStatus",
|
|
END) "orderStatus",
|
|
|
|
+ CASE WHEN OOR.INVENTORY_ID IS NOT NULL
|
|
|
|
+ THEN '已出库'
|
|
|
|
+ ELSE '未出库'
|
|
|
|
+ END "outboundStatus",
|
|
QQR.RESULT_START_TIME "queueStartTime",
|
|
QQR.RESULT_START_TIME "queueStartTime",
|
|
QQR.UPDATE_TIME "allowEnfactoryTime",
|
|
QQR.UPDATE_TIME "allowEnfactoryTime",
|
|
TWB .WEIGHT_BATCH_ID "weightBatchId",
|
|
TWB .WEIGHT_BATCH_ID "weightBatchId",
|
|
@@ -6762,6 +6768,14 @@
|
|
END) like '%${item}%'
|
|
END) like '%${item}%'
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="outboundStatusList != null and outboundStatusList.size > 0">
|
|
|
|
+ and <foreach collection="outboundStatusList" item="item" index="index" separator="or" close=")" open="(">
|
|
|
|
+ CASE WHEN OOR.INVENTORY_ID IS NOT NULL
|
|
|
|
+ THEN '已出库'
|
|
|
|
+ ELSE '未出库'
|
|
|
|
+ END like '%${item}%'
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
<if test="addressPlaceList != null and addressPlaceList.size > 0">
|
|
<if test="addressPlaceList != null and addressPlaceList.size > 0">
|
|
and <foreach collection="addressPlaceList" item="item" open="(" separator="or" close=")">
|
|
and <foreach collection="addressPlaceList" item="item" open="(" separator="or" close=")">
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT ||
|
|
RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT ||
|
|
@@ -6799,13 +6813,26 @@
|
|
and ASO.DELETED = 0
|
|
and ASO.DELETED = 0
|
|
AND ASM.DELETED IS NULL
|
|
AND ASM.DELETED IS NULL
|
|
and ASO.SALE_TYPE = 50
|
|
and ASO.SALE_TYPE = 50
|
|
- <if test="oneDate != null">
|
|
|
|
|
|
+ <if test="oneDate != null and orderNoFlag == null and dateType != 2">
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd') < = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
and to_date(#{oneDate}, 'yyyy-mm-dd') < = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
</if>
|
|
</if>
|
|
- <if test="startDate != null">
|
|
|
|
|
|
+ <if test="startDate != null and orderNoFlag == null and dateType != 2">
|
|
and to_date(#{startDate}, 'yyyy-mm-dd') <= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
and to_date(#{startDate}, 'yyyy-mm-dd') <= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
and to_date(#{endDate}, 'yyyy-mm-dd') >= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
and to_date(#{endDate}, 'yyyy-mm-dd') >= to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="oneDate != null and orderNoFlag == null and dateType != null and dateType == 2">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd') < = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate != null and orderNoFlag == null and dateType != null and dateType == 2">
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd') <= to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd') >= to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderNoFlag == null">
|
|
|
|
+ and OO.ORDER_ID IS NOT NULL
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderNoFlag != null">
|
|
|
|
+ and OO.ORDER_ID IS NULL
|
|
|
|
+ </if>
|
|
<if test="saleNo != null">
|
|
<if test="saleNo != null">
|
|
and aso.sale_number like '%${saleNo}%'
|
|
and aso.sale_number like '%${saleNo}%'
|
|
</if>
|
|
</if>
|