You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.9 KiB
84 lines
2.9 KiB
<?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.epmet.dao.UserMessageDao">
|
|
|
|
<resultMap id="userMessageMap" type="com.epmet.entity.UserMessageEntity">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerId" column="customer_id"/>
|
|
<result property="gridId" column="grid_id"/>
|
|
<result property="userId" column="user_id"/>
|
|
<result property="app" column="app"/>
|
|
<result property="title" column="title"/>
|
|
<result property="messageContent" column="message_content"/>
|
|
<result property="readFlag" column="read_flag"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<select id="selectMyMessageList" resultType="com.epmet.entity.UserMessageEntity">
|
|
SELECT
|
|
id,
|
|
app,
|
|
updated_time,
|
|
updated_by,
|
|
read_flag,
|
|
title,
|
|
del_flag,
|
|
user_id,
|
|
revision,
|
|
created_by,
|
|
customer_id,
|
|
created_time,
|
|
grid_id,
|
|
message_content,
|
|
message_type,
|
|
target_id
|
|
FROM
|
|
user_message
|
|
WHERE
|
|
del_flag = '0'
|
|
AND CUSTOMER_ID = #{customerId}
|
|
AND USER_ID = #{userId}
|
|
ORDER BY
|
|
CREATED_TIME DESC
|
|
LIMIT #{pageNo}, #{pageSize}
|
|
</select>
|
|
|
|
<!-- 根据用户id、客户id统计用户未读消息总数 -->
|
|
<select id="queryUnReadMsg" parameterType="map" resultType="java.lang.Integer">
|
|
select count(1)
|
|
from
|
|
user_message
|
|
where
|
|
del_flag = '0'
|
|
and app='gov'
|
|
and CUSTOMER_ID = #{customerId}
|
|
and USER_ID = #{userId}
|
|
and read_flag='unread'
|
|
</select>
|
|
<!-- 查询政府端工作人员我的消息列表 -->
|
|
<select id="queryStaffMessage" parameterType="com.epmet.dto.form.StaffMessageFormDTO"
|
|
resultType="com.epmet.dto.result.StaffMessageResultDTO">
|
|
select id,
|
|
title,
|
|
message_content as messageContent,
|
|
read_flag as readFlag,
|
|
unix_timestamp(CREATED_TIME) as createdTime,
|
|
message_type AS messageType,
|
|
target_id AS targetId
|
|
from
|
|
user_message
|
|
where
|
|
del_flag = '0'
|
|
and app='gov'
|
|
and CUSTOMER_ID = #{customerId}
|
|
and USER_ID = #{userId}
|
|
ORDER BY CREATED_TIME DESC
|
|
LIMIT #{pageNo}, #{pageSize}
|
|
</select>
|
|
</mapper>
|