| 
					
				 | 
			
			
				@@ -289,7 +289,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <include refid="select" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <include refid="whereLike" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  <insert id="batchInsert" parameterType="java.util.List"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <insert id="batchInsert" parameterType="java.util.List"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     insert into AMSTRUCK_SPORADIC_MATERIAL  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       (SPORADIC_ORDER_MATERIAL_ID,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       MATERIAL_ID, MATERIAL_WEIGHT, MATERIAL_NUMBER,  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -369,5 +370,87 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  <select id="getSporadicOrdersList2" resultType="java.util.Map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    select * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    from( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    DISTINCT ASO.SPORADIC_ORDER_ID AS "sporadicOrderId", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ASO.SPORADIC_ORDER_NO AS "sporadicOrderNo", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    RSU.SUPPLIER_NAME AS "supplierName", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    RCO.CONSIGNEE_COMPANY_NAME AS "consigneeCompanyName", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    RCA.CARRIER_NAME AS "carrierName", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ASO.INSERT_TIME AS "insertTime", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    OO.ORDER_TYPE AS "type", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    RM.MATERIAL_NAME AS "materialName", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ASO.SPORADIC_ORDER_TIMES "sporadicOrderTimes" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    FROM AMSTRUCK_SPORADIC_ORDER ASO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LEFT JOIN RMS_CONSIGNEE RCO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ON ASO.RECEIVE_UNIT_ID = RCO.CONSIGNEE_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LEFT JOIN RMS_SUPPLIER RSU 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ON ASO.SEND_UNIT_ID = RSU.SUPPLIER_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LEFT JOIN RMS_CARRIER RCA 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ON RCA.CARRIER_ID = ASO.CARRIER_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LEFT JOIN OMSTRUCK_ORDER OO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ON OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LEFT JOIN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    OMSTRUCK_ORDER_MATERIAL OOM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ON OOM.ORDER_ID = OO.ORDER_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    LEFT JOIN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    RMS_MATERIAL RM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ON 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    OOM.MATERIAL_ID = RM.MATERIAL_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    WHERE OO.ORDER_TYPE in (15,16) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    AND ASO.ISSUE_STATUS =1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    AND ASO.DELETED = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <if test="dispatchStatus != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      AND ASO.DISPATCH_STATUS =  #{dispatchStatus} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <if test="sporadicOrderNo != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <foreach collection="sporadicOrderNo" item="item" open="(" separator="or" close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          "sporadicOrderNo" like '%${item}%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <if test="supplierName != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <foreach collection="supplierName" item="item" open="(" separator="or" close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          "supplierName" like '%${item}%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <if test="consigneeCompanyName != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          "consigneeCompanyName" like '%${item}%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <if test="carrierName != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <foreach collection="carrierName" item="item" open="(" separator="or" close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          "carrierName" like '%${item}%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <if test="insertTime != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <foreach collection="insertTime" item="item" open="(" separator="or" close=")"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          "insertTime" like to_date('${item}','yyyy-mm-dd hh24:mi:ss') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <include refid="orderBy"></include> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  <sql id="orderBy"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <if test="orderField != null and orderField != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      order by "${orderField}" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <if test="orderType != null and orderType != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ${orderType} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <if test="orderField == null  "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      order by "insertTime" desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  </sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |