|  | @@ -152,7 +152,7 @@
 | 
	
		
			
				|  |  |          LEFT JOIN mall_store s ON s.id = psr1.store_id
 | 
	
		
			
				|  |  |          LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
 | 
	
		
			
				|  |  |          LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
 | 
	
		
			
				|  |  | -        where a.id = #{id} and psr1.store_id = #{storeId}
 | 
	
		
			
				|  |  | +        where a.is_delete=0 and a.id = #{id} and psr1.store_id = #{storeId}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryGoodsByGoodsSnAndStoreId" resultMap="goodsMap">
 | 
	
	
		
			
				|  | @@ -206,7 +206,7 @@
 | 
	
		
			
				|  |  |          LEFT JOIN mall_store s ON s.id = psr1.store_id
 | 
	
		
			
				|  |  |          LEFT JOIN third_merchant_biz mb on s.third_party_merch_code = mb.third_party_merch_code
 | 
	
		
			
				|  |  |          LEFT JOIN third_merchant_biz mb2 ON a.third_party_merch_code = mb2.third_party_merch_code
 | 
	
		
			
				|  |  | -        where a.goods_sn = #{goodsSn} and psr1.store_id = #{storeId}
 | 
	
		
			
				|  |  | +        where a.is_delete=0 and a.goods_sn = #{goodsSn} and psr1.store_id = #{storeId}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryObjectByProdBarcodeAndBizType" resultType="com.kmall.admin.entity.GoodsEntity">
 | 
	
	
		
			
				|  | @@ -217,7 +217,7 @@
 | 
	
		
			
				|  |  |              mall_goods a
 | 
	
		
			
				|  |  |          LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
 | 
	
		
			
				|  |  |          inner join mall_store s on r.store_id=s.id
 | 
	
		
			
				|  |  | -        where a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
 | 
	
		
			
				|  |  | +        where a.is_delete=0 and a.prod_barcode = #{prodBarcode} and a.goods_biz_type = 11 and r.store_id = #{storeId}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -229,7 +229,7 @@
 | 
	
		
			
				|  |  |              mall_goods a
 | 
	
		
			
				|  |  |          LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
 | 
	
		
			
				|  |  |          inner join mall_store s on r.store_id=s.id
 | 
	
		
			
				|  |  | -        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId}
 | 
	
		
			
				|  |  | +        where a.is_delete=0 and a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId}
 | 
	
		
			
				|  |  |          and r.stock_num > 0
 | 
	
		
			
				|  |  |          limit 1
 | 
	
		
			
				|  |  |      </select>
 | 
	
	
		
			
				|  | @@ -259,12 +259,12 @@
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              mall_goods a
 | 
	
		
			
				|  |  |          LEFT JOIN mall_goods_specification r ON r.goods_id = a.id
 | 
	
		
			
				|  |  | -        left join mall_product_store_rela m on m.goods_id = a.id and r.goods_id = m.goods_id and a.is_on_sale = 1
 | 
	
		
			
				|  |  | +        left join mall_product_store_rela m on m.goods_id = a.id and r.goods_id = m.goods_id and a.is_on_sale = 1 and a.is_delete=0
 | 
	
		
			
				|  |  |          where a.prod_barcode = #{prodBarcode} and m.store_id = #{storeId}
 | 
	
		
			
				|  |  |          <if test="sku != null and sku != ''">
 | 
	
		
			
				|  |  |              and a.sku=#{sku}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  | -        and m.stock_num > 0 order by m.stock_num desc
 | 
	
		
			
				|  |  | +        and m.stock_num > 0 and a.is_delete = 0 order by m.stock_num desc
 | 
	
		
			
				|  |  |          limit 1
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -280,7 +280,7 @@
 | 
	
		
			
				|  |  |          LEFT JOIN mall_goods_specification r ON r.goods_id = a.id
 | 
	
		
			
				|  |  |          left join mall_product_store_rela m on m.goods_id = a.id and r.goods_id = m.goods_id
 | 
	
		
			
				|  |  |          where a.prod_barcode = #{prodBarcode} and m.store_id = #{storeId}
 | 
	
		
			
				|  |  | -        and m.stock_num > 0 and a.is_on_sale = 1 order by m.stock_num desc
 | 
	
		
			
				|  |  | +        and m.stock_num > 0 and a.is_on_sale = 1 and a.is_delete = 0 order by m.stock_num desc
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -292,7 +292,7 @@
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              mall_goods a
 | 
	
		
			
				|  |  |          LEFT JOIN mall_goods_group g ON g.goods_id = a.id
 | 
	
		
			
				|  |  | -        AND g.open_status != 3
 | 
	
		
			
				|  |  | +        AND g.open_status != 3 and a.is_delete=0
 | 
	
		
			
				|  |  |          where a.goods_sn = #{goodsSn}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -749,6 +749,7 @@
 | 
	
		
			
				|  |  |              INNER JOIN mall_supplier s
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              g.category_id = c.id
 | 
	
		
			
				|  |  | +            and g.is_delete=0
 | 
	
		
			
				|  |  |              and g.supplier_id = s.id
 | 
	
		
			
				|  |  |              AND (g.goods_sn=#{keyword} OR g.prod_barcode=#{keyword})
 | 
	
		
			
				|  |  |      </select>
 | 
	
	
		
			
				|  | @@ -816,7 +817,7 @@
 | 
	
		
			
				|  |  |              g.prod_barcode as barCode
 | 
	
		
			
				|  |  |          from
 | 
	
		
			
				|  |  |              mall_goods g
 | 
	
		
			
				|  |  | -        left join mall_product_store_rela rela on g.id = rela.goods_id
 | 
	
		
			
				|  |  | +        left join mall_product_store_rela rela on g.id = rela.goods_id and g.is_delete = 0
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  |              <if test="sku != null and sku != ''">
 | 
	
		
			
				|  |  |                 and g.sku = #{sku}
 | 
	
	
		
			
				|  | @@ -835,13 +836,13 @@
 | 
	
		
			
				|  |  |      <select id="queryByBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
 | 
	
		
			
				|  |  |          select *
 | 
	
		
			
				|  |  |          from mall_goods
 | 
	
		
			
				|  |  | -        where prod_barcode = #{barCode}
 | 
	
		
			
				|  |  | +        where is_delete = 0 and prod_barcode = #{barCode}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryBySku" resultType="com.kmall.admin.entity.GoodsEntity">
 | 
	
		
			
				|  |  |          select *
 | 
	
		
			
				|  |  |          from mall_goods
 | 
	
		
			
				|  |  | -        where sku = #{sku}
 | 
	
		
			
				|  |  | +        where is_delete = 0 and sku = #{sku}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryListByBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
 | 
	
	
		
			
				|  | @@ -852,7 +853,7 @@
 | 
	
		
			
				|  |  |              mall_goods a
 | 
	
		
			
				|  |  |          LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
 | 
	
		
			
				|  |  |          inner join mall_store s on r.store_id=s.id
 | 
	
		
			
				|  |  | -        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1
 | 
	
		
			
				|  |  | +        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1 and a.is_delete = 0
 | 
	
		
			
				|  |  |          and r.stock_num > 0 order by r.stock_num desc
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -879,7 +880,7 @@
 | 
	
		
			
				|  |  |      <select id="queryListBySku" resultType="com.kmall.admin.entity.GoodsEntity">
 | 
	
		
			
				|  |  |           select *
 | 
	
		
			
				|  |  |          from mall_goods
 | 
	
		
			
				|  |  | -        where sku = #{sku}
 | 
	
		
			
				|  |  | +        where is_delete = 0 and sku = #{sku}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="queryNonSyncOmsGoodsRateSkuList" resultType="com.kmall.admin.entity.GoodsEntity">
 | 
	
		
			
				|  |  |          select *
 | 
	
	
		
			
				|  | @@ -894,7 +895,7 @@
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryByBarcodeAndSku" resultType="com.kmall.admin.entity.GoodsEntity">
 | 
	
		
			
				|  |  | -        select * from mall_goods where
 | 
	
		
			
				|  |  | +        select * from mall_goods where is_delete = 0 and
 | 
	
		
			
				|  |  |          goods_sn = #{goodsSn} and prod_barcode = #{prodBarcode}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -907,7 +908,7 @@
 | 
	
		
			
				|  |  |              m.store_id as storeId
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              mall_goods a
 | 
	
		
			
				|  |  | -        left join mall_product_store_rela m on m.goods_id = a.id
 | 
	
		
			
				|  |  | +        left join mall_product_store_rela m on m.goods_id = a.id and a.is_delete = 0
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  |              a.cus_rec_code in
 | 
	
		
			
				|  |  |              <foreach collection="hdCodeSet" item="item" open="(" close=")" separator=",">
 | 
	
	
		
			
				|  | @@ -1174,7 +1175,7 @@
 | 
	
		
			
				|  |  |              mall_goods a
 | 
	
		
			
				|  |  |          LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
 | 
	
		
			
				|  |  |          inner join mall_store s on r.store_id=s.id
 | 
	
		
			
				|  |  | -        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1
 | 
	
		
			
				|  |  | +        where a.prod_barcode = #{prodBarcode}  and r.store_id = #{storeId} and a.sku = #{sku} and a.is_on_sale = 1 and a.is_delete = 0
 | 
	
		
			
				|  |  |          and r.stock_num > 0 order by r.stock_num desc
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1188,6 +1189,7 @@
 | 
	
		
			
				|  |  |          LEFT JOIN mall_product_store_rela r ON r.goods_id = a.id
 | 
	
		
			
				|  |  |          inner join mall_store s on r.store_id=s.id
 | 
	
		
			
				|  |  |          where
 | 
	
		
			
				|  |  | +        a.is_delete = 0 and
 | 
	
		
			
				|  |  |          a.is_on_sale = 1
 | 
	
		
			
				|  |  |          and
 | 
	
		
			
				|  |  |          <foreach collection="list" item="item" open="(" separator=" or " close=")">
 |