|
@@ -77,9 +77,24 @@
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
<select id="selectGoodsByClassify" resultType="com.sqx.modules.goods.entity.Goods">
|
|
<select id="selectGoodsByClassify" resultType="com.sqx.modules.goods.entity.Goods">
|
|
|
- select g.*, gsr.sales as sales, gsr.inventory as inventory
|
|
|
|
|
|
|
+ select g.*, gsr.sales as sales, gsr.inventory as inventory, ga.activityList
|
|
|
from goods_shop_relevancy gsr
|
|
from goods_shop_relevancy gsr
|
|
|
left join goods g on gsr.goods_id = g.goods_id
|
|
left join goods g on gsr.goods_id = g.goods_id
|
|
|
|
|
+ left join (
|
|
|
|
|
+ select
|
|
|
|
|
+ tmp.goods_id, group_concat(a.title) as activityList
|
|
|
|
|
+ from
|
|
|
|
|
+ (
|
|
|
|
|
+ select t.activity_shop_id, substring_index(substring_index(t.goods_ids, ',', n.n), ',', -1) goods_id
|
|
|
|
|
+ from
|
|
|
|
|
+ (select 1 as n union select 2 union select 3 union select 4) n
|
|
|
|
|
+ inner join activity_goods t on char_length(t.goods_ids)-char_length(replace(t.goods_ids, ',', ''))>=n.n-1
|
|
|
|
|
+ order by n.n
|
|
|
|
|
+ ) tmp
|
|
|
|
|
+ left join activity_shop ach on ach.id = tmp.activity_shop_id
|
|
|
|
|
+ left join activity a on ach.activity_id = a.id
|
|
|
|
|
+ group by tmp.goods_id
|
|
|
|
|
+ ) ga on ga.goods_id = g.goods_id
|
|
|
where gsr.shop_id = #{shopId}
|
|
where gsr.shop_id = #{shopId}
|
|
|
and g.classify_id = #{classifyId}
|
|
and g.classify_id = #{classifyId}
|
|
|
and g.status = 0
|
|
and g.status = 0
|
|
@@ -102,6 +117,8 @@
|
|
|
and status=0 order by sort asc,sales_volume desc limit 3
|
|
and status=0 order by sort asc,sales_volume desc limit 3
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<select id="selectGoodsBySalesAndGoodsNameAndShopIds" resultType="com.sqx.modules.goods.entity.Goods">
|
|
<select id="selectGoodsBySalesAndGoodsNameAndShopIds" resultType="com.sqx.modules.goods.entity.Goods">
|
|
|
SELECT x.*
|
|
SELECT x.*
|
|
|
FROM (SELECT g.*,
|
|
FROM (SELECT g.*,
|