From e59e24ee6b64f143df8318ce38c91e13364c0bcf Mon Sep 17 00:00:00 2001 From: Hentua <wangdoubleone@gmail.com> Date: Tue, 06 Jun 2023 17:10:05 +0800 Subject: [PATCH] fix --- src/main/resources/mapper/modules/MallNewsInfoMapper.xml | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/src/main/resources/mapper/modules/MallNewsInfoMapper.xml b/src/main/resources/mapper/modules/MallNewsInfoMapper.xml index ebb2b60..dc26a1a 100644 --- a/src/main/resources/mapper/modules/MallNewsInfoMapper.xml +++ b/src/main/resources/mapper/modules/MallNewsInfoMapper.xml @@ -8,10 +8,30 @@ c.title categoryName, b.goods_name targetName FROM mall_news_info a + inner join mall_news_category c on a.category_id=c.id + <if test="record.code != null and record.code != ''"> + and c.code=#{record.code} + </if> left join mall_goods b on a.target_id = b.id - left join mall_news_category c on a.category_id=c.id group by a.id order by a.CREATED_TIME desc </select> + <select id="selectNewsVoInPage" resultType="cc.mrbird.febs.mall.vo.NewsListVo"> + select * from mall_news_info newsInfo + inner join mall_news_category category on newsInfo.category_id=category.id + <where> + 1=1 + <if test="record.categoryId != null"> + and newsInfo.category_id=#{record.categoryId} + </if> + <if test="record.code != null and record.code != ''"> + and category.code=#{record.code} + </if> + <if test="record.isTop != null"> + and newsInfo.is_top=#{record.isTop} + </if> + </where> + order by newsInfo.CREATED_TIME desc + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.1