|
@@ -1915,13 +1915,13 @@
|
|
LEFT JOIN RMS_CONSIGNEE RC
|
|
LEFT JOIN RMS_CONSIGNEE RC
|
|
ON RC.CONSIGNEE_ID=ASO.RECEIVE_ID
|
|
ON RC.CONSIGNEE_ID=ASO.RECEIVE_ID
|
|
<where>
|
|
<where>
|
|
- OO.ORDER_TYPE = 2
|
|
|
|
- <if test="orgCode!=null">
|
|
|
|
|
|
+ OO.ORDER_TYPE = 2 AND TWR.RESULT_NET_WEIGHT IS NOT NULL AND ASO.CLOSE_STATUS IS NOT NULL
|
|
|
|
+ <if test="orgCode!=null">
|
|
AND OO.OPTIONER_CODE = #{orgCode}
|
|
AND OO.OPTIONER_CODE = #{orgCode}
|
|
</if>
|
|
</if>
|
|
-<!-- <if test="oneDate != null">-->
|
|
|
|
-<!-- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TWR.RESULT_GROSS_WEIGHT_TIME-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
|
+ </if>
|
|
<if test="startDate != null">
|
|
<if test="startDate != null">
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
@@ -2011,7 +2011,8 @@
|
|
AND TUR.SEGMENT_SQE = 8
|
|
AND TUR.SEGMENT_SQE = 8
|
|
AND TWR4.TARE_SEGMENT_SQE = 9
|
|
AND TWR4.TARE_SEGMENT_SQE = 9
|
|
AND TLFR2.SEGMENT_SQE = 10
|
|
AND TLFR2.SEGMENT_SQE = 10
|
|
- and oo.ORDER_TYPE in (10,20,15,16)
|
|
|
|
|
|
+ and oo.ORDER_TYPE in (10,20)
|
|
|
|
+ AND twr4.result_net_weight IS NOT NULL
|
|
<if test="orgCode!=null">
|
|
<if test="orgCode!=null">
|
|
and oo.OPTIONER_CODE = #{orgCode}
|
|
and oo.OPTIONER_CODE = #{orgCode}
|
|
</if>
|
|
</if>
|
|
@@ -2020,9 +2021,9 @@
|
|
or (instr(rc.capacity_number , #{index}) > 0) or (instr(rce.consignee_company_name , #{index}) > 0)
|
|
or (instr(rc.capacity_number , #{index}) > 0) or (instr(rce.consignee_company_name , #{index}) > 0)
|
|
or (instr( RC.CARRIER_NAME , #{index}) > 0) or (instr(RL.LINE_NAME , #{index}) > 0)
|
|
or (instr( RC.CARRIER_NAME , #{index}) > 0) or (instr(RL.LINE_NAME , #{index}) > 0)
|
|
</if>
|
|
</if>
|
|
-<!-- <if test="oneDate != null">-->
|
|
|
|
-<!-- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TWR4.RESULT_TARE_WEIGHT_TIME-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TWR4.RESULT_TARE_WEIGHT_TIME
|
|
|
|
+ </if>
|
|
<if test="startDate != null">
|
|
<if test="startDate != null">
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR4.RESULT_TARE_WEIGHT_TIME
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR4.RESULT_TARE_WEIGHT_TIME
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR4.RESULT_TARE_WEIGHT_TIME
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR4.RESULT_TARE_WEIGHT_TIME
|
|
@@ -2033,7 +2034,7 @@
|
|
select OO.ORDER_NUMBER "orderNumber",
|
|
select OO.ORDER_NUMBER "orderNumber",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RM.MATERIAL_NAME "materialName",
|
|
RC.CAPACITY_NUMBER "capacityNumber",
|
|
RC.CAPACITY_NUMBER "capacityNumber",
|
|
- RS.SHIPPER_NAME "sendName",
|
|
|
|
|
|
+ RS.SUPPLIER_NAME "sendName",
|
|
RC2.CONSIGNEE_COMPANY_NAME "reciveName",
|
|
RC2.CONSIGNEE_COMPANY_NAME "reciveName",
|
|
TWR.RESULT_GROSS_WEIGHT "grossWeight",
|
|
TWR.RESULT_GROSS_WEIGHT "grossWeight",
|
|
TWR.RESULT_TARE_WEIGHT "tareWeight",
|
|
TWR.RESULT_TARE_WEIGHT "tareWeight",
|
|
@@ -2056,8 +2057,8 @@
|
|
ON OO.ORDER_PLAN_ID=APO.PURCHASE_ORDER_ID
|
|
ON OO.ORDER_PLAN_ID=APO.PURCHASE_ORDER_ID
|
|
LEFT JOIN RMS_CARRIER RC3
|
|
LEFT JOIN RMS_CARRIER RC3
|
|
ON RC3.CARRIER_ID=OO.CARRIER_ID
|
|
ON RC3.CARRIER_ID=OO.CARRIER_ID
|
|
- LEFT JOIN RMS_SHIPPER RS
|
|
|
|
- ON RS.SHIPPER_ID=APO.SUPPLIER_UNIT_ID
|
|
|
|
|
|
+ LEFT JOIN RMS_SUPPLIER RS
|
|
|
|
+ ON RS.SUPPLIER_ID=APO.SUPPLIER_UNIT_ID
|
|
LEFT JOIN RMS_CONSIGNEE RC2
|
|
LEFT JOIN RMS_CONSIGNEE RC2
|
|
ON RC2.CONSIGNEE_ID =APO.RECEIVE_UNIT_ID
|
|
ON RC2.CONSIGNEE_ID =APO.RECEIVE_UNIT_ID
|
|
LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
|
|
LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
|
|
@@ -2067,7 +2068,7 @@
|
|
LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
|
|
LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
|
|
ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
|
|
ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
|
|
<where>
|
|
<where>
|
|
- OO.ORDER_TYPE IN (5,6,7,8,17,18)
|
|
|
|
|
|
+ OO.ORDER_TYPE IN (6,7) and TWR.RESULT_NET_WEIGHT IS NOT NULL and RL.LINE_ID IN (129988,129989,129991,129992,89992)
|
|
<if test="orgCode!=null">
|
|
<if test="orgCode!=null">
|
|
AND OO.OPTIONER_CODE=#{orgCode}
|
|
AND OO.OPTIONER_CODE=#{orgCode}
|
|
</if>
|
|
</if>
|
|
@@ -2076,9 +2077,9 @@
|
|
or (instr( RC2.CONSIGNEE_COMPANY_NAME, #{index}) > 0) or (instr( RC3.CARRIER_NAME, #{index}) > 0)
|
|
or (instr( RC2.CONSIGNEE_COMPANY_NAME, #{index}) > 0) or (instr( RC3.CARRIER_NAME, #{index}) > 0)
|
|
or (instr(RL.LINE_NAME, #{index}) > 0) or (instr(RM.MATERIAL_NAME, #{index}) > 0)
|
|
or (instr(RL.LINE_NAME, #{index}) > 0) or (instr(RM.MATERIAL_NAME, #{index}) > 0)
|
|
</if>
|
|
</if>
|
|
-<!-- <if test="oneDate != null">-->
|
|
|
|
-<!-- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TWR.RESULT_TARE_WEIGHT_TIME-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = TWR.RESULT_TARE_WEIGHT_TIME
|
|
|
|
+ </if>
|
|
<if test="startDate != null">
|
|
<if test="startDate != null">
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_TARE_WEIGHT_TIME
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_TARE_WEIGHT_TIME
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_TARE_WEIGHT_TIME
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_TARE_WEIGHT_TIME
|
|
@@ -2099,7 +2100,7 @@
|
|
TWR.RESULT_TARE_WEIGHT "tareWeight",
|
|
TWR.RESULT_TARE_WEIGHT "tareWeight",
|
|
greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME) "netWeightTime",
|
|
greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME) "netWeightTime",
|
|
TWR.RESULT_GROSS_WEIGHT_TIME "grossweightTime",
|
|
TWR.RESULT_GROSS_WEIGHT_TIME "grossweightTime",
|
|
- TWR.RESULT_GROSS_WEIGHT "grossweight",
|
|
|
|
|
|
+ TWR.RESULT_GROSS_WEIGHT "grossWeight",
|
|
RL.LINE_NAME "lineName",
|
|
RL.LINE_NAME "lineName",
|
|
RC2.CARRIER_NAME "carrierName"
|
|
RC2.CARRIER_NAME "carrierName"
|
|
from OMSTRUCK_ORDER OO
|
|
from OMSTRUCK_ORDER OO
|
|
@@ -2119,16 +2120,16 @@
|
|
left join RMS_WAREHOUSE RW1 on ARM.REQUIREMENT_UNLOAD_UNIT_ID = RW1.WAREHOUSE_ID
|
|
left join RMS_WAREHOUSE RW1 on ARM.REQUIREMENT_UNLOAD_UNIT_ID = RW1.WAREHOUSE_ID
|
|
left join RMS_WAREHOUSE RW2 on ARM.REQUIREMENT_PLATFORM_ID = RW2.WAREHOUSE_ID
|
|
left join RMS_WAREHOUSE RW2 on ARM.REQUIREMENT_PLATFORM_ID = RW2.WAREHOUSE_ID
|
|
<where>
|
|
<where>
|
|
- OO.ORDER_TYPE = 11
|
|
|
|
|
|
+ OO.ORDER_TYPE in (11,15,16) AND TWR.RESULT_NET_WEIGHT IS NOT NULL
|
|
<if test="orgCode!=null">
|
|
<if test="orgCode!=null">
|
|
AND OO.OPTIONER_CODE=#{orgCode}
|
|
AND OO.OPTIONER_CODE=#{orgCode}
|
|
</if>
|
|
</if>
|
|
-<!-- <if test="oneDate != null">-->
|
|
|
|
-<!-- and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = netWeightTime-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
|
|
+ <if test="oneDate != null">
|
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME)
|
|
|
|
+ </if>
|
|
<if test="startDate != null">
|
|
<if test="startDate != null">
|
|
- and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= netWeightTime
|
|
|
|
- and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= netWeightTime
|
|
|
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME)
|
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= greatest(TWR.RESULT_TARE_WEIGHT_TIME,TWR.RESULT_GROSS_WEIGHT_TIME)
|
|
</if>
|
|
</if>
|
|
<if test="index!=null">
|
|
<if test="index!=null">
|
|
and (instr(RC.CAPACITY_NUMBER, #{index}) > 0) or (instr(RW1.WAREHOUSE_NAME, #{index}) > 0)
|
|
and (instr(RC.CAPACITY_NUMBER, #{index}) > 0) or (instr(RW1.WAREHOUSE_NAME, #{index}) > 0)
|