yangys
2024-09-04 04c57331cf84c8f606c2838dcb6fe5463fb9b68c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qianwen.smartman.modules.notify.mapper.NoticeMapper">
 
 
    <select id="selectNoticePage" resultType="com.qianwen.smartman.modules.notify.vo.NoticeVO">
        SELECT
        n.id,
        n.title,
        n.update_time,
        d.dict_value AS categoryName
        FROM
        blade_notice n
        LEFT JOIN ( SELECT * FROM blade_dict WHERE CODE = 'notice' ) d ON n.category = d.dict_key
        WHERE
        n.is_deleted = 0
        <if test="notice.keyWord != null">
            and n.title like CONCAT(#{notice.keyWord}, '%')
        </if>
        <if test="notice.startDate != null and notice.endDate != null ">
            AND n.update_time BETWEEN #{notice.startDate } AND #{notice.endDate}
        </if>
        <if test="notice.categoryIds != null and notice.categoryIds.size > 0">
            and n.category in
            <foreach collection="notice.categoryIds" item="item" index="index" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        order by n.update_time desc
    </select>
</mapper>