lyhzzz 1 year ago
parent
commit
280b94ee10

+ 1 - 1
src/main/java/com/fdkankan/manage/controller/OverallController.java

@@ -78,7 +78,7 @@ public class OverallController {
         if(StringUtils.isNotBlank(param.getUserName())){
         if(StringUtils.isNotBlank(param.getUserName())){
             List<User> userList = userService.getLikeByUserName(param.getUserName());
             List<User> userList = userService.getLikeByUserName(param.getUserName());
             List<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toList());
             List<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toList());
-            List<ScenePlus> scenePluses = scenePlusService.getByUserIds(userIds);
+            List<ScenePlus> scenePluses = scenePlusService.getByUserIdsAndLocation(userIds,7);
             if(scenePluses.isEmpty()){
             if(scenePluses.isEmpty()){
                 return ResultData.ok(new PageInfo<>(param.getPageNum(), param.getPageSize(), 0, new ArrayList()));
                 return ResultData.ok(new PageInfo<>(param.getPageNum(), param.getPageSize(), 0, new ArrayList()));
             }
             }

+ 2 - 0
src/main/java/com/fdkankan/manage/mapper/IScenePlusMapper.java

@@ -25,4 +25,6 @@ public interface IScenePlusMapper extends BaseMapper<ScenePlus> {
     List<GroupByCount> getCountGroupByCameraId(@Param("cameraIds") List<Long> cameraIds);
     List<GroupByCount> getCountGroupByCameraId(@Param("cameraIds") List<Long> cameraIds);
 
 
     Long getSpaceSumByCameraId(@Param("cameraId") Long cameraId);
     Long getSpaceSumByCameraId(@Param("cameraId") Long cameraId);
+
+    List<ScenePlus> getByUserIdsAndLocation(@Param("userIds")List<Long> userIds, @Param("location")Integer location);
 }
 }

+ 2 - 0
src/main/java/com/fdkankan/manage/service/IScenePlusService.java

@@ -37,4 +37,6 @@ public interface IScenePlusService extends IService<ScenePlus> {
     List<ScenePlus> getByNumList(List<String> numList);
     List<ScenePlus> getByNumList(List<String> numList);
 
 
     List<ScenePlus> getByUserIds(List<Long> userIds);
     List<ScenePlus> getByUserIds(List<Long> userIds);
+
+    List<ScenePlus> getByUserIdsAndLocation(List<Long> userIds, Integer location);
 }
 }

+ 8 - 0
src/main/java/com/fdkankan/manage/service/impl/ScenePlusServiceImpl.java

@@ -125,4 +125,12 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
         wrapper.in(ScenePlus::getUserId,userIds);
         wrapper.in(ScenePlus::getUserId,userIds);
         return this.list(wrapper);
         return this.list(wrapper);
     }
     }
+
+    @Override
+    public List<ScenePlus> getByUserIdsAndLocation(List<Long> userIds, Integer location) {
+        if(userIds.isEmpty()){
+            return new ArrayList<>();
+        }
+        return this.getBaseMapper().getByUserIdsAndLocation(userIds,location);
+    }
 }
 }

+ 8 - 0
src/main/resources/mapper/manage/ScenePlusMapper.xml

@@ -34,4 +34,12 @@
     <select id="getSpaceSumByCameraId" resultType="java.lang.Long">
     <select id="getSpaceSumByCameraId" resultType="java.lang.Long">
         select  sum(space) from  t_scene_plus p left join t_scene_plus_ext e on p.id = e.plus_id where p.rec_status = 'A' and p.scene_status = -2 and p.camera_id = #{cameraId}
         select  sum(space) from  t_scene_plus p left join t_scene_plus_ext e on p.id = e.plus_id where p.rec_status = 'A' and p.scene_status = -2 and p.camera_id = #{cameraId}
     </select>
     </select>
+    <select id="getByUserIdsAndLocation" resultType="com.fdkankan.manage.entity.ScenePlus">
+        select s.* from t_scene_plus s left join  t_scene_plus_ext e on s.id = e.plus_id where s.rec_status = 'A' and e.location = 7
+                                                                                           and s.user_id in
+            <foreach collection="userIds" item="userId" open="(" separator="," close=")">
+                #{userId}
+            </foreach>
+
+    </select>
 </mapper>
 </mapper>