From 722f17e0fc6a1fbe709bd02bbb7c75b8da435e07 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 10 May 2022 15:20:50 +0800
Subject: [PATCH] add score goods-list and goods-add

---
 src/main/resources/mapper/modules/MallGoodsMapper.xml |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/modules/MallGoodsMapper.xml b/src/main/resources/mapper/modules/MallGoodsMapper.xml
index a436e0a..bf6af19 100644
--- a/src/main/resources/mapper/modules/MallGoodsMapper.xml
+++ b/src/main/resources/mapper/modules/MallGoodsMapper.xml
@@ -77,6 +77,9 @@
                     <if test="record.isNormal != null and record.isNormal != ''">
                         and a.is_normal = #{record.isNormal}
                     </if>
+                    <if test="record.goodsType != null and record.goodsType != ''">
+                        and a.goods_type = #{record.goodsType}
+                    </if>
                     <if test="record.categoryId != null and record.categoryId != ''">
                         and (c.id = #{record.categoryId} or c.parent_id=#{record.categoryId})
                     </if>
@@ -120,9 +123,10 @@
         a.original_price,
         a.present_price,
         a.is_hot,
+        a.score,
         b.name categaryName,
-        sum(c.sku_volume) skuVolume,
-        sum(c.stock) stock
+        IFNULL(sum(c.sku_volume), a.volume) skuVolume,
+        IFNULL(sum(c.stock), a.stock) stock
         from mall_goods a
         left join mall_goods_category b on b.id = a.category_id
         left join mall_goods_sku c on c.goods_id = a.id
@@ -131,6 +135,9 @@
                 <if test="record.goodsName != null and record.goodsName != ''">
                     and a.goods_name like CONCAT('%', CONCAT(#{record.goodsName}, '%'))
                 </if>
+                <if test="record.goodsType != null and record.goodsType != ''">
+                    and a.goods_type=#{record.goodsType}
+                </if>
             </if>
         </where>
         group by a.id

--
Gitblit v1.9.1