1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.fdkankan.manage_jp.mapper.IProjectSceneGpsMapper">
- <select id="getNotGpsScene" resultType="com.fdkankan.manage_jp.vo.response.SceneGpsDb">
- SELECT s.num,s.scene_source,s.web_site,s.gps,s.data_source ,'v3' as scene_version FROM t_scene_pro s
- LEFT JOIN t_project_scene_gps gps on s.num = gps.num
- WHERE s.rec_status = 'A' and is_upgrade = 0 and s.gps is not null and s.`status` = -2 and gps.num is null
- UNION
- SELECT s.num,s.scene_source,e.web_site,e.gps,e.data_source ,'v4' as scene_version FROM t_scene_plus s
- LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
- LEFT JOIN t_project_scene_gps gps on s.num = gps.num
- WHERE s.rec_status = 'A' and e.gps is not null and s.scene_status = -2 and gps.num is null
- LIMIT 1000
- </select>
-
- <select id="listGps" resultType="com.fdkankan.manage_jp.vo.response.SceneGpsDbVp">
- 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
- FROM t_scene_pro s
- LEFT JOIN t_project_scene_gps gps on s.num = gps.num
- LEFT JOIN t_user u on s.user_id = u.id
- LEFT JOIN t_company co on u.company_id = co.id
- WHERE s.rec_status = 'A' and is_upgrade = 0 and s.`status` = -2 and gps.num is not null
- <if test="param.searchKey != null and param.searchKey!='' ">
- and s.scene_name like concat ('%',#{param.searchKey},'%')
- </if>
- <if test="param.numList !=null and param.numList.size >0">
- and s.num in
- <foreach collection="param.numList" item="num" open="(" separator="," close=")">
- #{num}
- </foreach>
- </if>
- <if test="param.userId !=null and param.companyId !=null and param.cooperateSceneCodes !=null and param.cooperateSceneCodes.size >0">
- and ( s.user_id = #{param.userId} or co.id = #{param.companyId} or s.num in
- <foreach collection="param.cooperateSceneCodes" item="coNum" open="(" separator="," close=")">
- #{coNum}
- </foreach>
- )
- </if>
- <if test="userId !=null and companyId !=null and cooperateSceneCodes !=null and cooperateSceneCodes.size ==0 ">
- and (co.id = #{companyId} or s.user_id = #{userId} )
- </if>
- UNION
- SELECT s.num,s.title ,s.laser_title,s.scene_source,'v4' as scene_version ,gps.lat,gps.lon,gps.alt,gps.web_site
- FROM t_scene_plus s
- LEFT JOIN t_scene_plus_ext e on s.id = e.plus_id
- LEFT JOIN t_project_scene_gps gps on s.num = gps.num
- LEFT JOIN t_user u on s.user_id = u.id
- LEFT JOIN t_company co on u.company_id = co.id
- WHERE s.rec_status = 'A' and s.scene_status = -2 and gps.num is not null
- <if test="searchKey != null and searchKey!='' ">
- and (s.title like concat ('%',#{searchKey},'%') or s.laser_title like concat ('%',#{searchKey},'%') )
- </if>
- <if test="numList !=null and numList.size >0">
- and s.num in
- <foreach collection="numList" item="num" open="(" separator="," close=")">
- #{num}
- </foreach>
- </if>
- <if test="userId !=null and companyId !=null and cooperateSceneCodes !=null and cooperateSceneCodes.size >0">
- and ( s.user_id = #{userId} or co.id = #{companyId} or s.num in
- <foreach collection="cooperateSceneCodes" item="coNum" open="(" separator="," close=")">
- #{coNum}
- </foreach>
- )
- </if>
- <if test="userId !=null and companyId !=null and cooperateSceneCodes !=null and cooperateSceneCodes.size ==0 ">
- and (co.id = #{companyId} or s.user_id = #{userId} )
- </if>
- </select>
- </mapper>
|