2024-10-30 15:07:53 +08:00
|
|
|
<?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="cn.bunny.services.mapper.MessageMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.system.Message">
|
|
|
|
<id column="id" property="id"/>
|
2024-10-30 16:56:30 +08:00
|
|
|
<id column="create_time" property="createTime"/>
|
|
|
|
<id column="update_time" property="updateTime"/>
|
|
|
|
<id column="create_user" property="createUser"/>
|
|
|
|
<id column="update_user" property="updateUser"/>
|
|
|
|
<id column="is_deleted" property="isDeleted"/>
|
|
|
|
<id column="title" property="title"/>
|
|
|
|
<id column="received_user_id" property="receivedUserId"/>
|
|
|
|
<id column="send_user_id" property="sendUserId"/>
|
|
|
|
<id column="message_type" property="messageType"/>
|
|
|
|
<id column="content" property="content"/>
|
|
|
|
<id column="editor_type" property="editorType"/>
|
|
|
|
<id column="status" property="status"/>
|
2024-10-30 15:07:53 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
<sql id="Base_Column_List">
|
2024-10-30 16:56:30 +08:00
|
|
|
id, create_time, update_time, create_user, update_user, is_deleted, title, received_user_id, send_user_id, send_nick_name, message_type, content, editor_type, status
|
2024-10-30 15:07:53 +08:00
|
|
|
</sql>
|
|
|
|
|
2024-10-30 16:56:30 +08:00
|
|
|
<!-- 分页查询系统消息内容 -->
|
2024-10-30 23:44:21 +08:00
|
|
|
<select id="selectListByPage" resultType="cn.bunny.dao.vo.system.message.MessageVo">
|
2024-10-30 16:56:30 +08:00
|
|
|
select
|
2024-10-30 23:44:21 +08:00
|
|
|
message.*,
|
|
|
|
create_user.username as create_username,
|
|
|
|
update_user.username as update_username,
|
|
|
|
send_user.nickname as send_nickname
|
|
|
|
from sys_message message
|
|
|
|
left join sys_user create_user on create_user.id = message.create_user
|
|
|
|
left join sys_user update_user on update_user.id = message.update_user
|
|
|
|
left join sys_user send_user on send_user.id = message.send_user_id
|
2024-10-30 16:56:30 +08:00
|
|
|
<where>
|
2024-10-30 23:44:21 +08:00
|
|
|
message.is_deleted = 0
|
2024-10-30 16:56:30 +08:00
|
|
|
<if test="dto.title != null and dto.title != ''">
|
2024-10-30 23:44:21 +08:00
|
|
|
and message.title like CONCAT('%',#{dto.title},'%')
|
2024-10-30 16:56:30 +08:00
|
|
|
</if>
|
2024-10-30 23:44:21 +08:00
|
|
|
<if test="dto.sendNickname != null and dto.sendNickname != ''">
|
|
|
|
and send_user.nickname like CONCAT('%',#{dto.sendNickname},'%')
|
2024-10-30 16:56:30 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.messageType != null and dto.messageType != ''">
|
2024-10-30 23:44:21 +08:00
|
|
|
and message.message_type like CONCAT('%',#{dto.messageType},'%')
|
2024-10-30 16:56:30 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.content != null and dto.content != ''">
|
2024-10-30 23:44:21 +08:00
|
|
|
and message.content like CONCAT('%',#{dto.content},'%')
|
2024-10-30 16:56:30 +08:00
|
|
|
</if>
|
|
|
|
<if test="dto.editorType != null and dto.editorType != ''">
|
2024-10-30 23:44:21 +08:00
|
|
|
and message.editor_type = #{dto.editorType}
|
2024-10-30 16:56:30 +08:00
|
|
|
</if>
|
2024-10-30 23:44:21 +08:00
|
|
|
<if test="dto.status != null">
|
|
|
|
and message.status = #{dto.status}
|
2024-10-30 16:56:30 +08:00
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 物理删除系统消息 -->
|
|
|
|
<delete id="deleteBatchIdsWithPhysics">
|
|
|
|
delete
|
|
|
|
from sys_message
|
|
|
|
where id in
|
|
|
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
2024-10-30 15:07:53 +08:00
|
|
|
</mapper>
|