| 
					
				 | 
			
			
				@@ -1178,8 +1178,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="findPassedOrder" resultType="java.util.Map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SELECT OO.ORDER_ID "orderId", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-               RC.CAPACITY_NUMBER "capacityNumber" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        distinct 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        OO.ORDER_ID "orderId",RC.CAPACITY_NUMBER "capacityNumber" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM OMSTRUCK_ORDER OO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            ON TTR.ORDER_ID = OO.ORDER_ID 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1193,9 +1194,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WHERE OO.ORDER_TYPE = 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           AND OO.ORDER_STATUS IN (4,5) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          AND (TER.RESULT_ENTRY_GATE_TIME IS NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          OR TWR.RESULT_TARE_WEIGHT =0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          AND OO.INSERT_TIME between 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          AND TER.RESULT_ENTRY_GATE_TIME IS NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          and (TWR.RESULT_TARE_WEIGHT =0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					or TWR.RESULT_TARE_WEIGHT is NULL) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          AND ASOM.SALE_DATE_OF_RECEIPT between 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           sysdate-1 and sysdate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           ORDER BY OO.ORDER_ID DESC 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1358,9 +1360,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <update id="closePassedOrder" > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         UPDATE OMSTRUCK_ORDER OO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SET OO.ORDER_STATUS=7 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SET OO.ORDER_STATUS = 7 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WHERE OO.ORDER_ID IN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        (SELECT OO.ORDER_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (SELECT OO.ORDER_ID ,RC.CAPACITY_NUMBER "capacityNumber" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM OMSTRUCK_ORDER OO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            ON TTR.ORDER_ID = OO.ORDER_ID 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1374,9 +1375,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WHERE OO.ORDER_TYPE = 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           AND OO.ORDER_STATUS IN (4,5) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          AND (TER.RESULT_ENTRY_GATE_TIME IS NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          OR TWR.RESULT_TARE_WEIGHT =0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          AND OO.INSERT_TIME between 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          AND TER.RESULT_ENTRY_GATE_TIME IS NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          and (TWR.RESULT_TARE_WEIGHT =0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					or TWR.RESULT_TARE_WEIGHT is NULL) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          AND ASOM.SALE_DATE_OF_RECEIPT between 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           sysdate-1 and sysdate 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </update> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1403,6 +1405,25 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where oo.order_id=#{orderId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="sumNetWeight" resultType="java.math.BigDecimal"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       select sum(TWR.RESULT_NET_WEIGHT) "sum"  from TMSTRUCK_TOTAL_RESULT TTR 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       ON TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       WHERE TTR.ORDER_ID=#{orderId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <update id="updateStatusTwo"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        update OMSTRUCK_ORDER OO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        set OO.ORDER_STATUS=2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHERE OO.ORDER_ID=#{orderId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <update id="updateStatusSeven"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        update OMSTRUCK_ORDER OO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        set OO.ORDER_STATUS=7 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHERE OO.ORDER_ID=#{orderId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="queueSingle" resultType="java.math.BigDecimal"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         select qql.LIST_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         from OMSTRUCK_ORDER oo 
			 |