MsgAppPushMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.mapper.MsgAppPushMapper">
  4. <resultMap id="MsgAppPushVoResult" type="com.ozs.entity.vo.MsgAppPushVo">
  5. <id column="id" property="id"/>
  6. <result column="alarm_id" property="alarmId"/>
  7. <result column="receive_by" property="receiveBy"/>
  8. <result column="status" property="status"/>
  9. <result column="create_by" property="createBy"/>
  10. <result column="create_time" property="createTime"/>
  11. <result column="update_by" property="updateBy"/>
  12. <result column="update_time" property="updateTime"/>
  13. <result column="remark" property="remark"/>
  14. <result column="lineDir" property="lineDir"/>
  15. <result column="railwayName" property="railwayName"/>
  16. <result column="railwayType" property="railwayType"/>
  17. <result column="alarmMile" property="alarmMile"/>
  18. <result column="alarmType" property="alarmType"/>
  19. <result column="imageUrl" property="imageUrl"/>
  20. <association property="baseCameraManagement" javaType="com.ozs.entity.BaseCameraManagement">
  21. <id column="id" property="id"/>
  22. <result column="railway_code" property="railwayCode"/>
  23. <result column="channel" property="channel"/>
  24. <result column="install_mile" property="installMile"/>
  25. <result column="begin_mile" property="beginMile"/>
  26. <result column="end_mile" property="endMile"/>
  27. <result column="install_longitude" property="installLongitude"/>
  28. <result column="install_latitude" property="installLatitude"/>
  29. </association>
  30. </resultMap>
  31. <select id="alarmPushMsg" resultMap="MsgAppPushVoResult" parameterType="com.ozs.entity.vo.MsgAppPushVo">
  32. select
  33. m.id,
  34. m.alarm_id,
  35. m.receive_by,
  36. a.line_dir AS lineDir,
  37. a.alarm_mile AS alarmMile,
  38. a.alarm_type AS alarmType,
  39. m.status,
  40. m.create_by,
  41. m.create_time,
  42. m.update_by,
  43. m.update_time,
  44. m.remark,
  45. b.railway_code AS railway_code,
  46. r.railway_name AS railwayName,
  47. r.railway_type AS railwayType,
  48. b.channel AS channel,
  49. b.install_mile AS install_mile,
  50. b.begin_mile AS begin_mile,
  51. b.end_mile AS end_mile,
  52. b.install_longitude AS install_longitude,
  53. b.install_latitude AS install_latitude
  54. from msg_app_push m join
  55. msg_alarm AS a on m.alarm_id=a.alarm_id join
  56. base_camera_management AS b on a.camera_code=b.camera_code join
  57. base_railway_management AS r on b.railway_code=r.railway_code
  58. <where>
  59. <if test="status != null and status != 0">
  60. and status = #{status}
  61. </if>
  62. <if test="receiveBy != null and receiveBy != ''">
  63. and receive_by = #{receiveBy}
  64. </if>
  65. </where>
  66. </select>
  67. <update id="update" parameterType="com.ozs.entity.MsgAppPush">
  68. update msg_app_push
  69. <set>
  70. <if test="status != null and status != 0">
  71. status = #{status},
  72. </if>
  73. <if test="updateBy != null and updateBy != ''">
  74. update_by = #{updateBy},
  75. </if>
  76. update_time = sysdate()
  77. </set>
  78. <where>
  79. <if test="pushId != null and pushId != ''">
  80. and push_id = #{pushId}
  81. </if>
  82. <if test="id != null and id != 0">
  83. and push_id = #{id}
  84. </if>
  85. </where>
  86. </update>
  87. <select id="messageMoreApp" parameterType="com.ozs.entity.vo.MsgAlarmVo" resultType="com.ozs.entity.MsgAlarm">
  88. select b.*, a.status, a.push_id as msgId
  89. from msg_app_push AS a
  90. join msg_alarm AS b on a.alarm_id = b.alarm_id
  91. join base_camera_management AS c on b.camera_code = c.camera_code
  92. <where>
  93. <if test="userId != null and userId != ''">
  94. and a.receive_by = #{userId}
  95. </if>
  96. <if test="status != null and status != 0">
  97. and a.status = #{status}
  98. </if>
  99. </where>
  100. </select>
  101. </mapper>