From c690f01658a81a8b843fbacd9405e83d83c9aee3 Mon Sep 17 00:00:00 2001
From: Hentua <wangdoubleone@gmail.com>
Date: Sun, 23 Apr 2023 17:11:31 +0800
Subject: [PATCH] fix
---
src/main/resources/mapper/modules/MallNewsInfoMapper.xml | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/modules/MallNewsInfoMapper.xml b/src/main/resources/mapper/modules/MallNewsInfoMapper.xml
index 3acbf1a..dc26a1a 100644
--- a/src/main/resources/mapper/modules/MallNewsInfoMapper.xml
+++ b/src/main/resources/mapper/modules/MallNewsInfoMapper.xml
@@ -2,4 +2,36 @@
<!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.MallNewsInfoMapper">
+ <select id="getNewInfoListInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallNewsInfoVo">
+ SELECT
+ a.*,
+ 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
+ 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