|  |  | @ -141,6 +141,57 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |         group by a2.id |  |  |  |         group by a2.id | 
			
		
	
		
		
			
				
					
					|  |  |  |     </select> |  |  |  |     </select> | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     <select id="filterOrderProductOutList" resultType="com.glxp.api.res.inout.IoOrderDetailResultResponse"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         SELECT a2.coName, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                a2.spec, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                a2.measname, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                a2.bindRlFk, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                SUM( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                        CASE | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                WHEN a1.mainAction = 'WareHouseOut' THEN | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                        COALESCE(a2.count, 0) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                WHEN a1.mainAction = 'WareHouseIn' THEN | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                        -( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                                COALESCE(a2.count, 0)) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                ELSE 0 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                END | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                        ) AS `count` | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         FROM auth_warehouse aw | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                      LEFT JOIN io_order a1 ON a1.fromInvCode = aw.CODE | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                      LEFT JOIN io_order_detail_result a2 ON a1.billNo = a2.orderIdFk | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         <where> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             a1.status = 7 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             and a2.bindRlFk is not null | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             <if test="invCode != null and invCode != ''"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AND a1.invCode = #{invCode} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             <if test="mainAction != null and mainAction != ''"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AND a1.mainAction = #{mainAction} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             <if test="action != null and action != ''"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AND a1.action = #{action} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             <if test="mainAction != null and mainAction != ''"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AND a1.mainAction = #{mainAction} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             <if test="fromCorp != null and fromCorp != ''"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AND a1.fromCorp = #{fromCorp} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             <if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AND date_format(a1.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 date_format(#{endAduditTime}, '%Y-%m-%d') | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             <if test="actions != null and actions.size() != 0"> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 AND a1.`action` in | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 <foreach collection="actions" index="index" item="item" open="(" close=")" separator=","> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     #{item} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 </foreach> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             </if> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         </where> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         group by  a2.bindRlFk | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     </select> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     <select id="selectStatDataByTime" resultType="com.glxp.api.res.inv.IoOrderDetailStatRsponse"> |  |  |  |     <select id="selectStatDataByTime" resultType="com.glxp.api.res.inv.IoOrderDetailStatRsponse"> | 
			
		
	
		
		
			
				
					
					|  |  |  |         select orderIdFk, |  |  |  |         select orderIdFk, | 
			
		
	
		
		
			
				
					
					|  |  |  |                bindRlFk, |  |  |  |                bindRlFk, | 
			
		
	
	
		
		
			
				
					|  |  | 
 |