wip: 通知公告开发
通知公告开发
This commit is contained in:
@@ -1,67 +1,44 @@
|
||||
<?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.youlai.system.mapper.NoticeMapper">
|
||||
<mapper namespace="com.youlai.boot.system.mapper.NoticeMapper">
|
||||
|
||||
<!-- 获取通知公告分页列表 -->
|
||||
<select id="getNoticePage" resultType="com.youlai.system.model.vo.NoticeVO">
|
||||
<select id="getNoticePage" resultType="com.youlai.boot.system.model.vo.NoticeVO">
|
||||
SELECT
|
||||
id,
|
||||
title,
|
||||
content,
|
||||
notice_type,
|
||||
release_by,
|
||||
priority,
|
||||
tar_type,
|
||||
send_status,
|
||||
send_time,
|
||||
recall_time,
|
||||
create_time,
|
||||
update_time
|
||||
sn.id,
|
||||
sn.title,
|
||||
sn.notice_type,
|
||||
su.nickname AS release_by,
|
||||
sn.priority,
|
||||
sn.tar_type,
|
||||
sn.release_status,
|
||||
sn.release_time,
|
||||
sn.recall_time
|
||||
FROM
|
||||
sys_notice
|
||||
<where>
|
||||
sys_notice sn
|
||||
LEFT JOIN
|
||||
sys_user su ON su.id = sn.release_by
|
||||
where
|
||||
sn.is_deleted = 0
|
||||
<if test="queryParams.title != null and queryParams.title != ''">
|
||||
AND title = #{queryParams.title}
|
||||
AND sn.title LIKE CONCAT('%',#{queryParams.title},'%')
|
||||
</if>
|
||||
<if test="queryParams.content != null and queryParams.content != ''">
|
||||
AND content = #{queryParams.content}
|
||||
<if test="queryParams.releaseStatus != null">
|
||||
AND sn.release_status = #{queryParams.releaseStatus}
|
||||
</if>
|
||||
<if test="queryParams.noticeType != null">
|
||||
AND notice_type = #{queryParams.noticeType}
|
||||
</if>
|
||||
<if test="queryParams.releaseBy != null">
|
||||
AND release_by = #{queryParams.releaseBy}
|
||||
</if>
|
||||
<if test="queryParams.priority != null">
|
||||
AND priority = #{queryParams.priority}
|
||||
</if>
|
||||
<if test="queryParams.tarType != null">
|
||||
AND tar_type = #{queryParams.tarType}
|
||||
</if>
|
||||
<if test="queryParams.sendStatus != null">
|
||||
AND send_status = #{queryParams.sendStatus}
|
||||
</if>
|
||||
<if test="queryParams.sendTime != null">
|
||||
<if test="queryParams.sendTime[0] != null and queryParams.sendTime[0] != ''">
|
||||
<bind name="startDate" value="queryParams.sendTime[0].length() == 10 ? queryParams.sendTime[0] + ' 00:00:00' : queryParams.sendTime[0]"/>
|
||||
AND send_time >= #{startDate}
|
||||
<if test="queryParams.releaseTime != null">
|
||||
<if test="queryParams.releaseTime[0] != null and queryParams.releaseTime[0] != ''">
|
||||
<bind name="startDate" value="queryParams.releaseTime[0].length() == 10 ? queryParams.releaseTime[0] + ' 00:00:00' : queryParams.releaseTime[0]"/>
|
||||
AND sn.release_time >= #{startDate}
|
||||
</if>
|
||||
<if test="queryParams.sendTime[1] != null and queryParams.sendTime[1] != ''">
|
||||
<bind name="endDate" value="queryParams.sendTime[1].length() == 10 ? queryParams.sendTime[1] + ' 23:59:59' : queryParams.sendTime[1]"/>
|
||||
AND send_time <= #{endDate}
|
||||
<if test="queryParams.releaseTime[1] != null and queryParams.releaseTime[1] != ''">
|
||||
<bind name="endDate" value="queryParams.releaseTime[1].length() == 10 ? queryParams.releaseTime[1] + ' 23:59:59' : queryParams.releaseTime[1]"/>
|
||||
AND sn.release_time <= #{endDate}
|
||||
</if>
|
||||
</if>
|
||||
<if test="queryParams.recallTime != null">
|
||||
<if test="queryParams.recallTime[0] != null and queryParams.recallTime[0] != ''">
|
||||
<bind name="startDate" value="queryParams.recallTime[0].length() == 10 ? queryParams.recallTime[0] + ' 00:00:00' : queryParams.recallTime[0]"/>
|
||||
AND recall_time >= #{startDate}
|
||||
</if>
|
||||
<if test="queryParams.recallTime[1] != null and queryParams.recallTime[1] != ''">
|
||||
<bind name="endDate" value="queryParams.recallTime[1].length() == 10 ? queryParams.recallTime[1] + ' 23:59:59' : queryParams.recallTime[1]"/>
|
||||
AND recall_time <= #{endDate}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
id
|
||||
DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,41 +1,5 @@
|
||||
<?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.youlai.system.mapper.NoticeStatusMapper">
|
||||
|
||||
<!-- 获取用户公告状态分页列表 -->
|
||||
<select id="getNoticeStatusPage" resultType="com.youlai.system.model.vo.NoticeStatusVO">
|
||||
SELECT
|
||||
id,
|
||||
notice_id,
|
||||
user_id,
|
||||
read_status,
|
||||
read_tiem
|
||||
FROM
|
||||
sys_notice_status
|
||||
<where>
|
||||
<if test="queryParams.id != null">
|
||||
AND id = #{queryParams.id}
|
||||
</if>
|
||||
<if test="queryParams.noticeId != null">
|
||||
AND notice_id = #{queryParams.noticeId}
|
||||
</if>
|
||||
<if test="queryParams.userId != null">
|
||||
AND user_id = #{queryParams.userId}
|
||||
</if>
|
||||
<if test="queryParams.readStatus != null">
|
||||
AND read_status = #{queryParams.readStatus}
|
||||
</if>
|
||||
<if test="queryParams.readTiem != null">
|
||||
<if test="queryParams.readTiem[0] != null and queryParams.readTiem[0] != ''">
|
||||
<bind name="startDate" value="queryParams.readTiem[0].length() == 10 ? queryParams.readTiem[0] + ' 00:00:00' : queryParams.readTiem[0]"/>
|
||||
AND read_tiem >= #{startDate}
|
||||
</if>
|
||||
<if test="queryParams.readTiem[1] != null and queryParams.readTiem[1] != ''">
|
||||
<bind name="endDate" value="queryParams.readTiem[1].length() == 10 ? queryParams.readTiem[1] + ' 23:59:59' : queryParams.readTiem[1]"/>
|
||||
AND read_tiem <= #{endDate}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<mapper namespace="com.youlai.boot.system.mapper.NoticeStatusMapper">
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user