ScenePlusMapper.xml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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="shareScenePageList" resultType="com.fdkankan.manage.vo.response.UserShareSceneVo">
  33. select s.id,s.title,s.num,s.create_time,s.scene_status as status,s.scene_source,e.web_site,e.algorithm_time,ju.ry_no,ju.ry_nick_name
  34. from t_scene_plus s
  35. left join t_scene_plus_ext e on s.id = e.plus_id
  36. left join jy_user ju on s.user_id = ju.user_id
  37. where s.rec_status = 'A'
  38. <if test="param.jyUserId != null">
  39. and s.user_id = #{param.jyUserId}
  40. </if>
  41. <if test="param.numList != null and param.numList.size >0">
  42. and s.num in
  43. <foreach collection="param.numList" item="num" open="(" separator="," close=")">
  44. #{num}
  45. </foreach>
  46. </if>
  47. order by s.create_time desc ,s.id desc
  48. </select>
  49. </mapper>