|  |  |  | @ -113,4 +113,47 @@ | 
			
		
	
		
			
				
					|  |  |  |  |         </foreach> | 
			
		
	
		
			
				
					|  |  |  |  |     </insert> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectPurApplyDetailList" resultType="com.glxp.api.res.purchase.PurOrderDetailResponse"> | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT | 
			
		
	
		
			
				
					|  |  |  |  |         pur_apply_detail.*, | 
			
		
	
		
			
				
					|  |  |  |  |         pur_apply.billNo, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_products.ggxh spec, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_products.measname, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_products.manufactory, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_products.ylqxzcrbarmc, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_corp.`name` supName | 
			
		
	
		
			
				
					|  |  |  |  |         FROM | 
			
		
	
		
			
				
					|  |  |  |  |         pur_apply_detail | 
			
		
	
		
			
				
					|  |  |  |  |         INNER JOIN basic_udirel ON pur_apply_detail.productId = basic_udirel.id | 
			
		
	
		
			
				
					|  |  |  |  |         INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid | 
			
		
	
		
			
				
					|  |  |  |  |         INNER JOIN basic_corp ON pur_apply_detail.supId = basic_corp.erpId | 
			
		
	
		
			
				
					|  |  |  |  |         left join pur_apply on pur_apply.id = pur_apply_detail.orderIdFk | 
			
		
	
		
			
				
					|  |  |  |  |         <where> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="billNo != null and billNo != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND pur_apply.billNo like concat('%', #{billNo}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productId != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND productId like concat('%', #{productId}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productName != null and productName != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND productName like concat('%', #{productName}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="spec != null and spec != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.ggxh like concat('%', #{spec}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND pur_apply_detail.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="manufactory != null and manufactory != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.manufactory like concat('%', #{manufactory}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="startDate != null and startDate !=''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[ and DATE_FORMAT(pur_apply.createTime,'%Y-%m-%d')>= #{startDate}]]> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="endDate != null and endDate !=''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[ and DATE_FORMAT(pur_apply.createTime,'%Y-%m-%d') <= #{endDate}]]> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  |         GROUP BY basic_products.uuid | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | </mapper> |