lyhzzz hace 1 año
padre
commit
add36364c1

+ 2 - 0
src/main/java/com/fdkankan/manage_jp/controller/ProjectSceneController.java

@@ -69,10 +69,12 @@ public class ProjectSceneController extends BaseController{
             throw new BusinessException(ResultCode.PARAM_ERROR);
         }
         JSONObject jsonObject = JSONObject.parseObject(deTxt);
+
         SceneGpsParam param = new SceneGpsParam();
         param.setUserId(jsonObject.getLong("userId"));
         param.setCompanyId(jsonObject.getLong("companyId"));
         param.setType(type);
+
         return Result.success(projectSceneGpsService.allSceneGps(param));
     }
 

+ 2 - 1
src/main/java/com/fdkankan/manage_jp/mapper/IProjectSceneGpsMapper.java

@@ -6,6 +6,7 @@ import com.fdkankan.manage_jp.vo.request.SceneGpsParam;
 import com.fdkankan.manage_jp.vo.response.SceneGpsDb;
 import com.fdkankan.manage_jp.vo.response.SceneGpsDbVp;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -22,5 +23,5 @@ public interface IProjectSceneGpsMapper extends BaseMapper<ProjectSceneGps> {
 
     List<SceneGpsDb> getNotGpsScene();
 
-    List<SceneGpsDbVp> listGps(SceneGpsParam param);
+    List<SceneGpsDbVp> listGps( SceneGpsParam param);
 }

+ 18 - 17
src/main/resources/mapper/manage_jp/ProjectSceneGpsMapper.xml

@@ -14,6 +14,7 @@
 
         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
@@ -21,24 +22,24 @@
                 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!='' ">
+        <if test="searchKey != null and searchKey!='' ">
             and s.scene_name like concat ('%',#{searchKey},'%')
         </if>
-        <if test="param.numList !=null and param.numList.size >0">
+        <if test="numList !=null and numList.size >0">
             and  s.num in
-            <foreach collection="param.numList" item="num" open="(" separator="," close=")">
+            <foreach collection="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=")">
+        <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="param.userId !=null and param.companyId !=null and param.cooperateSceneCodes !=null and param.cooperateSceneCodes.size ==0 ">
-            and (co.id = #{param.companyId} or s.user_id = #{param.userId} )
+        <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
@@ -49,24 +50,24 @@
                 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="param.searchKey != null and param.searchKey!='' ">
-            and (s.title like concat ('%',#{param.searchKey},'%') or s.laser_title like concat ('%',#{param.searchKey},'%') )
+        <if test="searchKey != null and searchKey!='' ">
+            and (s.title like concat ('%',#{searchKey},'%') or s.laser_title like concat ('%',#{searchKey},'%') )
         </if>
-        <if test="param.numList !=null and param.numList.size >0">
+        <if test="numList !=null and numList.size >0">
             and  s.num in
-            <foreach collection="param.numList" item="num" open="(" separator="," close=")">
+            <foreach collection="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=")">
+        <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="param.userId !=null and param.companyId !=null and param.cooperateSceneCodes !=null and param.cooperateSceneCodes.size ==0 ">
-            and (co.id = #{param.companyId} or s.user_id = #{param.userId} )
+        <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>