|  | @@ -6,6 +6,7 @@
 | 
	
		
			
				|  |  |      <resultMap type="com.kmall.admin.entity.ProductStoreRelaEntity" id="productStoreRelaMap">
 | 
	
		
			
				|  |  |          <result property="id" column="id"/>
 | 
	
		
			
				|  |  |          <result property="storeId" column="store_id"/>
 | 
	
		
			
				|  |  | +        <result property="merchSn" column="merch_sn"/>
 | 
	
		
			
				|  |  |          <result property="productId" column="product_id"/>
 | 
	
		
			
				|  |  |          <result property="stockNum" column="stock_num"/>
 | 
	
		
			
				|  |  |          <result property="goodsId" column="goods_id"/>
 | 
	
	
		
			
				|  | @@ -34,6 +35,7 @@
 | 
	
		
			
				|  |  |  		SELECT
 | 
	
		
			
				|  |  |              a.`id`,
 | 
	
		
			
				|  |  |              a.`store_id`,
 | 
	
		
			
				|  |  | +            a.`merch_sn`,
 | 
	
		
			
				|  |  |              a.`product_id`,
 | 
	
		
			
				|  |  |              a.`stock_num`,
 | 
	
		
			
				|  |  |              a.`goods_id`,
 | 
	
	
		
			
				|  | @@ -68,6 +70,7 @@
 | 
	
		
			
				|  |  |          select
 | 
	
		
			
				|  |  |          a.`id`,
 | 
	
		
			
				|  |  |          a.`store_id`,
 | 
	
		
			
				|  |  | +        a.`merch_sn`,
 | 
	
		
			
				|  |  |          a.`product_id`,
 | 
	
		
			
				|  |  |          a.`stock_num`,
 | 
	
		
			
				|  |  |          a.`goods_id`,
 | 
	
	
		
			
				|  | @@ -93,6 +96,7 @@
 | 
	
		
			
				|  |  |          select
 | 
	
		
			
				|  |  |          a.`id`,
 | 
	
		
			
				|  |  |          a.`store_id`,
 | 
	
		
			
				|  |  | +        a.`merch_sn`,
 | 
	
		
			
				|  |  |          a.`product_id`,
 | 
	
		
			
				|  |  |          a.`stock_num`,
 | 
	
		
			
				|  |  |          a.`goods_id`,
 | 
	
	
		
			
				|  | @@ -113,6 +117,12 @@
 | 
	
		
			
				|  |  |          LEFT JOIN mall_category cg ON b.category_id = cg.id
 | 
	
		
			
				|  |  |          left join mall_store s on a.store_id = s.id
 | 
	
		
			
				|  |  |          WHERE 1=1 and b.is_delete = 0
 | 
	
		
			
				|  |  | +        <if test="storeId != null and storeId != '' ">
 | 
	
		
			
				|  |  | +            AND a.store_id = #{storeId}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        <if test="merchSn != null and merchSn.trim() != '' ">
 | 
	
		
			
				|  |  | +            AND a.merch_sn = #{merchSn}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  |          <if test="goodsId != null">
 | 
	
		
			
				|  |  |              AND a.goods_id = #{goodsId}
 | 
	
		
			
				|  |  |          </if>
 | 
	
	
		
			
				|  | @@ -151,6 +161,7 @@
 | 
	
		
			
				|  |  |          select
 | 
	
		
			
				|  |  |          a.`id`,
 | 
	
		
			
				|  |  |          a.`store_id`,
 | 
	
		
			
				|  |  | +        a.`merch_sn`,
 | 
	
		
			
				|  |  |          a.`product_id`,
 | 
	
		
			
				|  |  |          a.`stock_num`,
 | 
	
		
			
				|  |  |          a.`goods_id`,
 | 
	
	
		
			
				|  | @@ -173,9 +184,12 @@
 | 
	
		
			
				|  |  |          <if test="goodsId != null">
 | 
	
		
			
				|  |  |              AND b.id = #{goodsId}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  | -        <if test="storeId != null">
 | 
	
		
			
				|  |  | +        <if test="storeId != null and storeId != '' ">
 | 
	
		
			
				|  |  |              AND a.store_id = #{storeId}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  | +        <if test="merchSn != null and merchSn.trim() != '' ">
 | 
	
		
			
				|  |  | +            AND a.merch_sn = #{merchSn}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  |          <if test="id != null">
 | 
	
		
			
				|  |  |              AND a.id != #{id}
 | 
	
		
			
				|  |  |          </if>
 | 
	
	
		
			
				|  | @@ -200,6 +214,12 @@
 | 
	
		
			
				|  |  |          LEFT JOIN mall_category cg ON b.category_id = cg.id
 | 
	
		
			
				|  |  |          left join mall_store s on a.store_id = s.id
 | 
	
		
			
				|  |  |          WHERE 1=1 and b.is_delete = 0
 | 
	
		
			
				|  |  | +        <if test="storeId != null and storeId != '' ">
 | 
	
		
			
				|  |  | +            AND a.store_id = #{storeId}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        <if test="merchSn != null and merchSn.trim() != '' ">
 | 
	
		
			
				|  |  | +            AND a.merch_sn = #{merchSn}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  |          <if test="goodsId != null">
 | 
	
		
			
				|  |  |              AND a.goods_id = #{goodsId}
 | 
	
		
			
				|  |  |          </if>
 | 
	
	
		
			
				|  | @@ -227,6 +247,7 @@
 | 
	
		
			
				|  |  |              keyProperty="id">
 | 
	
		
			
				|  |  |  		insert into mall_product_store_rela(
 | 
	
		
			
				|  |  |  			`store_id`,
 | 
	
		
			
				|  |  | +			`merch_sn`,
 | 
	
		
			
				|  |  |  			`product_id`,
 | 
	
		
			
				|  |  |  			`stock_num`,
 | 
	
		
			
				|  |  |  			`goods_id`,
 | 
	
	
		
			
				|  | @@ -255,7 +276,8 @@
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          )
 | 
	
		
			
				|  |  |  		values(
 | 
	
		
			
				|  |  | -			#{storeId},
 | 
	
		
			
				|  |  | +            #{storeId},
 | 
	
		
			
				|  |  | +			#{merchSn},
 | 
	
		
			
				|  |  |  			#{productId},
 | 
	
		
			
				|  |  |  			#{stockNum},
 | 
	
		
			
				|  |  |  			#{goodsId},
 | 
	
	
		
			
				|  | @@ -289,6 +311,7 @@
 | 
	
		
			
				|  |  |          update mall_product_store_rela
 | 
	
		
			
				|  |  |          <set>
 | 
	
		
			
				|  |  |              <if test="storeId != null">`store_id` = #{storeId},</if>
 | 
	
		
			
				|  |  | +            <if test="merchSn != null">`merch_sn` = #{merchSn},</if>
 | 
	
		
			
				|  |  |              <if test="productId != null">`product_id` = #{productId},</if>
 | 
	
		
			
				|  |  |              <if test="stockNum != null">`stock_num` = #{stockNum},</if>
 | 
	
		
			
				|  |  |              <if test="goodsId != null">`goods_id` = #{goodsId},</if>
 |