| 
					
				 | 
			
			
				@@ -497,6 +497,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join RMS_GATEPOST RG 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         on RG.GATEPOST_ID = TER.GATEPOST_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="purchaseOrderId != null"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -589,6 +596,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join RMS_GATEPOST RG 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         on RG.GATEPOST_ID = TER.GATEPOST_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = 4 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="materialName != null"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -727,6 +741,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         LEFT JOIN RMS_CONSIGNEE RCON 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WHERE TER.RESULT_ENTRY_GATE_TIME IS NOT NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               AND OO.ORDER_TYPE IN (1, 2, 3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -854,6 +875,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     ON RC.CAPACITY_ID = OO.CAPACITY_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  WHERE OO.ORDER_TYPE = 4 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    AND TER.RESULT_ENTRY_GATE_TIME IS NOT NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="dayplanNo != null"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -947,6 +975,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     on RG.GATEPOST_ID = TER.GATEPOST_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  where TER.RESULT_ENTRY_GATE_TIME is not null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    and OO.ORDER_TYPE = 9 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="purchaseOrderId != null"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1043,6 +1078,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         on RG.GATEPOST_ID = TER.GATEPOST_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where TER.RESULT_ENTRY_GATE_TIME is not null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         and OO.ORDER_TYPE = 11 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="materialName != null"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1192,6 +1234,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join RMS_CAPACITY RC 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         on RC.CAPACITY_ID = OO.CAPACITY_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         WHERE OO.ORDER_TYPE = #{orderTypee} and TER.RESULT_ENTRY_GATE_TIME IS NOT NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="userId!=null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                and ASO.INSERT_USERNAME=#{userId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1284,6 +1333,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="userId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and air.INSERT_USERNAME=#{userId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="purchaseOrderId != null"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1380,6 +1436,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    <if test="userId !=null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       and AIR.INSERT_USERNAME = #{userId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="oneDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') <= TLFR.RESULT_OUT_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="startDate != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TLFR.RESULT_OUT_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     order by tlfr.result_out_gate_time desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="capacityNumber != null"> 
			 |