ProjectSceneGpsMapper.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_jp.mapper.IProjectSceneGpsMapper">
  4. <select id="getNotGpsScene" resultType="com.fdkankan.manage_jp.vo.response.SceneGpsDb">
  5. SELECT DISTINCT s.num,s.scene_source,e.web_site,e.gps,e.data_source ,'v4' as scene_version
  6. FROM t_scene_plus s
  7. LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
  8. LEFT JOIN t_project_scene_gps gps on s.num = gps.num
  9. WHERE s.rec_status = 'A'and s.scene_status = -2 and s.scene_source in (4,5) and s.pay_status = 1 and gps.num is null
  10. </select>
  11. <select id="listGps" resultType="com.fdkankan.manage_jp.vo.response.SceneGpsDbVp">
  12. SELECT DISTINCT s.num,s.title ,s.laser_title,s.scene_source,'v4' as scene_version ,gps.lat,gps.lon,gps.alt,gps.web_site,c.sn_code
  13. FROM t_project_scene_gps gps
  14. LEFT JOIN t_scene_plus s on gps.num = s.num
  15. LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
  16. LEFT JOIN t_camera c on s.camera_id = c.id
  17. LEFT JOIN t_user u on s.user_id = u.id
  18. LEFT JOIN t_company co on u.company_id = co.id
  19. WHERE s.rec_status = 'A' and s.scene_status = -2 and s.pay_status = 1 and s.map_show = 1 and s.num is not null and gps.gps_source = 2
  20. <if test="param.searchKey != null and param.searchKey!='' ">
  21. and (s.title like concat ('%',#{param.searchKey},'%') or s.laser_title like concat ('%',#{param.searchKey},'%') or s.num = #{param.searchKey})
  22. </if>
  23. <if test="param.numList !=null and param.numList.size >0">
  24. and s.num in
  25. <foreach collection="param.numList" item="num" open="(" separator="," close=")">
  26. #{num}
  27. </foreach>
  28. </if>
  29. <if test="param.userId !=null and param.companyId !=null and param.cooperateSceneCodes !=null and param.cooperateSceneCodes.size >0">
  30. and ( s.user_id = #{param.userId} or co.id = #{param.companyId} or s.num in
  31. <foreach collection="param.cooperateSceneCodes" item="coNum" open="(" separator="," close=")">
  32. #{coNum}
  33. </foreach>
  34. )
  35. </if>
  36. <if test="param.userId !=null and param.companyId !=null and param.cooperateSceneCodes !=null and param.cooperateSceneCodes.size ==0 ">
  37. and (co.id = #{param.companyId} or s.user_id = #{param.userId} )
  38. </if>
  39. order by s.create_time desc
  40. </select>
  41. </mapper>