|  |  |  | @ -2,10 +2,10 @@ | 
			
		
	
		
			
				
					|  |  |  |  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | <mapper namespace="com.glxp.sale.admin.dao.inventory.InvPreInProductDao"> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="filterInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductRequest" | 
			
		
	
		
			
				
					|  |  |  |  |             resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT * FROM inv_prein_product | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT * | 
			
		
	
		
			
				
					|  |  |  |  |         FROM inv_prein_product | 
			
		
	
		
			
				
					|  |  |  |  |         <where> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productsName != '' and productsName != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND productsName = #{productsName} | 
			
		
	
	
		
			
				
					|  |  |  | @ -30,7 +30,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 AND expireDate = #{expireDate} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND ylqxzcrbarmc like concat('%',#{ylqxzcrbarmc},'%') | 
			
		
	
		
			
				
					|  |  |  |  |                 AND ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND zczbhhzbapzbh = #{zczbhhzbapzbh} | 
			
		
	
	
		
			
				
					|  |  |  | @ -71,7 +71,6 @@ | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT * | 
			
		
	
		
			
				
					|  |  |  |  |         FROM inv_prein_product | 
			
		
	
		
			
				
					|  |  |  |  |         WHERE id = #{id} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -88,7 +87,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="supId == null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND supId is NULL | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="batchNo != '' and batchNo != null and batchNo!= 'empty'"> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="batchNo != '' and batchNo != null and batchNo != 'empty'"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND batchNo = #{batchNo} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="batchNo == 'empty'"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -104,7 +103,6 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 AND invWarehouseCode = #{invWarehouseCode} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectExit" parameterType="Map" | 
			
		
	
		
			
				
					|  |  |  |  |             resultType="com.glxp.sale.admin.entity.inventory.InvProductEntity"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -118,34 +116,48 @@ | 
			
		
	
		
			
				
					|  |  |  |  |     <!--   and supId = #{supId}--> | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="filterJoinInvProduct" parameterType="com.glxp.sale.admin.req.inventory.FilterInvProductRequest" | 
			
		
	
		
			
				
					|  |  |  |  |             resultType="com.glxp.sale.admin.res.inventory.InvProductResponse"> | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT | 
			
		
	
		
			
				
					|  |  |  |  |         inv_prein_product.id, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_products.cpmctymc,basic_products.nameCode,inv_prein_product.relIdFk,basic_products.ggxh, | 
			
		
	
		
			
				
					|  |  |  |  |         inv_prein_product.batchNo | 
			
		
	
		
			
				
					|  |  |  |  |         ,inv_prein_product.productionDate,inv_prein_product.expireDate, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh, | 
			
		
	
		
			
				
					|  |  |  |  |         sum(inv_prein_product.inCount) as inCount, | 
			
		
	
		
			
				
					|  |  |  |  |         sum(inv_prein_product.outCount) as outCount, | 
			
		
	
		
			
				
					|  |  |  |  |         sum(inv_prein_product.reCount) as reCount,inv_prein_product.customerId, | 
			
		
	
		
			
				
					|  |  |  |  |         basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name | 
			
		
	
		
			
				
					|  |  |  |  |         invStorageName,inv_prein_product.invStorageCode,inv_prein_product.price, inv_warehouse_sub.name | 
			
		
	
		
			
				
					|  |  |  |  |         invSubStorageName,inv_prein_product.invWarehouseCode,inv_prein_product.orderIdFk | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT inv_prein_product.id, | 
			
		
	
		
			
				
					|  |  |  |  |                basic_products.cpmctymc, | 
			
		
	
		
			
				
					|  |  |  |  |                basic_products.nameCode, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.relIdFk, | 
			
		
	
		
			
				
					|  |  |  |  |                basic_products.ggxh, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.batchNo | 
			
		
	
		
			
				
					|  |  |  |  |                 , | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.productionDate, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.expireDate, | 
			
		
	
		
			
				
					|  |  |  |  |                basic_products.ylqxzcrbarmc, | 
			
		
	
		
			
				
					|  |  |  |  |                basic_products.zczbhhzbapzbh, | 
			
		
	
		
			
				
					|  |  |  |  |                sum(inv_prein_product.inCount)  as inCount, | 
			
		
	
		
			
				
					|  |  |  |  |                sum(inv_prein_product.outCount) as outCount, | 
			
		
	
		
			
				
					|  |  |  |  |                sum(inv_prein_product.reCount)  as reCount, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.customerId, | 
			
		
	
		
			
				
					|  |  |  |  |                basic_corp.name                    companyName, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.supId, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.unitFk, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_warehouse.name | 
			
		
	
		
			
				
					|  |  |  |  |                                                   invStorageName, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.invStorageCode, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.price, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_warehouse_sub.name | 
			
		
	
		
			
				
					|  |  |  |  |                                                   invSubStorageName, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.invWarehouseCode, | 
			
		
	
		
			
				
					|  |  |  |  |                inv_prein_product.orderIdFk | 
			
		
	
		
			
				
					|  |  |  |  |         FROM inv_prein_product | 
			
		
	
		
			
				
					|  |  |  |  |         inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id | 
			
		
	
		
			
				
					|  |  |  |  |         inner join basic_products on basic_udirel.uuid = basic_products.uuid | 
			
		
	
		
			
				
					|  |  |  |  |         left join basic_corp on inv_prein_product.supId=basic_corp.erpId | 
			
		
	
		
			
				
					|  |  |  |  |         left join inv_warehouse on inv_warehouse.code=inv_prein_product.invStorageCode | 
			
		
	
		
			
				
					|  |  |  |  |         left join inv_warehouse_sub on inv_warehouse_sub.code = inv_prein_product.invWarehouseCode | 
			
		
	
		
			
				
					|  |  |  |  |                  inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id | 
			
		
	
		
			
				
					|  |  |  |  |                  inner join basic_products on basic_udirel.uuid = basic_products.uuid | 
			
		
	
		
			
				
					|  |  |  |  |                  left join basic_corp on inv_prein_product.supId = basic_corp.erpId | 
			
		
	
		
			
				
					|  |  |  |  |                  left join inv_warehouse on inv_warehouse.code = inv_prein_product.invStorageCode | 
			
		
	
		
			
				
					|  |  |  |  |                  left join inv_warehouse_sub on inv_warehouse_sub.code = inv_prein_product.invWarehouseCode | 
			
		
	
		
			
				
					|  |  |  |  |         <where> | 
			
		
	
		
			
				
					|  |  |  |  |             basic_products.diType=1 | 
			
		
	
		
			
				
					|  |  |  |  |             basic_products.diType = 1 | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="cpmctymc != '' and cpmctymc != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.cpmctymc like concat('%',#{cpmctymc},'%') | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.cpmctymc like concat('%', #{cpmctymc}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productsName != null and productsName != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.cpmctymc like concat('%',#{productsName},'%') | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.cpmctymc like concat('%', #{productsName}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="nameCode != '' and nameCode != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.nameCode like concat('%',#{nameCode},'%') | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.nameCode like concat('%', #{nameCode}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="relIdFk != '' and relIdFk != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND inv_prein_product.relIdFk = #{relIdFk} | 
			
		
	
	
		
			
				
					|  |  |  | @ -158,10 +170,10 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="ggxh != '' and ggxh != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.ggxh like concat('%',#{ggxh},'%') | 
			
		
	
		
			
				
					|  |  |  |  |                 AND basic_products.ggxh like concat('%', #{ggxh}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="batchNo != '' and batchNo != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND inv_prein_product.batchNo like concat('%',#{batchNo},'%') | 
			
		
	
		
			
				
					|  |  |  |  |                 AND inv_prein_product.batchNo like concat('%', #{batchNo}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productionDate != '' and productionDate != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND inv_prein_product.productionDate = #{productionDate} | 
			
		
	
	
		
			
				
					|  |  |  | @ -243,28 +255,67 @@ | 
			
		
	
		
			
				
					|  |  |  |  |     <update id="updateInvProduct" parameterType="com.glxp.sale.admin.entity.inventory.InvProductEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         UPDATE inv_prein_product | 
			
		
	
		
			
				
					|  |  |  |  |         <trim prefix="set" suffixOverrides=","> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productsName != null">productsName=#{productsName},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="nameCode != null">nameCode=#{nameCode},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="relIdFk != null">relIdFk=#{relIdFk},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="ggxh != null">ggxh=#{ggxh},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="batchNo != null">batchNo=#{batchNo},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productionDate != null">productionDate=#{productionDate},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="expireDate != null">expireDate=#{expireDate},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="inCount != null">inCount=#{inCount},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="outCount != null">outCount=#{outCount},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="reCount != null">reCount=#{reCount},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="customerId != null">customerId=#{customerId},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="supId != null">supId=#{supId},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="unitFk != null">unitFk=#{unitFk},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="price != null">price=#{price},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="updateTime != null">updateTime=#{updateTime},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productsName != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 productsName=#{productsName}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="nameCode != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 nameCode=#{nameCode}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="relIdFk != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 relIdFk=#{relIdFk}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="ggxh != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 ggxh=#{ggxh}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="batchNo != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 batchNo=#{batchNo}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="productionDate != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 productionDate=#{productionDate}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="expireDate != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 expireDate=#{expireDate}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="ylqxzcrbarmc != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 ylqxzcrbarmc=#{ylqxzcrbarmc}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="zczbhhzbapzbh != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 zczbhhzbapzbh=#{zczbhhzbapzbh}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="inCount != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 inCount=#{inCount}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="outCount != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 outCount=#{outCount}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="reCount != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 reCount=#{reCount}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="customerId != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 customerId=#{customerId}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="supId != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 supId=#{supId}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="unitFk != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 unitFk=#{unitFk}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="invStorageCode != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 invStorageCode=#{invStorageCode}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="price != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 price=#{price}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="invWarehouseCode != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 invWarehouseCode=#{invWarehouseCode}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="updateTime != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 updateTime=#{updateTime}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="orderIdFk != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 orderIdFk=#{orderIdFk}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </trim> | 
			
		
	
		
			
				
					|  |  |  |  |         WHERE id = #{id} | 
			
		
	
		
			
				
					|  |  |  |  |     </update> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | </mapper> | 
			
		
	
		
			
				
					|  |  |  |  | </mapper> | 
			
		
	
	
		
			
				
					|  |  |  | 
 |