lyhzzz 1 year ago
parent
commit
aa088c0595

+ 2 - 0
src/main/java/com/fdkankan/agent/request/CameraParam.java

@@ -22,5 +22,7 @@ public class CameraParam extends RequestBase {
     private Integer incrementStatus;            //权益状态  -1未绑定权益,0生效中,1已过期
     private Integer incrementStatus;            //权益状态  -1未绑定权益,0生效中,1已过期
     private Integer bindStatus;                 //绑定状态  0未绑定,1已绑定
     private Integer bindStatus;                 //绑定状态  0未绑定,1已绑定
 
 
+    private List<Long> cameraIds;
+
 
 
 }
 }

+ 5 - 0
src/main/java/com/fdkankan/agent/service/impl/CameraServiceImpl.java

@@ -42,9 +42,14 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
     public Object pageList(CameraParam param) {
     public Object pageList(CameraParam param) {
         if(param.getIncrementStatus() != null){
         if(param.getIncrementStatus() != null){
             List<Long> cameraIds = userIncrementService.getByAgentId(param);
             List<Long> cameraIds = userIncrementService.getByAgentId(param);
+            param.setCameraIds(cameraIds);
         }
         }
         if(param.getIncrementTypeId() != null){
         if(param.getIncrementTypeId() != null){
             List<Long> cameraIds = userIncrementService.getByAgentId(param);
             List<Long> cameraIds = userIncrementService.getByAgentId(param);
+            param.setCameraIds(cameraIds);
+        }
+        if(param.getCameraIds() != null && param.getCameraIds().isEmpty()){
+            return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
         }
         }
 
 
         Page<CameraDetailVo> voPage = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         Page<CameraDetailVo> voPage = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);

+ 6 - 0
src/main/resources/mapper/agent/CameraMapper.xml

@@ -29,6 +29,12 @@
         <if test="param.bindStatus !=null and param.bindStatus == 1">
         <if test="param.bindStatus !=null and param.bindStatus == 1">
             and d.user_id is not null
             and d.user_id is not null
         </if>
         </if>
+        <if test="param.cameraIds != null">
+            and d.camera_id in
+            <foreach collection="param.cameraIds" item="cameraId" open="(" separator="," close=")">
+                #{cameraId}
+            </foreach>
+        </if>
 
 
         order by d.out_time desc
         order by d.out_time desc
     </select>
     </select>

+ 1 - 1
src/main/resources/mapper/agent/UserIncrementMapper.xml

@@ -19,7 +19,7 @@
         order by ui.create_time desc
         order by ui.create_time desc
     </select>
     </select>
     <select id="getByAgentId" resultType="java.lang.Long">
     <select id="getByAgentId" resultType="java.lang.Long">
-        select  camera_id from  t_user_increment ui left join t_camera_detail d on ui.camera_id = d.camera_id
+        select  ui.camera_id from  t_user_increment ui left join t_camera_detail d on ui.camera_id = d.camera_id
         where ui.rec_status = 'A' and d.rec_status = 'A'
         where ui.rec_status = 'A' and d.rec_status = 'A'
         <if test="param.agentId != null ">
         <if test="param.agentId != null ">
             and d.agent_id = #{param.agentId}
             and d.agent_id = #{param.agentId}