Parcourir la source

灯带列表、灯带分组、操作日志、智能门锁、照明列表的数据导出excel

zhj il y a 2 ans
Parent
commit
974158997a

+ 64 - 5
src/main/java/com/welampiot/controller/LightStripController.java

@@ -6,6 +6,7 @@ import com.welampiot.dto.LightStripDevDTO;
 import com.welampiot.dto.LightStripDevLogDTO;
 import com.welampiot.service.LightStripDevLogService;
 import com.welampiot.service.LightStripDevService;
+import com.welampiot.utils.ExcelUtil;
 import com.welampiot.utils.ToolUtils;
 import com.welampiot.vo.LightStripDevLogVO;
 import com.welampiot.vo.LightStripDevVO;
@@ -63,21 +64,79 @@ public class LightStripController {
      */
     @RequestMapping(value = "/getList", method = RequestMethod.POST)
     public BaseResult getList(HttpServletRequest request){
-        int version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        Integer download = (Integer) toolUtils.getRequestContent(request,"download",1);
         int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
         int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
         int online = (Integer) toolUtils.getRequestContent(request,"online",1);
         String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
 
         LightStripDevDTO dto = new LightStripDevDTO();
-        dto.setPage(count * (page - 1));
-        dto.setCount(count);
         dto.setVersion(version);
         dto.setKeyword(keyword);
         dto.setOnlineState(online);
+        dto.setAreaId(areaId);
+        dto.setSectionId(sectionId);
         dto.setSectionList(toolUtils.getSectionList(request));
-
-        LightStripDevVO vo = lightStripDevService.getLightStripListByDTO(dto);
+        LightStripDevVO vo;
+        if (download == 1) {
+            vo = lightStripDevService.getLightStripListByDTO(dto);
+            String title;
+            if (version == 0) {
+                title = "编号,名称,灯杆名称,型号,颜色,在线状态,亮灯状态,串口,设备地址,区域,路段,创建时间,更新时间";
+            } else if (version == 1) {
+                title = "Number,Name,Light Pole Name,Model,Color,Online Status,Light On Status," +
+                        "Serial Port,Device Address,Area,Section,Creation Time,Update Time";
+            } else {
+                title = "Номер,имя,название фонаря,модель,цвет,состояние онлайн,состояние света," +
+                        "последовательный адрес устройства,область,участок,время создания,время обновления";
+            }
+            List<String> titleList = Arrays.asList(title.split(","));
+            List<List<String>> contentList = new ArrayList<>();
+            for (LightStripDevDTO l : vo.getList()) {
+                List<String> newString = new ArrayList<>();
+                newString.add(0,l.getNumber());
+                newString.add(1,l.getName());
+                newString.add(2,l.getLampPoleName());
+                if (l.getModel() == 1) {
+                    newString.add(3,"WE-CON-RGB30");
+                } else {
+                    newString.add(3,"WE-RGB-R10");
+                }
+                newString.add(4,l.getColor());
+                if (l.getOnline() == 1) {
+                    newString.add(5,"在线");
+                } else {
+                    newString.add(5,"离线");
+                }
+                if (l.getStatus() == 1) {
+                    newString.add(6,"开");
+                } else {
+                    newString.add(6,"关");
+                }
+                if (l.getSerialPort() == 2) {
+                    newString.add(7,"1号串口");
+                } else if (l.getSerialPort() == 1) {
+                    newString.add(7,"2号串口");
+                } else {
+                    newString.add(7,"3号串口");
+                }
+                newString.add(8,l.getAddress());
+                newString.add(9,l.getArea());
+                newString.add(10,l.getSection());
+                newString.add(11,l.getCreateTime());
+                newString.add(12,l.getUpdateTime());
+                contentList.add(vo.getList().indexOf(l),newString);
+            }
+            String path = ExcelUtil.outExcel(titleList, contentList);
+            vo.setPath(path);
+        } else {
+            dto.setPage(count * (page - 1));
+            dto.setCount(count);
+            vo = lightStripDevService.getLightStripListByDTO(dto);
+        }
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
     }
 

+ 40 - 6
src/main/java/com/welampiot/controller/LightStripGroupController.java

@@ -4,6 +4,7 @@ import com.welampiot.common.BaseResult;
 import com.welampiot.common.InterfaceResultEnum;
 import com.welampiot.dto.LightStripGroupDTO;
 import com.welampiot.service.LightStripGroupService;
+import com.welampiot.utils.ExcelUtil;
 import com.welampiot.utils.ToolUtils;
 import com.welampiot.vo.LightStripGroupDetailVO;
 import com.welampiot.vo.LightStripGroupVO;
@@ -14,6 +15,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * ClassName: LightStripGroupController
@@ -40,20 +44,50 @@ public class LightStripGroupController {
      * @return
      */
     @RequestMapping(value = "/getList", method = RequestMethod.POST)
-    public BaseResult getList(HttpServletRequest request){
-        int version = (Integer) toolUtils.getRequestContent(request,"version",1);
+    public BaseResult<?> getList(HttpServletRequest request){
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        Integer download = (Integer) toolUtils.getRequestContent(request,"download",1);
         int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
         int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
         String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
 
         LightStripGroupDTO dto = new LightStripGroupDTO();
-        dto.setPage(count * (page - 1));
-        dto.setCount(count);
         dto.setVersion(version);
         dto.setKeyword(keyword);
+        dto.setAreaId(areaId);
+        dto.setSectionId(sectionId);
         dto.setSectionList(toolUtils.getSectionList(request));
-
-        LightStripGroupVO vo = lightStripGroupService.getLightStripGroupByDTO(dto);
+        LightStripGroupVO vo;
+        if (download == 1) {
+            vo = lightStripGroupService.getLightStripGroupByDTO(dto);
+            String title;
+            if (version == 0) {
+                title = "分组名称,区/县,街道,路灯数,策略方案";
+            } else if (version == 1) {
+                title = "Group Name,District/County,Street,Number of Street Lights,Strategy Plan";
+            } else {
+                title = "Групповые имена,районы/округа,улицы,уличные фонари,стратегические программы";
+            }
+            List<String> titleList = Arrays.asList(title.split(","));
+            List<List<String>> contentList = new ArrayList<>();
+            for (LightStripGroupDTO l : vo.getList()) {
+                List<String> newString = new ArrayList<>();
+                newString.add(0,l.getName());
+                newString.add(1,l.getArea());
+                newString.add(2,l.getSection());
+                newString.add(3,l.getLightCount().toString());
+                newString.add(4,l.getPolicyName());
+                contentList.add(vo.getList().indexOf(l),newString);
+            }
+            String path = ExcelUtil.outExcel(titleList, contentList);
+            vo.setPath(path);
+        } else {
+            dto.setPage(count * (page - 1));
+            dto.setCount(count);
+            vo = lightStripGroupService.getLightStripGroupByDTO(dto);
+        }
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
     }
 

+ 121 - 9
src/main/java/com/welampiot/controller/NewLampPoleController.java

@@ -560,23 +560,90 @@ public class NewLampPoleController {
      * @return
      */
     @RequestMapping(value = "/logList", method = RequestMethod.POST)
-    public BaseResult<OperationLogDTO> logList(HttpServletRequest request){
+    public BaseResult<?> logList(HttpServletRequest request){
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer download = (Integer) toolUtils.getRequestContent(request,"download",1);
+        Integer operaType = (Integer) toolUtils.getRequestContent(request,"operaType",1);
+        Integer devType = (Integer) toolUtils.getRequestContent(request,"devType",1);
         String keyword = request.getParameter("keyword") == null ? "" : request.getParameter("keyword");
         String username = request.getParameter("username") == null ? "" : request.getParameter("username");
         int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
         int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
-        int operaType = request.getParameter("operaType") == null ? 0 : Integer.parseInt(request.getParameter("operaType"));
-        int devType = request.getParameter("devType") == null ? 0 : Integer.parseInt(request.getParameter("devType"));
 
         OperationLogVO vo = new OperationLogVO();
         vo.setKeyword(keyword);
-        vo.setOffset(count * (page - 1));
-        vo.setLimit(count);
         vo.setOperaType(operaType);
         vo.setDevType(devType);
         vo.setUsername(username);
-        OperationLogVO logVO = operationLogService.getLogListByVO(vo);
-        return BaseResult.success(logVO);
+        OperationLogVO logVO;
+        if (download == 1) {
+            logVO = operationLogService.getLogListByVO(vo);
+            String title;
+            if (version == 0) {
+                title = "序号,操作者,所属单位,日志类型,操作时间,区域,路段,设备类型,所属设备名称,所属设备SN,描述";
+            } else if (version == 1) {
+                title = "Serial Number,Operator,Unit,Log Type,Operation Time,Region,Section,Device Type," +
+                        "Device Name,Device SN,Description";
+            } else {
+                title = "Порядковые номера,оператор,принадлежность,тип журнала,время работы,область," +
+                        "участок дороги,тип оборудования,название оборудования,описание устройства";
+            }
+            List<String> titleList = Arrays.asList(title.split(","));
+            List<List<String>> contentList = new ArrayList<>();
+            for (OperationLogDTO o : logVO.getList()) {
+                List<String> newString = new ArrayList<>();
+                newString.add(0, String.valueOf(logVO.getList().indexOf(o) + 1));
+                newString.add(1,o.getAcount());
+                newString.add(2,o.getCompany());
+                switch (o.getOperaType()) {
+                    case "5":
+                        newString.add(3, "退出登录");
+                        break;
+                    case "4":
+                        newString.add(3, "指令");
+                        break;
+                    case "3":
+                        newString.add(3, "编辑");
+                        break;
+                    case "2":
+                        newString.add(3, "删除");
+                        break;
+                    case "1":
+                        newString.add(3, "添加");
+                        break;
+                    default:
+                        newString.add(3, "登录");
+                        break;
+                }
+                newString.add(4,o.getUpdateTime());
+                newString.add(5,o.getArea());
+                newString.add(6,o.getSection());
+                if (o.getDevType() == 1) {
+                    newString.add(7,"路灯");
+                } else if (o.getDevType() == 2) {
+                    newString.add(7,"灯杆");
+                } else if (o.getDevType() == 3) {
+                    newString.add(7,"回路");
+                } else if (o.getDevType() == 4) {
+                    newString.add(7,"井盖");
+                } else if (o.getDevType() == 5) {
+                    newString.add(7,"垃圾桶");
+                } else {
+                    newString.add(7,"非设备");
+                }
+                newString.add(8,o.getDeviceName());
+                newString.add(9,o.getSn());
+                newString.add(10,o.getRemark());
+                contentList.add(logVO.getList().indexOf(o),newString);
+            }
+            String path = ExcelUtil.outExcel(titleList, contentList);
+            logVO.setPath(path);
+        } else {
+            vo.setOffset(count * (page - 1));
+            vo.setLimit(count);
+            logVO = operationLogService.getLogListByVO(vo);
+        }
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,logVO);
     }
 
     /**
@@ -863,6 +930,7 @@ public class NewLampPoleController {
         Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
         Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
         Integer online = (Integer) toolUtils.getRequestContent(request,"online",1);
+        Integer download = (Integer) toolUtils.getRequestContent(request,"download",1);
         String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
         int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
         int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
@@ -873,9 +941,11 @@ public class NewLampPoleController {
         lampVO.setAreaId(areaId);
         lampVO.setSectionId(sectionId);
         lampVO.setKeyword(keyword);
-        lampVO.setPage(page);
-        lampVO.setCount(count);
         lampVO.setSectionList(toolUtils.getSectionList(request));
+        if (download == 0) {
+            lampVO.setPage(count * (page - 1));
+            lampVO.setCount(count);
+        }
         List<LampInfoDTO> lampList = lampService.getLampList(lampVO);
         List<LampInfoDTO> list = new ArrayList<>();
         lampList.forEach(dto -> {
@@ -900,6 +970,48 @@ public class NewLampPoleController {
         LampVO lampVO1 = new LampVO();
         lampVO1.setList(list);
         lampVO1.setTotal(lampTotal);
+        if (download == 1) {
+            String title;
+            if (version == 0) {
+                title = "序号,路灯编号,名称,网络状态,亮度,电压(V),电流(A),功率(W),亮灯时长(HH:mm),当前策略,无线模块地址,终端时间,更新时间";
+            } else if (version == 1) {
+                title = "Serial Number,Street Number,Name,Network Status,Brightness,Voltage(V),Current(A),Power(W)," +
+                        "The lights on Time(HH: mm),The Current Strategy,Wireless Module Address,Terminal Time,Update Time";
+            } else {
+                title = "Серийн номер,уличн освещен номер,назван,интернет состоян,яркост,напряжен(V),ток(а)," +
+                        "Мощность(W),мощност выключ свет продолжительн(HH: мм),текущ стратег,беспроводн модул адрес," +
+                        "термина врем,обновля врем";
+            }
+            List<String> titleList = Arrays.asList(title.split(","));
+            List<List<String>> contentList = new ArrayList<>();
+            for (LampInfoDTO l : list) {
+                List<String> newString = new ArrayList<>();
+                newString.add(0, String.valueOf(list.indexOf(l) + 1));
+                newString.add(1,l.getNumber());
+                newString.add(2,l.getName());
+                if (l.getStatus() != null && l.getStatus() == 1) {
+                    newString.add(3,"在线");
+                } else {
+                    newString.add(3,"离线");
+                }
+                newString.add(4,String.valueOf(l.getLighteness()));
+                newString.add(5, l.getVoltage());
+                newString.add(6,l.getCurrent());
+                newString.add(7,l.getPower());
+                if (l.getLightTime() == null) {
+                    newString.add(8,"0");
+                } else {
+                    newString.add(8,l.getLightTime().toString());
+                }
+                newString.add(9,l.getPolicyName());
+                newString.add(10,l.getAddress());
+                newString.add(11,l.getServerTime());
+                newString.add(12,l.getUpdateTime());
+                contentList.add(list.indexOf(l),newString);
+            }
+            String path = ExcelUtil.outExcel(titleList, contentList);
+            lampVO1.setPath(path);
+        }
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampVO1);
     }
 

+ 60 - 7
src/main/java/com/welampiot/controller/SmartLockController.java

@@ -4,6 +4,7 @@ import com.welampiot.common.BaseResult;
 import com.welampiot.common.InterfaceResultEnum;
 import com.welampiot.dto.SmartLockDevInfoDTO;
 import com.welampiot.service.SmartLockDevInfoService;
+import com.welampiot.utils.ExcelUtil;
 import com.welampiot.utils.ToolUtils;
 import com.welampiot.vo.SmartLockDevInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +14,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * ClassName: SmartLockController
@@ -35,26 +39,75 @@ public class SmartLockController {
 
     /**
      * 获取智能门锁列表
-     * @param request
-     * @return
+     * @param request 分页
+     * @return 智能门锁列表
      */
     @RequestMapping(value = "/getList", method = RequestMethod.POST)
-    public BaseResult getList(HttpServletRequest request){
+    public BaseResult<?> getList(HttpServletRequest request){
         Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
         Integer online = (Integer) toolUtils.getRequestContent(request,"online",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        Integer download = (Integer) toolUtils.getRequestContent(request,"download",1);
         String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
         int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
         int count = request.getParameter("count") == null ? 1 : Integer.parseInt(request.getParameter("count"));
 
         SmartLockDevInfoDTO dto = new SmartLockDevInfoDTO();
         dto.setOnlineState(online);
-        dto.setPage(count * (page - 1));
-        dto.setCount(count);
         dto.setVersion(version);
         dto.setKeyword(keyword);
+        dto.setAreaId(areaId);
+        dto.setSectionId(sectionId);
         dto.setSectionList(toolUtils.getSectionList(request));
-
-        SmartLockDevInfoVO vo = smartLockDevInfoService.getListBySmartLockDevInfoDTO(dto);
+        SmartLockDevInfoVO vo;
+        if (download == 1) {
+            vo = smartLockDevInfoService.getListBySmartLockDevInfoDTO(dto);
+            String title;
+            if (version == 0) {
+                title = "序号,设备编号,网络状态,设备名称,型号,灯杆名称,更新时间,门锁状态";
+            } else if (version == 1) {
+                title = "Serial Number,Device Number,Network Status,Device Name," +
+                        "Model,Light Pole Name,Update Time,Lock Status";
+            } else {
+                title = "Серийный номер,номер устройства,состояние сети,название устройства," +
+                        "модель,название фонаря,время обновления,статус замка";
+            }
+            List<String> titleList = Arrays.asList(title.split(","));
+            List<List<String>> contentList = new ArrayList<>();
+            for (SmartLockDevInfoDTO s : vo.getList()) {
+                List<String> newString = new ArrayList<>();
+                newString.add(0, String.valueOf(vo.getList().indexOf(s) + 1));
+                newString.add(1,s.getNumber());
+                if (s.getOnline() == 1) {
+                    newString.add(2,"在线");
+                } else {
+                    newString.add(2,"离线");
+                }
+                newString.add(3,s.getName());
+                if (s.getModel() == 2) {
+                    newString.add(4,"GSNi-3");
+                } else if (s.getModel() == 1) {
+                    newString.add(4,"R-JGS869");
+                } else {
+                    newString.add(4,"DS899");
+                }
+                newString.add(5,s.getLampPoleName());
+                newString.add(6,s.getUpdateTime());
+                if (s.getStatus() == 1) {
+                    newString.add(7,"开锁");
+                } else {
+                    newString.add(7,"闭锁");
+                }
+                contentList.add(vo.getList().indexOf(s),newString);
+            }
+            String path = ExcelUtil.outExcel(titleList, contentList);
+            vo.setPath(path);
+        } else {
+            dto.setPage(count * (page - 1));
+            dto.setCount(count);
+            vo = smartLockDevInfoService.getListBySmartLockDevInfoDTO(dto);
+        }
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
     }
 }

+ 9 - 9
src/main/java/com/welampiot/dto/LampInfoDTO.java

@@ -15,7 +15,7 @@ public class LampInfoDTO {
     private String section;
     private Integer sectionId;
     private Integer timezone;
-    private int lighteness;
+    private Integer lighteness;
     private Integer status;
     private String gridPF;
     private String name;
@@ -29,16 +29,16 @@ public class LampInfoDTO {
     private Integer ledLuxValue;
     private Float leakageCur;
     private String networkStatus;
-    private int lampStatus;
+    private Integer lampStatus;
     private String lampStatusStr;
     private String lampOnline;
     private Integer rssi;
     private Integer snr;
-    private int protocolType;
+    private Integer protocolType;
     private String groupId;
     private String group;
     private String network;
-    private int networkId;
+    private Integer networkId;
     private String netStatus;
     private String lampPoleName;
     private String loopNumber;
@@ -47,7 +47,7 @@ public class LampInfoDTO {
     private Integer mode;
     private String hwVersion;
     private String swVersion;
-    private int controlType;
+    private Integer controlType;
     private String macAddress;
     private String devAddr;
     private Integer bindStatus;
@@ -65,10 +65,10 @@ public class LampInfoDTO {
     private String dueDate;
     private String controlTypeStr;
     private String createTime;
-    private int ratedPower;
-    private int version;
-    private int select;
-    private int lampPoleId;
+    private Integer ratedPower;
+    private Integer version;
+    private Integer select;
+    private Integer lampPoleId;
     private Integer loopId;
     private String colourVal;
     private String keyword;

+ 1 - 1
src/main/java/com/welampiot/dto/OperationLogDTO.java

@@ -16,7 +16,7 @@ public class OperationLogDTO {
     private Integer type;
     private Integer userId;
     private Integer devType;
-    private Integer deviceName;
+    private String deviceName;
     private String sn;
     private String devId;
     private String name;//用户名

+ 4 - 0
src/main/java/com/welampiot/dto/SmartLockDevInfoDTO.java

@@ -92,5 +92,9 @@ public class SmartLockDevInfoDTO implements Serializable {
 
     private Integer version;
 
+    private Integer areaId;
+
+    private Integer sectionId;
+
     private static final long serialVersionUID = 1L;
 }

+ 2 - 0
src/main/java/com/welampiot/vo/LampVO.java

@@ -35,5 +35,7 @@ public class LampVO implements Serializable {
 
     private Integer total;
 
+    private String path;
+
     private List<LampInfoDTO> list;
 }

+ 2 - 0
src/main/java/com/welampiot/vo/LightStripDevVO.java

@@ -25,5 +25,7 @@ public class LightStripDevVO implements Serializable {
 
     private List<LightStripDevDTO> list;
 
+    private String path;
+
     private static final long serialVersionUID = 1L;
 }

+ 2 - 0
src/main/java/com/welampiot/vo/LightStripGroupVO.java

@@ -19,5 +19,7 @@ import java.util.List;
 public class LightStripGroupVO implements Serializable {
     private List<LightStripGroupDTO> list;
 
+    private String path;
+
     private static final long serialVersionUID = 1L;
 }

+ 1 - 0
src/main/java/com/welampiot/vo/OperationLogVO.java

@@ -18,5 +18,6 @@ public class OperationLogVO {
     private Integer role;
     private String username;
     private Integer total;
+    private String path;
     private List<OperationLogDTO> list;
 }

+ 2 - 0
src/main/java/com/welampiot/vo/SmartLockDevInfoVO.java

@@ -21,5 +21,7 @@ public class SmartLockDevInfoVO implements Serializable {
 
     private List<SmartLockDevInfoDTO> list;
 
+    private String path;
+
     private static final long serialVersionUID = 1L;
 }

+ 4 - 4
src/main/resources/mapper/LampMapper.xml

@@ -668,7 +668,7 @@
 
     <select id="getLampList" resultType="com.welampiot.dto.LampInfoDTO">
         select
-            l.id,l.lamp_pole_id as lampPoleId,lp.name as lampPoleName,w.num as sn,s.name as section
+            l.id,l.lamp_pole_id as lampPoleId,lp.name as lampPoleName,w.num as sn,s.name as section,l.number,l.name
             <choose>
                 <when test="version == 0">
                     ,gl.chinese_name as area
@@ -709,11 +709,11 @@
         </if>
         <choose>
             <when test="online == 1">
+                and n.status = 0
+            </when>
+            <when test="online == 2">
                 and n.status = 1
             </when>
-            <otherwise>
-                and n.status = 0
-            </otherwise>
         </choose>
         <if test="page >= 0 and count > 0">
             limit #{page},#{count}

+ 8 - 2
src/main/resources/mapper/LightStripDevMapper.xml

@@ -74,13 +74,19 @@
                 and (l.number like '%${keyword}%' or l.name like '%${keyword}%')
             </if>
             <choose>
-                <when test="onlineState == 0">
+                <when test="onlineState == 1">
                     and l.online = 0
                 </when>
-                <when test="onlineState == 1">
+                <when test="onlineState == 2">
                     and l.online = 1
                 </when>
             </choose>
+            <if test="areaId != null and areaId != 0">
+                and l.areaid = #{areaId}
+            </if>
+            <if test="sectionId != null and sectionId != 0">
+                and l.sectionid = #{sectionId}
+            </if>
             order by convert(l.name using gbk) desc,l.number asc
             <if test="page >= 0 and count > 0">
                 limit #{page},#{count}

+ 6 - 0
src/main/resources/mapper/LightStripGroupMapper.xml

@@ -28,6 +28,12 @@
                     #{dto}
                 </foreach>
             </if>
+            <if test="areaId != null and areaId != 0">
+                and l.areaid = #{areaId}
+            </if>
+            <if test="sectionId != null and sectionId != 0">
+                and l.sectionid = #{sectionId}
+            </if>
             <if test="keyword != null and keyword != ''">
                 and (l.number like '%${keyword}%' or l.name like '%${keyword}%')
             </if>

+ 22 - 5
src/main/resources/mapper/OperationLogMapper.xml

@@ -34,7 +34,7 @@
     </select>
 
     <select id="getLogListByVO" resultType="com.welampiot.dto.OperationLogDTO" parameterType="com.welampiot.vo.OperationLogVO">
-        select u.name,o.operaType,o.deviceName,o.sn,o.remark,u.company,o.devtype,o.time as updateTime,o.section,o.area,s.timezone
+        select o.acount,o.operaType,o.deviceName,o.sn,o.remark,u.company,o.devtype,o.time as updateTime,o.section,o.area,s.timezone
         from operation_log o left join user u on o.userid = u.id
             left join section s on o.sectionid = s.id
         where 1=1
@@ -44,10 +44,27 @@
             <if test="keyword != null and keyword != ''">
                 and (u.name like '%${keyword}%' or o.sn like '%${keyword}%' or o.deviceName like '%${keyword}%')
             </if>
-            <if test="operaType != null">
-                and o.operaType = #{operaType}
-            </if>
-            <if test="devType != null">
+            <choose>
+                <when test="operaType == 1">
+                    and o.operaType = 1
+                </when>
+                <when test="operaType == 2">
+                    and o.operaType = 2
+                </when>
+                <when test="operaType == 3">
+                    and o.operaType = 3
+                </when>
+                <when test="operaType == 4">
+                    and o.operaType = 4
+                </when>
+                <when test="operaType == 5">
+                    and o.operaType = 5
+                </when>
+                <when test="operaType == 6">
+                    and o.operaType = 0
+                </when>
+            </choose>
+            <if test="devType != null and devType != 0">
                 and o.devtype = #{devType}
             </if>
             order by o.time desc

+ 8 - 2
src/main/resources/mapper/SmartLockDevInfoMapper.xml

@@ -32,11 +32,17 @@
             <if test="keyword != null and keyword != ''">
                 and (s.name like '%${keyword}%' or s.number like '%${keyword}%')
             </if>
+            <if test="areaId != null and areaId != 0">
+                and lp.areaid = #{areaId}
+            </if>
+            <if test="sectionId != null and sectionId != 0">
+                and lp.sectionid = #{sectionId}
+            </if>
             <choose>
-                <when test="onlineState == 0">
+                <when test="onlineState == 1">
                     and s.online = 0
                 </when>
-                <when test="onlineState == 1">
+                <when test="onlineState == 2">
                     and s.online = 1
                 </when>
             </choose>