45 lines
2.1 KiB
XML
45 lines
2.1 KiB
XML
<?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="xtools.app.sys.mapper.SysUserNoticeMapper">
|
|
<!-- 获取分页列表 -->
|
|
<select id="getPage" resultType="xtools.app.sys.model.dto.resp.SysUserNoticeResp">
|
|
SELECT
|
|
sun.*,
|
|
sn.title,
|
|
su.nickname
|
|
FROM
|
|
sys_user_notice sun
|
|
LEFT JOIN sys_notice sn ON sun.notice_id = sn.id
|
|
LEFT JOIN sys_user su ON sun.user_id = su.id
|
|
<where>
|
|
<if test="query != null">
|
|
<if test="query.noticeRead != null">
|
|
AND sun.notice_read = #{query.noticeRead}
|
|
</if>
|
|
<if test="query.readTimeRange != null and query.readTimeRange.length == 2">
|
|
AND sun.read_time BETWEEN #{query.readTimeRange[0]} AND #{query.readTimeRange[1]}
|
|
</if>
|
|
<if test="query.isDeleted != null">
|
|
AND sun.is_deleted = #{query.isDeleted}
|
|
</if>
|
|
<if test="query.memo != null and query.memo != ''">
|
|
AND sun.memo LIKE CONCAT('%', #{query.memo}, '%')
|
|
</if>
|
|
<if test="query.gmtCreateRange != null and query.gmtCreateRange.length == 2">
|
|
AND sun.gmt_create BETWEEN #{query.gmtCreateRange[0]} AND #{query.gmtCreateRange[1]}
|
|
</if>
|
|
<if test="query.gmtModifiedRange != null and query.gmtModifiedRange.length == 2">
|
|
AND sun.gmt_modified BETWEEN #{query.gmtModifiedRange[0]} AND #{query.gmtModifiedRange[1]}
|
|
</if>
|
|
<if test="query.title != null and query.title != ''">
|
|
AND sn.title LIKE CONCAT('%', #{query.title}, '%')
|
|
</if>
|
|
<if test="query.nickname != null and query.nickname != ''">
|
|
AND su.nickname LIKE CONCAT('%', #{query.nickname}, '%')
|
|
</if>
|
|
</if>
|
|
</where>
|
|
ORDER BY
|
|
sun.gmt_create
|
|
</select>
|
|
</mapper> |