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.
92 lines
3.7 KiB
92 lines
3.7 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.ccsens.tall.persist.dao.SysOperationDao">
|
|
|
|
<resultMap id="MessageQuery" type="com.ccsens.tall.bean.vo.ProjectMessageVo$Query">
|
|
<result column="id" jdbcType="BIGINT" property="id"></result>
|
|
<result column="operation_id" jdbcType="BIGINT" property="operationId"></result>
|
|
<result column="send_type" jdbcType="TINYINT" property="sendType"></result>
|
|
<result column="read_status" jdbcType="TINYINT" property="readStatus"></result>
|
|
<result column="created_at" jdbcType="TIMESTAMP" property="createTime"></result>
|
|
<collection property="messages" select="queryContent" column="operation_id" javaType="java.util.List"
|
|
ofType="com.ccsens.tall.bean.vo.MessageVo$Message">
|
|
<result column="content" jdbcType="VARCHAR" property="content"></result>
|
|
<result column="type" jdbcType="TINYINT" property="type"></result>
|
|
<result column="settings" jdbcType="VARCHAR" property="settings"></result>
|
|
</collection>
|
|
</resultMap>
|
|
<resultMap id="ProjectMsg" type="com.ccsens.tall.bean.vo.ProjectMessageVo$ProjectMsg">
|
|
<result column="id" jdbcType="BIGINT" property="operationId"></result>
|
|
<result column="created_at" jdbcType="TIMESTAMP" property="createTime"></result>
|
|
<collection property="messages" select="queryContent" column="id" javaType="java.util.List"
|
|
ofType="com.ccsens.tall.bean.vo.MessageVo$Message">
|
|
<result column="content" jdbcType="VARCHAR" property="content"></result>
|
|
<result column="type" jdbcType="TINYINT" property="type"></result>
|
|
<result column="settings" jdbcType="VARCHAR" property="settings"></result>
|
|
</collection>
|
|
</resultMap>
|
|
|
|
|
|
<select id="queryUnreadNum" resultType="com.ccsens.tall.bean.vo.ProjectMessageVo$UnreadNum">
|
|
SELECT
|
|
count( * ) AS unreadNum
|
|
FROM
|
|
t_sys_operation o,
|
|
t_sys_message_send s
|
|
WHERE
|
|
o.id = s.operation_id
|
|
AND s.receiver_id = #{userId}
|
|
AND s.send_type = #{sendType}
|
|
AND s.init_read =0
|
|
AND s.rec_status = 0
|
|
AND o.rec_status = 0
|
|
</select>
|
|
<select id="queryMsg" resultMap="MessageQuery">
|
|
SELECT
|
|
s.id, s.operation_id, s.send_type, s.created_at, s.read_status
|
|
FROM
|
|
t_sys_message_send s
|
|
WHERE
|
|
s.receiver_id = #{userId}
|
|
AND s.send_type = #{param.sendType}
|
|
AND s.rec_status = 0
|
|
ORDER BY
|
|
s.created_at DESC
|
|
</select>
|
|
<select id="queryContent" resultType="com.ccsens.tall.bean.vo.MessageVo$Message">
|
|
SELECT
|
|
content,
|
|
type,
|
|
settings
|
|
FROM
|
|
t_sys_operation_message
|
|
WHERE
|
|
operation_id = #{operationId}
|
|
AND rec_status = 0
|
|
ORDER BY
|
|
sort
|
|
</select>
|
|
<select id="queryProjectMsg" resultMap="ProjectMsg">
|
|
SELECT
|
|
o.id,
|
|
o.created_at
|
|
FROM
|
|
t_sys_operation o
|
|
WHERE
|
|
o.project_id = #{projectId}
|
|
AND o.rec_status = 0
|
|
</select>
|
|
|
|
<select id="findMessageByOperate" resultType="com.ccsens.tall.bean.vo.InputDocVo$DocRecordOfTask">
|
|
SELECT
|
|
so.id AS operationId,
|
|
so.created_at AS createTime
|
|
FROM
|
|
t_sys_operation AS so
|
|
WHERE
|
|
so.task_detail_id = #{taskId}
|
|
AND so.operate_type IN (7, 8, 9, 14, 15, 16)
|
|
AND so.rec_status = 0
|
|
ORDER BY created_at DESC
|
|
</select>
|
|
</mapper>
|