ProjectSceneGpsMapper.xml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 s.num,s.scene_source,s.web_site,s.gps,s.data_source ,'v3' as scene_version FROM t_scene_pro s
  6. LEFT JOIN t_project_scene_gps gps on s.num = gps.num
  7. WHERE s.rec_status = 'A' and is_upgrade = 0 and s.gps is not null and s.`status` = -2 and gps.num is null
  8. UNION
  9. SELECT s.num,s.scene_source,e.web_site,e.gps,e.data_source ,'v4' as scene_version FROM t_scene_plus s
  10. LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
  11. LEFT JOIN t_project_scene_gps gps on s.num = gps.num
  12. WHERE s.rec_status = 'A' and e.gps is not null and s.scene_status = -2 and gps.num is null
  13. LIMIT 1000
  14. </select>
  15. <select id="listGps" resultType="com.fdkankan.manage_jp.vo.response.SceneGpsDbVp">
  16. SELECT s.num,s.scene_name as title,null as laserTile,s.scene_source,'v3' as scene_version ,gps.lat,gps.lon,gps.alt,gps.web_site
  17. FROM t_scene_pro s
  18. LEFT JOIN t_project_scene_gps gps on s.num = gps.num
  19. LEFT JOIN t_user u on s.user_id = u.id
  20. LEFT JOIN t_company co on u.company_id = co.id
  21. WHERE s.rec_status = 'A' and is_upgrade = 0 and s.`status` = -2 and gps.num is not null
  22. <if test="param.searchKey != null and param.searchKey!='' ">
  23. and s.scene_name like concat ('%',#{param.searchKey},'%')
  24. </if>
  25. <if test="param.numList !=null and param.numList.size >0">
  26. and s.num in
  27. <foreach collection="param.numList" item="num" open="(" separator="," close=")">
  28. #{num}
  29. </foreach>
  30. </if>
  31. <if test="param.userId !=null and param.companyId !=null and param.cooperateSceneCodes !=null and param.cooperateSceneCodes.size >0">
  32. and ( s.user_id = #{param.userId} or co.id = #{param.companyId} or s.num in
  33. <foreach collection="param.cooperateSceneCodes" item="coNum" open="(" separator="," close=")">
  34. #{coNum}
  35. </foreach>
  36. )
  37. </if>
  38. <if test="userId !=null and companyId !=null and cooperateSceneCodes !=null and cooperateSceneCodes.size ==0 ">
  39. and (co.id = #{companyId} or s.user_id = #{userId} )
  40. </if>
  41. UNION
  42. SELECT s.num,s.title ,s.laser_title,s.scene_source,'v4' as scene_version ,gps.lat,gps.lon,gps.alt,gps.web_site
  43. FROM t_scene_plus s
  44. LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
  45. LEFT JOIN t_project_scene_gps gps on s.num = gps.num
  46. LEFT JOIN t_user u on s.user_id = u.id
  47. LEFT JOIN t_company co on u.company_id = co.id
  48. WHERE s.rec_status = 'A' and s.scene_status = -2 and gps.num is not null
  49. <if test="searchKey != null and searchKey!='' ">
  50. and (s.title like concat ('%',#{searchKey},'%') or s.laser_title like concat ('%',#{searchKey},'%') )
  51. </if>
  52. <if test="numList !=null and numList.size >0">
  53. and s.num in
  54. <foreach collection="numList" item="num" open="(" separator="," close=")">
  55. #{num}
  56. </foreach>
  57. </if>
  58. <if test="userId !=null and companyId !=null and cooperateSceneCodes !=null and cooperateSceneCodes.size >0">
  59. and ( s.user_id = #{userId} or co.id = #{companyId} or s.num in
  60. <foreach collection="cooperateSceneCodes" item="coNum" open="(" separator="," close=")">
  61. #{coNum}
  62. </foreach>
  63. )
  64. </if>
  65. <if test="userId !=null and companyId !=null and cooperateSceneCodes !=null and cooperateSceneCodes.size ==0 ">
  66. and (co.id = #{companyId} or s.user_id = #{userId} )
  67. </if>
  68. </select>
  69. </mapper>