|
@@ -2,58 +2,21 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
<mapper namespace="com.ozs.service.mapper.MsgWebPushMapper">
|
|
|
|
|
|
- <select id="webAlarmNum" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
|
|
|
- select count(1)
|
|
|
- from msg_web_push AS a
|
|
|
- join msg_alarm AS b on a.alarm_id = b.alarm_id
|
|
|
- join base_camera_management AS c on b.camera_code = c.camera_code
|
|
|
- <where>
|
|
|
- a.status = 1
|
|
|
- <if test="!dsFlay">
|
|
|
- and
|
|
|
- <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
- <if test="dsUserId != null and dsUserId != ''">
|
|
|
- or a.receive_by = #{dsUserId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
- or c.dept_id = #{dsDeptId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptIds != null">
|
|
|
- or c.dept_id in
|
|
|
- <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ <select id="webAlarmNum" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
+ select count(1) from msg_web_push where status = 1
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ and receive_by = #{userId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="webAlarm" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="com.ozs.service.entity.MsgAlarm">
|
|
|
+ <select id="webAlarm" parameterType="java.lang.String" resultType="com.ozs.service.entity.MsgAlarm">
|
|
|
select b.*
|
|
|
from msg_web_push AS a
|
|
|
join msg_alarm AS b on a.alarm_id = b.alarm_id
|
|
|
- join base_camera_management AS c on b.camera_code = c.camera_code
|
|
|
- <where>
|
|
|
- a.status = 1
|
|
|
- <if test="!dsFlay">
|
|
|
- and
|
|
|
- <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
- <if test="dsUserId != null and dsUserId != ''">
|
|
|
- or a.receive_by = #{dsUserId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
- or c.dept_id = #{dsDeptId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptIds != null">
|
|
|
- or c.dept_id in
|
|
|
- <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ where a.status = 1
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ and a.receive_by = #{userId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="messageMore" parameterType="com.ozs.service.entity.vo.MsgAlarmVo"
|
|
@@ -63,22 +26,8 @@
|
|
|
join msg_alarm AS b on a.alarm_id = b.alarm_id
|
|
|
join base_camera_management AS c on b.camera_code = c.camera_code
|
|
|
<where>
|
|
|
- <if test="!dsFlay">
|
|
|
- and
|
|
|
- <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
- <if test="dsUserId != null and dsUserId != ''">
|
|
|
- or a.receive_by = #{dsUserId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
- or c.dept_id = #{dsDeptId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptIds != null">
|
|
|
- or c.dept_id in
|
|
|
- <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ or a.receive_by = #{userId}
|
|
|
</if>
|
|
|
<if test="status != null and status != ''">
|
|
|
and a.status = #{status}
|
|
@@ -108,24 +57,10 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="messageMoreNum" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.util.Map">
|
|
|
- select count(1) count, SUM(CASE a.status WHEN '1' THEN 1 ELSE 0 end) AS 'noCount' from msg_web_push AS a join msg_alarm AS b on a.alarm_id = b.alarm_id join base_camera_management AS c on b.camera_code = c.camera_code
|
|
|
+ select count(1) count, SUM(CASE status WHEN '1' THEN 1 ELSE 0 end) AS 'noCount' from msg_web_push
|
|
|
<where>
|
|
|
- <if test="!dsFlay">
|
|
|
- and
|
|
|
- <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
- <if test="dsUserId != null and dsUserId != ''">
|
|
|
- or a.receive_by = #{dsUserId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
- or c.dept_id = #{dsDeptId}
|
|
|
- </if>
|
|
|
- <if test="dsDeptIds != null">
|
|
|
- or c.dept_id in
|
|
|
- <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ or receive_by = #{userId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|