|
@@ -152,103 +152,112 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryList" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
|
|
|
- select
|
|
|
- a.`id`,
|
|
|
- a.`store_id`,
|
|
|
- a.`merch_sn`,
|
|
|
- a.`product_id`,
|
|
|
- a.`stock_num`,
|
|
|
- a.`goods_id`,
|
|
|
- a.`retail_price`,
|
|
|
- a.`market_price`,
|
|
|
- a.`stock_price`,
|
|
|
- a.`sell_volume`,
|
|
|
- a.`batch_sn`,
|
|
|
- a.`batch_expire_date`,
|
|
|
- a.`bottom_line_price`,
|
|
|
- b.goods_number as parkStock,
|
|
|
- b.is_hot 'isHot',
|
|
|
- b.is_on_sale 'isOnSale',
|
|
|
- b.sell_volume 'goodsSellVolume',
|
|
|
- b.sku,a.goods_biz_type, a.creater_sn, a.create_time, a.moder_sn, a.mod_time, a.tstm,
|
|
|
- b.goods_sn goodsSn,
|
|
|
- b.list_pic_url,
|
|
|
- c.goods_sn productSn,
|
|
|
- b.name goodsName,
|
|
|
- cg.name categoryName,
|
|
|
- s.store_name storeName,
|
|
|
- m.merch_name,
|
|
|
- b.merch_sn goods_merch_sn,
|
|
|
- a.category_id,
|
|
|
- a.attribute_category,
|
|
|
- a.brand_id,
|
|
|
- a.freight_id,
|
|
|
- b.goods_number goodsNumber,
|
|
|
- b.third_party_merch_code thirdPartyMerchCode,
|
|
|
- mb.is_stock_share isStockShare,
|
|
|
- b.list_pic_url,supplier_third_id, a.hot_sort_num
|
|
|
- from mall_product_store_rela a
|
|
|
- left join mall_goods b on a.goods_id = b.id
|
|
|
- left join third_merchant_biz mb on mb.third_party_merch_code = b.third_party_merch_code and mb.merch_sn=b.merch_sn
|
|
|
- left join mall_merch m on a.merch_sn = m.merch_sn
|
|
|
- left join mall_product c on a.product_id = c.id
|
|
|
- LEFT JOIN mall_category cg ON a.category_id = cg.id
|
|
|
- left join mall_store s on a.store_id = s.id AND s.third_party_merch_code = b.third_party_merch_code
|
|
|
- WHERE 1=1 and b.is_delete = 0
|
|
|
- <if test="categoryId != null and categoryId != '' ">
|
|
|
- AND a.category_id = #{categoryId}
|
|
|
- </if>
|
|
|
- <if test="brandId != null and brandId != '' ">
|
|
|
- AND a.brand_id = #{brandId}
|
|
|
- </if>
|
|
|
- <if test="category != null and category != ''">
|
|
|
- AND a.category_id IN (select id from mall_category where parent_id = #{category})
|
|
|
- </if>
|
|
|
- <if test="categoryTwo != null and categoryTwo != ''">
|
|
|
- AND a.category_id = #{categoryTwo}
|
|
|
- </if>
|
|
|
- <if test="prodBarcode != null and prodBarcode != ''">
|
|
|
- AND b.prod_barcode = #{prodBarcode}
|
|
|
- </if>
|
|
|
- <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="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
|
|
|
- AND b.third_party_merch_code = #{thirdPartyMerchCode}
|
|
|
- </if>
|
|
|
- <if test="goodsId != null">
|
|
|
- AND a.goods_id = #{goodsId}
|
|
|
- </if>
|
|
|
- <if test="goodsName != null and goodsName != '' ">
|
|
|
- AND b.name LIKE concat('%',#{goodsName},'%')
|
|
|
- </if>
|
|
|
- <if test="goodsSn != null and goodsSn != '' ">
|
|
|
- AND b.goods_sn = #{goodsSn}
|
|
|
- </if>
|
|
|
- <if test="productSn != null and productSn != '' ">
|
|
|
- AND c.goods_sn = #{productSn}
|
|
|
- </if>
|
|
|
- <if test="productId != null">
|
|
|
- AND a.product_id = #{productId}
|
|
|
- </if>
|
|
|
+ select * from (
|
|
|
+ select
|
|
|
+ a.`id`,
|
|
|
+ a.`store_id`,
|
|
|
+ a.`merch_sn`,
|
|
|
+ a.`product_id`,
|
|
|
+ a.`stock_num`,
|
|
|
+ a.`goods_id`,
|
|
|
+ a.`retail_price`,
|
|
|
+ a.`market_price`,
|
|
|
+ a.`stock_price`,
|
|
|
+ a.`sell_volume`,
|
|
|
+ a.`batch_sn`,
|
|
|
+ a.`batch_expire_date`,
|
|
|
+ a.`bottom_line_price`,
|
|
|
+ a.last_sale_time,
|
|
|
+ b.goods_number as parkStock,
|
|
|
+ b.is_hot 'isHot',
|
|
|
+ b.is_on_sale 'isOnSale',
|
|
|
+ b.sell_volume 'goodsSellVolume',
|
|
|
+ b.sku,a.goods_biz_type, a.creater_sn, a.create_time, a.moder_sn, a.mod_time, a.tstm,
|
|
|
+ b.goods_sn goodsSn,
|
|
|
+ b.list_pic_url,
|
|
|
+ c.goods_sn productSn,
|
|
|
+ b.name goodsName,
|
|
|
+ cg.name categoryName,
|
|
|
+ s.store_name storeName,
|
|
|
+ m.merch_name,
|
|
|
+ b.merch_sn goods_merch_sn,
|
|
|
+ a.category_id,
|
|
|
+ a.attribute_category,
|
|
|
+ a.brand_id,
|
|
|
+ a.freight_id,
|
|
|
+ b.goods_number goodsNumber,
|
|
|
+ b.third_party_merch_code thirdPartyMerchCode,
|
|
|
+ mb.is_stock_share isStockShare,
|
|
|
+ supplier_third_id,
|
|
|
+ a.hot_sort_num
|
|
|
+ from mall_product_store_rela a
|
|
|
+ left join mall_goods b on a.goods_id = b.id
|
|
|
+ left join third_merchant_biz mb on mb.third_party_merch_code = b.third_party_merch_code and mb.merch_sn=b.merch_sn
|
|
|
+ left join mall_merch m on a.merch_sn = m.merch_sn
|
|
|
+ left join mall_product c on a.product_id = c.id
|
|
|
+ LEFT JOIN mall_category cg ON a.category_id = cg.id
|
|
|
+ left join mall_store s on a.store_id = s.id AND s.third_party_merch_code = b.third_party_merch_code
|
|
|
+ WHERE 1=1 and b.is_delete = 0
|
|
|
+ <if test="categoryId != null and categoryId != '' ">
|
|
|
+ AND a.category_id = #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="brandId != null and brandId != '' ">
|
|
|
+ AND a.brand_id = #{brandId}
|
|
|
+ </if>
|
|
|
+ <if test="category != null and category != ''">
|
|
|
+ AND a.category_id IN (select id from mall_category where parent_id = #{category})
|
|
|
+ </if>
|
|
|
+ <if test="categoryTwo != null and categoryTwo != ''">
|
|
|
+ AND a.category_id = #{categoryTwo}
|
|
|
+ </if>
|
|
|
+ <if test="prodBarcode != null and prodBarcode != ''">
|
|
|
+ AND b.prod_barcode = #{prodBarcode}
|
|
|
+ </if>
|
|
|
+ <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="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
|
|
|
+ AND b.third_party_merch_code = #{thirdPartyMerchCode}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null">
|
|
|
+ AND a.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsName != null and goodsName != '' ">
|
|
|
+ AND b.name LIKE concat('%',#{goodsName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="goodsSn != null and goodsSn != '' ">
|
|
|
+ AND b.goods_sn = #{goodsSn}
|
|
|
+ </if>
|
|
|
+ <if test="productSn != null and productSn != '' ">
|
|
|
+ AND c.goods_sn = #{productSn}
|
|
|
+ </if>
|
|
|
+ <if test="productId != null">
|
|
|
+ AND a.product_id = #{productId}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="goodsBizType != null and goodsBizType != ''">
|
|
|
- AND b.goods_biz_type = #{goodsBizType}
|
|
|
- </if>
|
|
|
- <choose>
|
|
|
- <when test="sidx != null and sidx.trim() != ''">
|
|
|
- order by ${sidx} ${order}
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- order by a.id desc
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- <if test="offset != null and limit != null">
|
|
|
- limit #{offset}, #{limit}
|
|
|
+ <if test="goodsBizType != null and goodsBizType != ''">
|
|
|
+ AND b.goods_biz_type = #{goodsBizType}
|
|
|
+ </if>
|
|
|
+ <choose>
|
|
|
+ <when test="sidx != null and sidx.trim() != ''">
|
|
|
+ order by ${sidx} ${order}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ order by a.id desc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ <if test="offset != null and limit != null">
|
|
|
+ limit #{offset}, #{limit}
|
|
|
+ </if>
|
|
|
+ ) temp
|
|
|
+ where 1=1
|
|
|
+ <if test="lastSaleTime != null and lastSaleTime != ''">
|
|
|
+ AND temp.last_sale_time >= #{lastSaleTime} or temp.last_sale_time is null
|
|
|
</if>
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
<select id="querySameList" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
|
|
@@ -767,6 +776,7 @@
|
|
|
|
|
|
</select>
|
|
|
<select id="queryExportList" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
|
|
|
+ select * from (
|
|
|
select
|
|
|
a.`id`,
|
|
|
a.`store_id`,
|
|
@@ -799,10 +809,11 @@
|
|
|
a.brand_id,
|
|
|
mall_brand.name as brandName,
|
|
|
a.freight_id,
|
|
|
+ a.last_sale_time,
|
|
|
b.goods_number goodsNumber,
|
|
|
b.third_party_merch_code thirdPartyMerchCode,
|
|
|
mb.is_stock_share isStockShare,
|
|
|
- b.list_pic_url,supplier_third_id, a.hot_sort_num
|
|
|
+ supplier_third_id, a.hot_sort_num
|
|
|
from mall_product_store_rela a
|
|
|
left join mall_goods b on a.goods_id = b.id
|
|
|
left join third_merchant_biz mb on mb.third_party_merch_code = b.third_party_merch_code and mb.merch_sn=b.merch_sn
|
|
@@ -834,6 +845,11 @@
|
|
|
<if test="goodsBizType != null and goodsBizType != ''">
|
|
|
AND b.goods_biz_type = #{goodsBizType}
|
|
|
</if>
|
|
|
+ ) temp
|
|
|
+ where 1=1
|
|
|
+ <if test="lastSaleTime != null and lastSaleTime != ''">
|
|
|
+ AND temp.last_sale_time >= #{lastSaleTime} or temp.last_sale_time is null
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|