|
@@ -3,18 +3,24 @@
|
|
|
<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 count(*) from msg_web_push where status = 1
|
|
|
+ <if test="userIds != null and userIds != ''">
|
|
|
+ and receive_by in
|
|
|
+ <foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</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>
|
|
|
+ select alarm_id from msg_web_push where status = 1
|
|
|
+ <if test="userIds != null and userIds != ''">
|
|
|
+ and receive_by in
|
|
|
+ <foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
) a left join (
|
|
|
select * from msg_alarm
|
|
|
) b on a.alarm_id = b.alarm_id
|
|
@@ -27,49 +33,50 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="messageMore" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="com.ozs.service.entity.MsgAlarm">
|
|
|
+ <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>
|
|
|
+ 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>
|
|
|
+ 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>
|
|
|
+ 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>
|
|
|
|