浏览代码

命令下发

lin 4 年之前
父节点
当前提交
d1ebe5a833

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dao/DeviceCommandTaskMapper.java

@@ -13,5 +13,5 @@ public interface DeviceCommandTaskMapper {
 
     int updateByPrimaryKeySelective(DeviceCommandTask record);
 
-    List<DeviceCommandDto> getList(@Param("siteId") Integer siteId, @Param("deviceNo") String deviceNo, @Param("name") String name, @Param("commandType") Integer commandType, @Param("commandStatus") Integer commandStatus);
+    List<DeviceCommandDto> getList(@Param("siteId") Integer siteId, @Param("customerIds") List<Integer> customerIds, @Param("deviceNo") String deviceNo, @Param("name") String name, @Param("commandType") Integer commandType, @Param("commandStatus") Integer commandStatus);
 }

+ 2 - 3
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/DeviceCommandServiceImpl.java

@@ -35,7 +35,6 @@ import com.bz.smart_city.dao.DeviceCommandMapper;
 import com.bz.smart_city.entity.DeviceCommand;
 
 import java.time.LocalDateTime;
-import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
 
@@ -92,7 +91,7 @@ public class DeviceCommandServiceImpl implements DeviceCommandService {
     public Pagination<DeviceCommandDto> getTaskPage(String deviceNo, String name, Integer commandType, Integer commandStatus, int pageNum, int pageSize) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         PageHelper.startPage(pageNum,pageSize);
-        List<DeviceCommandDto> list = deviceCommandTaskMapper.getList(loginUser.getSiteId(),deviceNo,name,commandType,commandStatus);
+        List<DeviceCommandDto> list = deviceCommandTaskMapper.getList(loginUser.getSiteId(),UserUtil.getCustomerIds(),deviceNo,name,commandType,commandStatus);
         return new Pagination<>(list);
     }
 
@@ -112,7 +111,7 @@ public class DeviceCommandServiceImpl implements DeviceCommandService {
     @Override
     public void getExcel(String deviceNo, String name, Integer commandType, Integer commandStatus, HttpServletResponse httpServletResponse) {
         LoginUser loginUser = UserUtil.getCurrentUser();
-        List<DeviceCommandDto> list = deviceCommandTaskMapper.getList(loginUser.getSiteId(),deviceNo,name,commandType,commandStatus);
+        List<DeviceCommandDto> list = deviceCommandTaskMapper.getList(loginUser.getSiteId(), UserUtil.getCustomerIds(), deviceNo,name,commandType,commandStatus);
 
         String title = "批量指令下发";
         String[] rowsName = new String[]{"序号", "设备编号", "设备型号", "任务名称", "指令类型", "指令状态", "下发时间", "完成时间"};

+ 3 - 0
smart-city-platform/src/main/resources/mapper/DeviceCommandTaskMapper.xml

@@ -113,6 +113,9 @@
     <if test="name != null and name != ''"> AND ct.name LIKE concat('%',#{name},'%')</if>
     <if test="commandType != null"> and c.command_type = #{commandType}</if>
     <if test="commandStatus != null"> and c.command_status = #{commandStatus}</if>
+    <if test="customerIds != null and customerIds.size() != 0">
+      and sd.customer_id in <foreach collection="customerIds" item="item" open="(" separator="," close=")">#{item}</foreach>
+    </if>
     order by ct.date_create desc
   </select>
 </mapper>