BaseCameraManagementMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.BaseCameraManagementMapper">
  4. <select id="selectCameraManagementList" resultType="com.ozs.service.entity.BaseCameraManagement" parameterType="com.ozs.service.entity.vo.BaseCameraManagementVo">
  5. SELECT
  6. a.id AS id,
  7. a.camera_code AS cameraCode,
  8. a.railway_code AS railwayCode,
  9. a.channel AS channel,
  10. a.dept_id AS deptId,
  11. a.line_dir AS lineDir,
  12. a.install_mile AS installMile,
  13. a.begin_mile AS beginMile,
  14. a.end_mile AS endMile,
  15. a.install_longitude AS installLongitude,
  16. a.install_latitude AS installLatitude,
  17. a.card_num AS cardNum,
  18. a.start_recording AS startRecording,
  19. a.task_id AS taskId,
  20. a.create_time AS createTime,
  21. a.remark AS remark,
  22. a.version_id AS versionId,
  23. a.version_num AS versionNum,
  24. a.version_name AS versionName,
  25. a.last_version_num AS lastVersionNum,
  26. a.remark AS remark,
  27. a.measure_point_name AS measurePointName,
  28. a.camera_sn AS cameraSn
  29. FROM
  30. base_camera_management a
  31. <where>
  32. <if test="railwayCode != null and railwayCode != ''">
  33. and a.railway_code=#{railwayCode}
  34. </if>
  35. <if test="cameraCode != null and cameraCode != ''">
  36. and a.camera_code=#{cameraCode}
  37. </if>
  38. <if test="lineDir != null and lineDir != 0">
  39. and a.line_dir =#{lineDir}
  40. </if>
  41. <if test="deptId != null and deptId != 0">
  42. and a.dept_id =#{deptId}
  43. </if>
  44. <if test="beginMile != null and beginMile != 0">
  45. and a.begin_mile &gt;=#{beginMile}
  46. </if>
  47. <if test="endMile != null and endMile != 0">
  48. and a.end_mile &lt;=#{endMile}
  49. </if>
  50. <if test="installMile != null and installMile != 0">
  51. and a.install_mile =#{installMile}
  52. </if>
  53. <if test="ids != null and ids.size>0">
  54. and a.id in
  55. <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
  56. #{items}
  57. </foreach>
  58. </if>
  59. <if test="!dsFlay">
  60. and
  61. <trim prefix="(" prefixOverrides="or" suffix=")">
  62. <if test="dsUserId != null and dsUserId != ''">
  63. or a.create_by=#{dsUserId}
  64. </if>
  65. <if test="dsDeptId != null and dsDeptId != 0">
  66. or a.dept_id=#{dsDeptId}
  67. </if>
  68. <if test="dsDeptIds != null">
  69. or a.dept_id in
  70. <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
  71. #{item}
  72. </foreach>
  73. </if>
  74. </trim>
  75. </if>
  76. </where>
  77. </select>
  78. <select id="countCamera" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
  79. select count(id) from base_camera_management
  80. <where>
  81. <if test="!dsFlay">
  82. and
  83. <trim prefix="(" prefixOverrides="or" suffix=")">
  84. <if test="dsUserId != null and dsUserId != ''">
  85. or create_by = #{dsUserId}
  86. </if>
  87. <if test="dsDeptId != null and dsDeptId != 0">
  88. or dept_id = #{dsDeptId}
  89. </if>
  90. <if test="dsDeptIds != null">
  91. or dept_id in
  92. <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
  93. #{item}
  94. </foreach>
  95. </if>
  96. </trim>
  97. </if>
  98. </where>
  99. </select>
  100. <select id="getCameraChannelByAlarmId" resultType="java.util.Map">
  101. select b.channel,
  102. b.camera_code as cameraCode,
  103. ma.is_lock as isLock,
  104. ma.released_time as releasedTime,
  105. ma.alarm_time as alarmTime
  106. from msg_alarm ma
  107. left join
  108. base_camera_management b on ma.camera_code = b.camera_code
  109. where ma.alarm_id = #{alarmId}
  110. </select>
  111. </mapper>