sunhh пре 2 година
родитељ
комит
95fce999b3

+ 2 - 0
business-service/src/main/java/com/ozs/service/mapper/MsgWebPushMapper.java

@@ -25,4 +25,6 @@ public interface MsgWebPushMapper extends BaseMapper<MsgWebPush> {
     List<String> messageMoreByUserIds(List<String> userIds);
 
     Map<String, Integer> messageMoreNum(MsgAlarmVo msgAlarmVo);
+
+    int messageMoreCount(MsgAlarmVo msgAlarmVo);
 }

+ 1 - 0
business-service/src/main/java/com/ozs/service/service/impl/MsgWebPushServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
 import com.ozs.common.utils.AppendUtils;
 import com.ozs.common.utils.PageUtils;
 import com.ozs.common.utils.StringUtils;

+ 46 - 0
business-service/src/main/resources/mapper/service/MsgWebPushMapper.xml

@@ -69,6 +69,52 @@
         ) 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 &gt;= #{beginAlarmTime}
+            </if>
+            <if test="endAlarmTime != null and endAlarmTime != ''">
+                and alarm_time &lt;= #{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 &gt;= #{beginMile}
+            </if>
+            <if test="endMile != null and endMile != ''">
+                and end_mile &lt;= #{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>