From 1e9b91c0741c9b3005d523ca816d91622bf9759a Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 17 Sep 2021 11:48:21 +0800
Subject: [PATCH] add findMallGoodsList

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

diff --git a/src/main/resources/mapper/modules/MallGoodsMapper.xml b/src/main/resources/mapper/modules/MallGoodsMapper.xml
index 7cf62af..85a4ea2 100644
--- a/src/main/resources/mapper/modules/MallGoodsMapper.xml
+++ b/src/main/resources/mapper/modules/MallGoodsMapper.xml
@@ -2,4 +2,32 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cc.mrbird.febs.mall.mapper.MallGoodsMapper">
 
+    <select id="selectMallGoodsListQueryInPage" resultType="cc.mrbird.febs.mall.vo.MallGoodsListVo">
+        select
+            a.id,
+            a.goods_name,
+            a.goods_introdution,
+            a.thumb,
+            a.original_price,
+            a.present_price,
+            sum(b.sku_volume) saleVolume
+        from mall_goods a
+             inner join mall_goods_sku b on a.id=b.goods_id
+             inner join mall_goods_category c on a.category_id=c.id
+        <where>
+            a.is_sale=1
+            <if test="record != null">
+                <if test="record.isHot != null and record.isHot != ''">
+                    and a.is_hot = 1
+                </if>
+                <if test="record.categoryId != null and record.categoryId != ''">
+                    and (c.category_id = #{record.categoryId} or c.parent_id=#{record.categoryId})
+                </if>
+                <if test="record.query != null and record.query != ''">
+                    and a.goods_name like CONCAT('%', CONCAT(#{record.query}, '%'))
+                </if>
+            </if>
+        </where>
+        order by a.created_time desc
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1