BaseCameraManagementMapper.xml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.BaseCameraManagementMapper">
  4. <select id="selectCameraManagementList" resultType="com.ozs.entity.BaseCameraManagement" parameterType="com.ozs.entity.vo.BaseCameraManagementVo">
  5. SELECT * FROM base_camera_management
  6. <where>
  7. <if test="railwayCode != null and railwayCode != ''">
  8. and railway_code = #{railwayCode}
  9. </if>
  10. <if test="lineDir != null and lineDir != 0">
  11. and line_dir = #{lineDir}
  12. </if>
  13. <if test="deptId != null and deptId != 0">
  14. and dept_id = #{deptId}
  15. </if>
  16. <if test="beginMile != null and beginMile != 0">
  17. and begin_mile &gt;= #{beginMile}
  18. </if>
  19. <if test="endMile != null and endMile != 0">
  20. and end_mile &lt;= #{endMile}
  21. </if>
  22. <if test="online != null and online != 0">
  23. and online = #{online}
  24. </if>
  25. <if test="enableOrNot != null and enableOrNot != 0">
  26. and ENABLE_OR_NOT = #{enableOrNot}
  27. </if>
  28. <if test="ids != null and ids.size>0">
  29. and id in
  30. <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
  31. #{items}
  32. </foreach>
  33. </if>
  34. </where>
  35. </select>
  36. <select id="countCamera" parameterType="com.ozs.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
  37. select count(id) from base_camera_management
  38. </select>
  39. <select id="getMessageStatisticsCamera" resultType="java.util.Map">
  40. select count(id) countAllCamera,
  41. SUM(CASE online WHEN '2' THEN 1 ELSE 0 end) AS offlineCamera,
  42. SUM(CASE online WHEN '1' THEN 1 ELSE 0 end) AS onlineCamera
  43. from base_camera_management
  44. </select>
  45. <select id="selectSkynetHeartbeatLogByCameraCode" resultType="com.ozs.entity.SkynetHeartbeatLog" parameterType="java.lang.String">
  46. select /*+ GROUP_OPT_FLAG(1)*/ id, camera_code, max(create_time) as createTime from skynet_heartbeat_log where camera_code = #{cameraCode}
  47. </select>
  48. </mapper>