完善了之前的通知管理功能,支持对发送的通知的批量更改和删除;在学生证补办模块增加了完成制作功能。

This commit is contained in:
MDSMO
2025-08-11 15:25:53 +08:00
parent 28383d3a94
commit dd51721e4e
20 changed files with 510 additions and 178 deletions

View File

@@ -1,14 +1,16 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.srs.routine.mapper.NotificationManagementMapper">
<resultMap type="NotificationManagement" id="NotificationManagementResult">
<result property="id" column="id" />
<result property="sender" column="sender" />
<result property="receiver" column="receiver" />
<result property="title" column="title" />
<result property="content" column="content" />
<result property="gradeIds" column="grade_ids" />
<result property="gradeName" column="grade_name" />
<result property="sender" column="sender" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@@ -27,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectNotificationManagementVo">
select id, sender, receiver, content, create_by, create_time, update_by, update_time from cph_msg
select id, title, content, grade_ids, sender, create_by, create_time, update_by, update_time from srs_notification
</sql>
<sql id="selectGradeVo">
@@ -36,57 +38,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectNotificationManagementList" parameterType="NotificationManagement" resultMap="NotificationManagementResult">
<include refid="selectNotificationManagementVo"/>
<where>
<if test="sender != null "> and sender = #{sender}</if>
<if test="receiver != null "> and receiver = #{receiver}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
<if test="gradeIds != null and gradeIds != ''"> and grade_ids = #{gradeIds}</if>
<if test="sender != null"> and sender = #{sender}</if>
</where>
order by create_time desc
</select>
<!-- 查询当前用户发送的通知列表 -->
<select id="selectNotificationManagementListBySender" resultMap="NotificationManagementResult">
<include refid="selectNotificationManagementVo"/>
<where>
sender = #{senderId}
<if test="notification.receiver != null "> and receiver = #{notification.receiver}</if>
<if test="notification.content != null and notification.content != ''"> and content = #{notification.content}</if>
select n.id, n.title, n.content, n.grade_ids, n.sender, n.create_by, n.create_time, n.update_by, n.update_time,
GROUP_CONCAT(g.grade_name SEPARATOR ',') as grade_name
from srs_notification n
left join srs_grade g on FIND_IN_SET(g.grade_id, n.grade_ids) > 0
<where>
n.sender = #{senderId}
<if test="notification.title != null and notification.title != ''"> and n.title like concat('%', #{notification.title}, '%')</if>
<if test="notification.content != null and notification.content != ''"> and n.content like concat('%', #{notification.content}, '%')</if>
<if test="notification.gradeIds != null and notification.gradeIds != ''"> and n.grade_ids = #{notification.gradeIds}</if>
</where>
order by create_time desc
group by n.id, n.title, n.content, n.grade_ids, n.sender, n.create_by, n.create_time, n.update_by, n.update_time
order by n.create_time desc
</select>
<select id="selectNotificationManagementById" parameterType="Long" resultMap="NotificationManagementResult">
<include refid="selectNotificationManagementVo"/>
where id = #{id}
</select>
<!-- 插入数据到通知管理表-->
<insert id="insertNotificationManagement" parameterType="NotificationManagement" useGeneratedKeys="true" keyProperty="id">
insert into cph_msg
insert into srs_notification
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sender != null">sender,</if>
<if test="receiver != null">receiver,</if>
<if test="title != null">title,</if>
<if test="content != null">content,</if>
<if test="gradeIds != null">grade_ids,</if>
<if test="sender != null">sender,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sender != null">#{sender},</if>
<if test="receiver != null">#{receiver},</if>
<if test="title != null">#{title},</if>
<if test="content != null">#{content},</if>
<if test="gradeIds != null">#{gradeIds},</if>
<if test="sender != null">#{sender},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</trim>
</insert>
<update id="updateNotificationManagement" parameterType="NotificationManagement">
update cph_msg
update srs_notification
<trim prefix="SET" suffixOverrides=",">
<if test="sender != null">sender = #{sender},</if>
<if test="receiver != null">receiver = #{receiver},</if>
<if test="title != null">title = #{title},</if>
<if test="content != null">content = #{content},</if>
<if test="gradeIds != null">grade_ids = #{gradeIds},</if>
<if test="sender != null">sender = #{sender},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
@@ -96,11 +110,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteNotificationManagementById" parameterType="Long">
delete from cph_msg where id = #{id}
delete from srs_notification where id = #{id}
</delete>
<delete id="deleteNotificationManagementByIds" parameterType="String">
delete from cph_msg where id in
delete from srs_notification where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
@@ -126,8 +140,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</select>
<!-- 根据年级ID列表查询学生学号列表 -->
<select id="selectStudentNosByGrades" resultType="String">
SELECT DISTINCT ss.stu_no
FROM srs_student ss
left JOIN srs_class sc ON ss.class_id = sc.class_id
WHERE ss.stu_no IS NOT NULL
AND sc.grade_id IN
<foreach item="gradeId" collection="gradeIds" open="(" separator="," close=")">
#{gradeId}
</foreach>
</select>
<!-- 批量插入通知记录 -->
<!-- 批量插入通知记录到cph_msg表 -->
<insert id="batchInsertNotification" parameterType="java.util.List">
insert into cph_msg (sender, receiver, content, create_time)
values
@@ -136,4 +161,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
</mapper>
<!-- 批量删除cph_msg表数据 -->
<delete id="batchDeleteCphMsg" parameterType="java.util.List">
delete from cph_msg where (content, sender, create_time) in
<foreach collection="list" item="item" open="(" separator="," close=")">
(#{item.content}, #{item.sender}, #{item.createTime})
</foreach>
</delete>
<!-- 批量更新cph_msg表数据 -->
<update id="batchUpdateCphMsg" parameterType="java.util.Map">
update cph_msg
set content = #{newList[0].content}
where content = #{oldList[0].content}
and sender = #{oldList[0].sender}
and create_time = #{oldList[0].createTime}
</update>
</mapper>

View File

@@ -103,4 +103,28 @@
#{id}
</foreach>
</delete>
</mapper>
<!-- 更新审核信息并同时更新学生证补办状态 -->
<update id="updateRtStuMultiLevelReviewWithStuIdReissue" parameterType="RtStuMultiLevelReview">
<!-- 更新审核信息表 -->
update rt_stu_multi_level_review
<trim prefix="SET" suffixOverrides=",">
<if test="stuName != null">stu_name = #{stuName},</if>
<if test="stuNo != null and stuNo != ''">stuNo = #{stuNo},</if>
<if test="reason != null and reason != ''">reason = #{reason},</if>
<if test="reviewer != null">reviewer = #{reviewer},</if>
<if test="reviewerIdentity != null">reviewer_identity = #{reviewerIdentity},</if>
<if test="reviewTime != null">review_time = #{reviewTime},</if>
<if test="reviewerId != null">reviewer_id = #{reviewerId},</if>
<if test="notes != null">notes = #{notes},</if>
<if test="type != null">type = #{type},</if>
<if test="reviewerStatus != null">reviewer_status = #{reviewerStatus},</if>
</trim>
where id = #{id};
<!-- 同时更新学生证补办表的审核状态 -->
update rt_stu_id_reissue
set inspection_progress = #{reviewerStatus}
where stu_no = #{stuNo};
</update>
</mapper>