2023-02-08 09:55:47 +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="com.rzyc.mapper.SysWarningUserMapper">
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.SysWarningUser">
|
|
|
|
|
<id column="warning_user_id" property="warningUserId" />
|
|
|
|
|
<result column="warning_id" property="warningId" />
|
|
|
|
|
<result column="user_id" property="userId" />
|
|
|
|
|
<result column="type_id" property="typeId" />
|
|
|
|
|
<result column="state" property="state" />
|
|
|
|
|
<result column="handle_time" property="handleTime" />
|
|
|
|
|
<result column="del_state" property="delState" />
|
|
|
|
|
<result column="create_time" property="createTime" />
|
|
|
|
|
<result column="create_by" property="createBy" />
|
|
|
|
|
<result column="modify_time" property="modifyTime" />
|
|
|
|
|
<result column="modify_by" property="modifyBy" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
warning_user_id, warning_id, user_id, type_id,state, handle_time, del_state, create_time, create_by, modify_time, modify_by
|
|
|
|
|
</sql>
|
|
|
|
|
|
2023-02-08 15:53:50 +08:00
|
|
|
|
|
|
|
|
<!-- 用户预警列表 -->
|
|
|
|
|
<resultMap id="UserWarningResultMap" type="com.rzyc.model.SysWarningUser">
|
|
|
|
|
<id column="warning_user_id" property="warningUserId" />
|
|
|
|
|
<result column="warning_id" property="warningId" />
|
|
|
|
|
<result column="user_id" property="userId" />
|
|
|
|
|
<result column="type_id" property="typeId" />
|
|
|
|
|
<result column="state" property="state" />
|
|
|
|
|
<result column="handle_time" property="handleTime" />
|
|
|
|
|
<result column="del_state" property="delState" />
|
|
|
|
|
<result column="create_time" property="createTime" />
|
|
|
|
|
<result column="create_by" property="createBy" />
|
|
|
|
|
<result column="modify_time" property="modifyTime" />
|
|
|
|
|
<result column="modify_by" property="modifyBy" />
|
|
|
|
|
<result column="typeName" property="typeName" />
|
|
|
|
|
<result column="warning_info" property="warningInfo" />
|
|
|
|
|
<result column="warning_time" property="warningTime" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<!--用户预警列表-->
|
|
|
|
|
<select id="userWarningList" resultMap="UserWarningResultMap">
|
|
|
|
|
SELECT wt.`name` typeName,sw.`warning_info`,sw.`warning_time`, wu.*
|
|
|
|
|
FROM `sys_warning_user` wu
|
|
|
|
|
LEFT JOIN `sys_warning` sw ON wu.`warning_id` = sw.`warning_id`
|
|
|
|
|
LEFT JOIN `sys_warning_type` wt ON wu.`type_id` = wt.`type_id`
|
|
|
|
|
WHERE wu.user_id = #{userId}
|
|
|
|
|
<if test="null != state">
|
|
|
|
|
AND wu.`state` = #{state}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != typeId and '' != typeId">
|
|
|
|
|
AND wu.`type_id` = #{typeId}
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY sw.`warning_time` DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--修改预警状态为已读-->
|
|
|
|
|
<update id="changeState">
|
|
|
|
|
update sys_warning_user set state = 2 where warning_user_id = #{warningUserId}
|
|
|
|
|
</update>
|
|
|
|
|
|
2023-02-08 09:55:47 +08:00
|
|
|
</mapper>
|