<?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>
|