ScenePlusMapper.xml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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.fdkankan.manage.mapper.IScenePlusMapper">
  4. <select id="getCountGroupByUserId" resultType="com.fdkankan.manage.vo.response.GroupByCount" >
  5. SELECT user_id as id, count(p.id) as count FROM t_scene_plus p
  6. <if test="isObj != null and isObj == 1">
  7. left join t_scene_plus_ext e on p.id = e.plus_id
  8. </if>
  9. WHERE p.rec_status = 'A'
  10. and p.user_id in
  11. <foreach item="userId" collection="userIdList" open="(" separator="," close=")">
  12. #{userId}
  13. </foreach>
  14. <if test="isObj != null and isObj == 0">
  15. and p.scene_source in (1,2,3,12,13,14)
  16. </if>
  17. <if test="isObj != null and isObj == 1">
  18. and e.is_obj = 1
  19. and p.scene_source = 4
  20. </if>
  21. GROUP BY p.user_id
  22. </select>
  23. <select id="getCountGroupByCameraId" resultType="com.fdkankan.manage.vo.response.GroupByCount">
  24. SELECT camera_id as id,count(id) as count FROM t_scene_plus WHERE rec_status = 'A' AND camera_id is not null
  25. and scene_source in (1,2,3,12,13,14)
  26. and camera_id in
  27. <foreach item="cameraId" collection="cameraIds" open="(" separator="," close=")">
  28. #{cameraId}
  29. </foreach>
  30. GROUP BY camera_id
  31. </select>
  32. <select id="getSpaceSumByCameraId" resultType="java.lang.Long">
  33. select sum(space) from t_scene_plus p left join t_scene_plus_ext e on p.id = e.plus_id where p.rec_status = 'A' and p.camera_id = #{cameraId}
  34. </select>
  35. </mapper>