| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 | <?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(1) from msg_web_push where status = 1        <if test="userId != null and userId != ''">            and receive_by = #{userId}        </if>    </select>    <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        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"            resultType="com.ozs.service.entity.MsgAlarm">        select b.*, a.status        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>            <if test="userId != null and userId != ''">                and a.receive_by = #{userId}            </if>            <if test="status != null and status != ''">                and a.status = #{status}            </if>            <if test="alarmType != null and alarmType != ''">                and b.alarm_type = #{alarmType}            </if>            <if test="beginAlarmTime != null and beginAlarmTime != ''">                and b.alarm_time >= #{beginAlarmTime}            </if>            <if test="endAlarmTime != null and endAlarmTime != ''">                and b.alarm_time <= #{endAlarmTime}            </if>            <if test="isLock != null and isLock != ''">                and b.is_lock = #{isLock}            </if>            <if test="railwayCode != null and railwayCode != ''">                and c.railway_code = #{railwayCode}            </if>            <if test="beginMile != null and beginMile != ''">                and c.begin_mile >= #{beginMile}            </if>            <if test="endMile != null and endMile != ''">                and c.end_mile <= #{endMile}            </if>        </where>    </select>    <select id="messageMoreNum" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.util.Map">        select count(1) count, SUM(CASE status WHEN '1' THEN 1 ELSE 0 end) AS 'noCount' from msg_web_push        <where>            <if test="userId != null and userId != ''">                and receive_by = #{userId}            </if>        </where>    </select></mapper>
 |