From eacba04de1bf9a31e1503e7c07938f1812fe86c5 Mon Sep 17 00:00:00 2001 From: Administrator <15274802129@163.com> Date: Tue, 17 Jun 2025 10:02:30 +0800 Subject: [PATCH] refactor(mall): 优化活动关注记录查询逻辑 --- src/main/resources/mapper/modules/MallGoodsMapper.xml | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/resources/mapper/modules/MallGoodsMapper.xml b/src/main/resources/mapper/modules/MallGoodsMapper.xml index 69cd6b4..84b0c3f 100644 --- a/src/main/resources/mapper/modules/MallGoodsMapper.xml +++ b/src/main/resources/mapper/modules/MallGoodsMapper.xml @@ -5,6 +5,8 @@ <resultMap id="MallGoodsMap" type="cc.mrbird.febs.mall.entity.MallGoods"> <id property="id" column="id" /> <result property="goodsNo" column="goods_no" /> + <result property="storeAppId" column="store_app_id" /> + <result property="storeGoodsId" column="store_goods_id" /> <result property="goodsName" column="goods_name" /> <result property="goodsIntrodution" column="goods_introdution" /> <result property="unit" column="unit" /> @@ -304,10 +306,10 @@ <select id="findMallGoodsCommentLevelByGoodsId" resultType="cc.mrbird.febs.mall.vo.MallGoodsCommentVo"> select - (select count(z.id) from mall_goods_comment z where z.goods_id = #{id} and z.star <![CDATA[ > ]]> 4) greatNum, + (select count(z.id) from mall_goods_comment z where z.goods_id = #{id} and z.star <![CDATA[ > ]]> 4 and z.show_state = 1) greatNum, (select count(z.id) from mall_goods_comment z where z.goods_id = #{id} - and (z.star <![CDATA[ >= ]]> 3 and z.star <![CDATA[ <= ]]> 4)) goodNum, - (select count(z.id) from mall_goods_comment z where z.goods_id = #{id} and (z.star <![CDATA[ < ]]> 3 )) badNum + and (z.star <![CDATA[ >= ]]> 3 and z.star <![CDATA[ <= ]]> 4) and z.show_state = 1) goodNum, + (select count(z.id) from mall_goods_comment z where z.goods_id = #{id} and (z.star <![CDATA[ < ]]> 3 ) and z.show_state = 1) badNum from mall_goods_comment a limit 1 </select> @@ -342,6 +344,8 @@ select a.id, a.goods_name, + a.store_app_id, + a.store_goods_id, a.goods_introdution goodsIntroduction, a.thumb, a.unit, -- Gitblit v1.9.1