123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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.ozs.service.mapper.MsgWebPushMapper">
- <select id="webAlarmNum" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(*) from msg_web_push where status = 1 and receive_by in
- <foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- </select>
- <select id="webAlarm" parameterType="java.lang.String" resultType="com.ozs.service.entity.MsgAlarm">
- select b.* from (
- select alarm_id from msg_web_push where status = 1 and receive_by in
- <foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- ) a left join (
- select * from msg_alarm
- ) b on a.alarm_id = b.alarm_id
- </select>
- <select id="messageMoreByUserIds" parameterType="java.util.List" resultType="java.lang.String">
- select alarm_id from msg_web_push where status = #{status} and receive_by in
- <foreach item="item" collection="userIds" index="index" separator="," open="(" close=")">
- #{item}
- </foreach>
- </select>
- <select id="messageMore" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="com.ozs.service.entity.MsgAlarm">
- select b.* from (
- select alarm_id from msg_web_push
- <where>
- <if test="status != null and status != ''">
- and status = #{status}
- </if>
- <if test="userIds != null and userIds != ''">
- and receive_by in
- <foreach item="item" collection="userIds" index="index" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- ) a left join (
- select * from msg_alarm
- <where>
- <if test="alarmType != null and alarmType != ''">
- and alarm_type = #{alarmType}
- </if>
- <if test="beginAlarmTime != null and beginAlarmTime != ''">
- and alarm_time >= #{beginAlarmTime}
- </if>
- <if test="endAlarmTime != null and endAlarmTime != ''">
- and alarm_time <= #{endAlarmTime}
- </if>
- <if test="isLock != null and isLock != ''">
- and is_lock = #{isLock}
- </if>
- </where>
- ) b on a.alarm_id = b.alarm_id left join (
- select * from base_camera_management
- <where>
- <if test="railwayCode != null and railwayCode != ''">
- and railway_code = #{railwayCode}
- </if>
- <if test="beginMile != null and beginMile != ''">
- and begin_mile >= #{beginMile}
- </if>
- <if test="endMile != null and endMile != ''">
- and end_mile <= #{endMile}
- </if>
- </where>
- ) c on b.camera_code = c.camera_code
- </select>
- <select id="messageMoreCount" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
- select count(b.*) from (
- select alarm_id from msg_web_push
- <where>
- <if test="status != null and status != ''">
- and status = #{status}
- </if>
- <if test="userIds != null and userIds != ''">
- and receive_by in
- <foreach item="item" collection="userIds" index="index" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- ) a left join (
- select * from msg_alarm
- <where>
- <if test="alarmType != null and alarmType != ''">
- and alarm_type = #{alarmType}
- </if>
- <if test="beginAlarmTime != null and beginAlarmTime != ''">
- and alarm_time >= #{beginAlarmTime}
- </if>
- <if test="endAlarmTime != null and endAlarmTime != ''">
- and alarm_time <= #{endAlarmTime}
- </if>
- <if test="isLock != null and isLock != ''">
- and is_lock = #{isLock}
- </if>
- </where>
- ) b on a.alarm_id = b.alarm_id left join (
- select * from base_camera_management
- <where>
- <if test="railwayCode != null and railwayCode != ''">
- and railway_code = #{railwayCode}
- </if>
- <if test="beginMile != null and beginMile != ''">
- and begin_mile >= #{beginMile}
- </if>
- <if test="endMile != null and endMile != ''">
- and end_mile <= #{endMile}
- </if>
- </where>
- ) c on b.camera_code = c.camera_code
- </select>
- <select id="messageMoreNum" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.util.Map">
- select count(id) count, SUM(CASE status WHEN '1' THEN 1 ELSE 0 end) AS 'noCount' from msg_web_push
- <where>
- <if test="userIds != null and userIds != ''">
- and receive_by in
- <foreach item="item" collection="userIds" index="index" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- </mapper>
|