MsgWebPushMapper.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ozs.service.mapper.MsgWebPushMapper">
  4. <select id="webAlarmNum" parameterType="java.lang.String" resultType="java.lang.Integer">
  5. select count(1) from msg_web_push where status = 1
  6. <if test="userId != null and userId != ''">
  7. and receive_by = #{userId}
  8. </if>
  9. </select>
  10. <select id="webAlarm" parameterType="java.lang.String" resultType="com.ozs.service.entity.MsgAlarm">
  11. select b.*
  12. from msg_web_push AS a
  13. join msg_alarm AS b on a.alarm_id = b.alarm_id
  14. where a.status = 1
  15. <if test="userId != null and userId != ''">
  16. and a.receive_by = #{userId}
  17. </if>
  18. </select>
  19. <select id="messageMore" parameterType="com.ozs.service.entity.vo.MsgAlarmVo"
  20. resultType="com.ozs.service.entity.MsgAlarm">
  21. select b.*, a.status
  22. from msg_web_push AS a
  23. join msg_alarm AS b on a.alarm_id = b.alarm_id
  24. join base_camera_management AS c on b.camera_code = c.camera_code
  25. <where>
  26. <if test="userId != null and userId != ''">
  27. and a.receive_by = #{userId}
  28. </if>
  29. <if test="status != null and status != ''">
  30. and a.status = #{status}
  31. </if>
  32. <if test="alarmType != null and alarmType != ''">
  33. and b.alarm_type = #{alarmType}
  34. </if>
  35. <if test="beginAlarmTime != null and beginAlarmTime != ''">
  36. and b.alarm_time &gt;= #{beginAlarmTime}
  37. </if>
  38. <if test="endAlarmTime != null and endAlarmTime != ''">
  39. and b.alarm_time &lt;= #{endAlarmTime}
  40. </if>
  41. <if test="isLock != null and isLock != ''">
  42. and b.is_lock = #{isLock}
  43. </if>
  44. <if test="railwayCode != null and railwayCode != ''">
  45. and c.railway_code = #{railwayCode}
  46. </if>
  47. <if test="beginMile != null and beginMile != ''">
  48. and c.begin_mile &gt;= #{beginMile}
  49. </if>
  50. <if test="endMile != null and endMile != ''">
  51. and c.end_mile &lt;= #{endMile}
  52. </if>
  53. </where>
  54. </select>
  55. <select id="messageMoreNum" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.util.Map">
  56. select count(1) count, SUM(CASE status WHEN '1' THEN 1 ELSE 0 end) AS 'noCount' from msg_web_push
  57. <where>
  58. <if test="userId != null and userId != ''">
  59. and receive_by = #{userId}
  60. </if>
  61. </where>
  62. </select>
  63. </mapper>