Просмотр исходного кода

工单管理:故障列表、维修人员下拉列表、工单列表

zhj 2 лет назад
Родитель
Сommit
dccf0d55e2

+ 209 - 0
src/main/java/com/welampiot/controller/WorkManageController.java

@@ -0,0 +1,209 @@
+package com.welampiot.controller;
+
+import com.welampiot.common.BaseResult;
+import com.welampiot.common.InterfaceResultEnum;
+import com.welampiot.dto.AllAlarmInfoLogDTO;
+import com.welampiot.dto.WorkManageDTO;
+import com.welampiot.dto.WorkManageFileDTO;
+import com.welampiot.service.AllAlarmInfoLogService;
+import com.welampiot.service.RepairPersonnelService;
+import com.welampiot.service.WorkManageFileService;
+import com.welampiot.service.WorkManageService;
+import com.welampiot.utils.ToolUtils;
+import com.welampiot.vo.AllAlarmInfoLogVO;
+import com.welampiot.vo.RepairPersonnelVO;
+import com.welampiot.vo.WorkManageVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * ClassName: WorkManageController
+ * Package: com.welampiot.controller
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 14:29
+ * @Version: v1.0
+ */
+@RestController
+@CrossOrigin
+@RequestMapping("/workManage")
+public class WorkManageController {
+    @Autowired
+    private AllAlarmInfoLogService allAlarmInfoLogService;
+
+    @Autowired
+    private ToolUtils toolUtils;
+
+    @Autowired
+    private RepairPersonnelService repairPersonnelService;
+
+    @Autowired
+    private WorkManageService workManageService;
+
+    @Autowired
+    private WorkManageFileService workManageFileService;
+
+    /**
+     * 故障列表
+     * @param request 分页、区域路段筛选、故障类型、设备类型
+     * @return 故障列表
+     */
+    @RequestMapping(value = "/alarmList", method = RequestMethod.POST)
+    public BaseResult<?> alarmList(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 provinceId = (Integer) toolUtils.getRequestContent(request,"provinceId",1);
+        Integer cityId = (Integer) toolUtils.getRequestContent(request,"cityId",1);
+        String alarmType = (String) toolUtils.getRequestContent(request,"alarmType",2);
+        String type = request.getParameter("type") == null ? "" : request.getParameter("type");
+        int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
+        int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
+
+        AllAlarmInfoLogVO vo = new AllAlarmInfoLogVO();
+        vo.setLimit(count * (page - 1));
+        vo.setOffset(count);
+        vo.setSectionId(sectionId);
+        vo.setAreaId(areaId);
+        vo.setCityId(cityId);
+        vo.setProvinceId(provinceId);
+        vo.setAlarmType(alarmType);
+        vo.setVersion(version);
+        vo.setSectionList(toolUtils.getSectionList(request));
+        List<AllAlarmInfoLogDTO> alarmList;
+        List<AllAlarmInfoLogDTO> list = new ArrayList<>();
+        switch (type) {
+            case "4":
+                alarmList = allAlarmInfoLogService.getElectricBoxAlarmListByVO(vo);
+                break;
+            case "3":
+                alarmList = allAlarmInfoLogService.getWaterImmersionAlarmListByVO(vo);
+                break;
+            case "1":
+                alarmList = allAlarmInfoLogService.getLampPoleAlarmListByVO(vo);
+                break;
+            case "0":
+                alarmList = allAlarmInfoLogService.getLampAlarmListByVO(vo);
+                break;
+            default:
+                List<AllAlarmInfoLogDTO> eleBoxList = allAlarmInfoLogService.getElectricBoxAlarmListByVO(vo);
+                List<AllAlarmInfoLogDTO> waterList = allAlarmInfoLogService.getWaterImmersionAlarmListByVO(vo);
+                List<AllAlarmInfoLogDTO> lampPoleList = allAlarmInfoLogService.getLampPoleAlarmListByVO(vo);
+                List<AllAlarmInfoLogDTO> lampList = allAlarmInfoLogService.getLampAlarmListByVO(vo);
+                // 将配电箱、水浸、灯杆、路灯合并成一个列表
+                alarmList = Stream.of(eleBoxList, waterList, lampPoleList, lampList)
+                            .flatMap(Collection::stream)
+                            .collect(Collectors.toList());
+                break;
+        }
+        alarmList.forEach(dto -> {
+            if (dto.getArea() == null) {
+                dto.setArea("");
+            }
+            if (dto.getSection() == null) {
+                dto.setSection("");
+            }
+            if (dto.getCity() == null) {
+                dto.setCity("");
+            }
+            if (dto.getProvince() == null) {
+                dto.setProvince("");
+            }
+            if (dto.getNumber() == null) {
+                dto.setNumber("");
+            }
+            if (dto.getName() == null) {
+                dto.setName("");
+            }
+            if (dto.getLongitude() == null) {
+                dto.setLongitude("0");
+            }
+            if (dto.getLatitude() == null) {
+                dto.setLatitude("0");
+            }
+            if (dto.getProvince().equals("") && dto.getCity().equals("") &&
+                dto.getArea().equals("") && dto.getSection().equals("")) {
+                dto.setAddr("");
+            }
+            dto.setAddr(dto.getProvince() + " " + dto.getCity() + " " +
+                        dto.getArea() + " " + dto.getSection());
+            list.add(dto);
+        });
+        AllAlarmInfoLogVO allAlarmInfoLogVO = new AllAlarmInfoLogVO();
+        allAlarmInfoLogVO.setList(list);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,allAlarmInfoLogVO);
+    }
+
+    /**
+     * 维修人员下拉列表
+     * @param request 用户名
+     * @return 下拉列表
+     */
+    @RequestMapping(value = "/alarmUserNav", method = RequestMethod.POST)
+    public BaseResult<?> alarmUserNav(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        String username = (String) toolUtils.getRequestContent(request,"username",2);
+        if (username.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        Integer userId = repairPersonnelService.getUserIdByUsername(username);
+        if (userId == null || userId == 0) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
+        RepairPersonnelVO repairPersonnel = repairPersonnelService.getRepairPersonnelDropDownListByDTO(userId);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,repairPersonnel);
+    }
+
+    /**
+     * 工单列表
+     * @param request 分页、关键字搜索、区域路段筛选
+     * @return 工单列表
+     */
+    @RequestMapping(value = "/alarmManageList", method = RequestMethod.POST)
+    public BaseResult<?> alarmManageList(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 provinceId = (Integer) toolUtils.getRequestContent(request,"provinceId",1);
+        Integer cityId = (Integer) toolUtils.getRequestContent(request,"cityId",1);
+        Integer status = (Integer) toolUtils.getRequestContent(request,"status",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"));
+
+        WorkManageVO vo = new WorkManageVO();
+        vo.setPage(count * (page - 1));
+        vo.setCount(count);
+        vo.setSectionId(sectionId);
+        vo.setAreaId(areaId);
+        vo.setCityId(cityId);
+        vo.setProvinceId(provinceId);
+        vo.setKeyword(keyword);
+        vo.setStatus(status);
+        vo.setSectionList(toolUtils.getSectionList(request));
+        List<WorkManageDTO> workManageList = workManageService.getWorkManageListByVO(vo);
+        List<WorkManageDTO> list = new ArrayList<>();
+        workManageList.forEach(workManageDTO -> {
+            if (workManageDTO.getId() != null) {
+                List<WorkManageFileDTO> fileList = workManageFileService.getWorkManageFileListById(workManageDTO.getId());
+                workManageDTO.setFileList(fileList);
+            }
+            list.add(workManageDTO);
+        });
+        WorkManageVO workManageVO = new WorkManageVO();
+        workManageVO.setList(list);
+        workManageVO.setTotal(workManageService.getWorkManageTotal(vo));
+        workManageVO.setTotal1(workManageService.getWorkManageTotal(vo));
+        workManageVO.setTotal2(workManageService.getWorkManageTotal2(vo));
+        workManageVO.setTotal3(workManageService.getWorkManageTotal3(vo));
+        workManageVO.setTotal4(workManageService.getWorkManageTotal4(vo));
+        workManageVO.setTotal5(workManageService.getWorkManageTotal5(vo));
+        workManageVO.setTotal6(workManageService.getWorkManageTotal6(vo));
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,workManageVO);
+    }
+}

+ 4 - 0
src/main/java/com/welampiot/dao/AllAlarmInfoLogDao.java

@@ -15,4 +15,8 @@ public interface AllAlarmInfoLogDao {
     void updateAlarmStatusByAlarmId(AllAlarmInfoLogDTO dto);
     Integer getAlarmTotalByStatus(AllAlarmInfoLogVO vo);
     List<AllAlarmInfoLogDTO> getAlarmListBySectionList(@Param("sectionList") List<Integer> sectionList);
+    List<AllAlarmInfoLogDTO> getLampAlarmListByVO(AllAlarmInfoLogVO vo);
+    List<AllAlarmInfoLogDTO> getLampPoleAlarmListByVO(AllAlarmInfoLogVO vo);
+    List<AllAlarmInfoLogDTO> getWaterImmersionAlarmListByVO(AllAlarmInfoLogVO vo);
+    List<AllAlarmInfoLogDTO> getElectricBoxAlarmListByVO(AllAlarmInfoLogVO vo);
 }

+ 31 - 0
src/main/java/com/welampiot/dao/WorkManageDao.java

@@ -0,0 +1,31 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.WorkManageDTO;
+import com.welampiot.vo.WorkManageVO;
+
+import java.util.List;
+
+/**
+ * ClassName: WorkManageDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 17:49
+ * @Version: v1.0
+ */
+public interface WorkManageDao {
+    List<WorkManageDTO> getWorkManageListByVO(WorkManageVO vo);
+
+    Integer getWorkManageTotal(WorkManageVO vo);
+
+    Integer getWorkManageTotal2(WorkManageVO vo);
+
+    Integer getWorkManageTotal3(WorkManageVO vo);
+
+    Integer getWorkManageTotal4(WorkManageVO vo);
+
+    Integer getWorkManageTotal5(WorkManageVO vo);
+
+    Integer getWorkManageTotal6(WorkManageVO vo);
+}

+ 19 - 0
src/main/java/com/welampiot/dao/WorkManageFileDao.java

@@ -0,0 +1,19 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.WorkManageFileDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: WorkManageFileDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 18:02
+ * @Version: v1.0
+ */
+public interface WorkManageFileDao {
+    List<WorkManageFileDTO> getWorkManageFileListById(@Param("id") Integer id);
+}

+ 5 - 0
src/main/java/com/welampiot/dto/AllAlarmInfoLogDTO.java

@@ -21,4 +21,9 @@ public class AllAlarmInfoLogDTO {
     private String statusStr;
     private Integer repairUserid;
     private String repairTime;
+    private String latitude;
+    private String longitude;
+    private String addr;
+    private String city;
+    private String province;
 }

+ 68 - 0
src/main/java/com/welampiot/dto/WorkManageDTO.java

@@ -0,0 +1,68 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: WorkManageDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 17:06
+ * @Version: v1.0
+ */
+@Data
+public class WorkManageDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private String number; // 工单编号
+
+    private Integer alarmId; // 报警id
+
+    private String openTime; // 发生时间
+
+    private String location; // 位置信息
+
+    private Integer devType; // 设备类型(0 路灯,1 灯杆,2 井盖,3 水浸,4 配电箱)
+
+    private String devName; // 设备名称
+
+    private String script; // 工单描述
+
+    private Integer workId; // 维修人员id
+
+    private String createTime; // 创建时间
+
+    private Integer status; // 工单状态(0 未派发,1 处理中,2 复核,3 结案,4 归档)
+
+    private Integer level; // 严重程度(0 日常,1 一般,2 重大)
+
+    private String workName; // 维修人员名称
+
+    private Integer userid; // 用户id
+
+    private String longitude; // 经度
+
+    private String latitude; // 纬度
+
+    private Integer sectionId; // 路段id
+
+    private Integer receive; // 接收状态(0 拒绝,1 接受)
+
+    private String receiveTime; // 接收状态时间
+
+    private String arriveTime; // 到达现场时间
+
+    private Integer arrive; // 接收状态(0 拒绝,1 接收)
+
+    private Integer progress; // 维修进度(0 未完成,1 已完成)
+
+    private String progressTime; // 维修进度时间
+
+    private List<WorkManageFileDTO> fileList;
+}

+ 27 - 0
src/main/java/com/welampiot/dto/WorkManageFileDTO.java

@@ -0,0 +1,27 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: WorkManageFileDTO
+ * Package: com.welampiot.dto
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 17:37
+ * @Version: v1.0
+ */
+@Data
+public class WorkManageFileDTO implements Serializable {
+    private Integer id;
+
+    private Integer workManageId; // 工单id
+
+    private String name; // 附件名称
+
+    private String url; // 附件地址
+
+    private static final long serialVersionUID = 1L;
+}

+ 4 - 0
src/main/java/com/welampiot/service/AllAlarmInfoLogService.java

@@ -14,4 +14,8 @@ public interface AllAlarmInfoLogService {
     void updateAlarmStatusByAlarmId(AllAlarmInfoLogDTO dto);
     Integer getAlarmTotalByStatus(AllAlarmInfoLogVO vo);
     AllAlarmInfoLogVO getAlarmListBySectionList(List<Integer> sectionList);
+    List<AllAlarmInfoLogDTO> getLampAlarmListByVO(AllAlarmInfoLogVO vo);
+    List<AllAlarmInfoLogDTO> getLampPoleAlarmListByVO(AllAlarmInfoLogVO vo);
+    List<AllAlarmInfoLogDTO> getWaterImmersionAlarmListByVO(AllAlarmInfoLogVO vo);
+    List<AllAlarmInfoLogDTO> getElectricBoxAlarmListByVO(AllAlarmInfoLogVO vo);
 }

+ 18 - 0
src/main/java/com/welampiot/service/WorkManageFileService.java

@@ -0,0 +1,18 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.WorkManageFileDTO;
+
+import java.util.List;
+
+/**
+ * ClassName: WorkManageFileService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 18:03
+ * @Version: v1.0
+ */
+public interface WorkManageFileService {
+    List<WorkManageFileDTO> getWorkManageFileListById(Integer id);
+}

+ 31 - 0
src/main/java/com/welampiot/service/WorkManageService.java

@@ -0,0 +1,31 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.WorkManageDTO;
+import com.welampiot.vo.WorkManageVO;
+
+import java.util.List;
+
+/**
+ * ClassName: WorkManageService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 17:57
+ * @Version: v1.0
+ */
+public interface WorkManageService {
+    List<WorkManageDTO> getWorkManageListByVO(WorkManageVO vo);
+
+    Integer getWorkManageTotal(WorkManageVO vo);
+
+    Integer getWorkManageTotal2(WorkManageVO vo);
+
+    Integer getWorkManageTotal3(WorkManageVO vo);
+
+    Integer getWorkManageTotal4(WorkManageVO vo);
+
+    Integer getWorkManageTotal5(WorkManageVO vo);
+
+    Integer getWorkManageTotal6(WorkManageVO vo);
+}

+ 20 - 0
src/main/java/com/welampiot/service/impl/AllAlarmInfoLogServiceImpl.java

@@ -96,4 +96,24 @@ public class AllAlarmInfoLogServiceImpl implements AllAlarmInfoLogService {
         allAlarmInfoLogVO.setList(list);
         return allAlarmInfoLogVO;
     }
+
+    @Override
+    public List<AllAlarmInfoLogDTO> getLampAlarmListByVO(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getLampAlarmListByVO(vo);
+    }
+
+    @Override
+    public List<AllAlarmInfoLogDTO> getLampPoleAlarmListByVO(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getLampPoleAlarmListByVO(vo);
+    }
+
+    @Override
+    public List<AllAlarmInfoLogDTO> getWaterImmersionAlarmListByVO(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getWaterImmersionAlarmListByVO(vo);
+    }
+
+    @Override
+    public List<AllAlarmInfoLogDTO> getElectricBoxAlarmListByVO(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getElectricBoxAlarmListByVO(vo);
+    }
 }

+ 29 - 0
src/main/java/com/welampiot/service/impl/WorkManageFileServiceImpl.java

@@ -0,0 +1,29 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.WorkManageFileDao;
+import com.welampiot.dto.WorkManageFileDTO;
+import com.welampiot.service.WorkManageFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: WorkManageFileServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 18:03
+ * @Version: v1.0
+ */
+@Service
+public class WorkManageFileServiceImpl implements WorkManageFileService {
+    @Autowired
+    private WorkManageFileDao workManageFileDao;
+
+    @Override
+    public List<WorkManageFileDTO> getWorkManageFileListById(Integer id) {
+        return workManageFileDao.getWorkManageFileListById(id);
+    }
+}

+ 60 - 0
src/main/java/com/welampiot/service/impl/WorkManageServiceImpl.java

@@ -0,0 +1,60 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.WorkManageDao;
+import com.welampiot.dto.WorkManageDTO;
+import com.welampiot.service.WorkManageService;
+import com.welampiot.vo.WorkManageVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: WorkManageServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 17:57
+ * @Version: v1.0
+ */
+@Service
+public class WorkManageServiceImpl implements WorkManageService {
+    @Autowired
+    private WorkManageDao workManageDao;
+
+    @Override
+    public List<WorkManageDTO> getWorkManageListByVO(WorkManageVO vo) {
+        return workManageDao.getWorkManageListByVO(vo);
+    }
+
+    @Override
+    public Integer getWorkManageTotal(WorkManageVO vo) {
+        return workManageDao.getWorkManageTotal(vo);
+    }
+
+    @Override
+    public Integer getWorkManageTotal2(WorkManageVO vo) {
+        return workManageDao.getWorkManageTotal2(vo);
+    }
+
+    @Override
+    public Integer getWorkManageTotal3(WorkManageVO vo) {
+        return workManageDao.getWorkManageTotal3(vo);
+    }
+
+    @Override
+    public Integer getWorkManageTotal4(WorkManageVO vo) {
+        return workManageDao.getWorkManageTotal4(vo);
+    }
+
+    @Override
+    public Integer getWorkManageTotal5(WorkManageVO vo) {
+        return workManageDao.getWorkManageTotal5(vo);
+    }
+
+    @Override
+    public Integer getWorkManageTotal6(WorkManageVO vo) {
+        return workManageDao.getWorkManageTotal6(vo);
+    }
+}

+ 5 - 0
src/main/java/com/welampiot/vo/AllAlarmInfoLogVO.java

@@ -18,5 +18,10 @@ public class AllAlarmInfoLogVO {
     private Integer processingCount;
     private Integer handleCount;
     private Integer total;
+    private Integer sectionId;
+    private Integer areaId;
+    private Integer cityId;
+    private Integer provinceId;
+    private String alarmType;
     private List<AllAlarmInfoLogDTO> list;
 }

+ 49 - 0
src/main/java/com/welampiot/vo/WorkManageVO.java

@@ -0,0 +1,49 @@
+package com.welampiot.vo;
+
+import com.welampiot.dto.WorkManageDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * ClassName: WorkManageVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/6/27 - 17:50
+ * @Version: v1.0
+ */
+@Data
+public class WorkManageVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer page;
+
+    private Integer count;
+
+    private Integer status;
+
+    private String keyword;
+
+    private Integer areaId;
+
+    private Integer sectionId;
+
+    private Integer cityId;
+
+    private Integer provinceId;
+
+    private List<Integer> sectionList;
+
+    private Integer total; // 设备总数(列表使用)
+    private Integer total1; // 设备总数(tab栏使用)
+    private Integer total2; // 未派发
+    private Integer total3; // 处理中
+    private Integer total4; // 复核中
+    private Integer total5; // 已结案
+    private Integer total6; // 已归档
+
+    private List<WorkManageDTO> list;
+}

+ 281 - 0
src/main/resources/mapper/AllAlarmInfoLogMapper.xml

@@ -167,5 +167,286 @@
             </foreach>
         </if>
     </select>
+    
+    <select id="getLampAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
+        select
+            a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+            s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
+            <choose>
+                <when test="version == 0">
+                    ,gl.chinese_name as area
+                </when>
+                <when test="version == 1">
+                    ,gl.english_name as area
+                </when>
+                <otherwise>
+                    ,gl.ru_name as area
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="version == 0">
+                    ,gl1.chinese_name as city
+                </when>
+                <when test="version == 1">
+                    ,gl1.english_name as city
+                </when>
+                <otherwise>
+                    ,gl1.ru_name as city
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="version == 0">
+                    ,gl2.chinese_name as province
+                </when>
+                <when test="version == 1">
+                    ,gl2.english_name as province
+                </when>
+                <otherwise>
+                    ,gl2.ru_name as province
+                </otherwise>
+            </choose>
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join lampinfo l on a.lampid = l.id
+        where a.devType = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getLampPoleAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
+        select
+        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+        s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
+        <choose>
+            <when test="version == 0">
+                ,gl.chinese_name as area
+            </when>
+            <when test="version == 1">
+                ,gl.english_name as area
+            </when>
+            <otherwise>
+                ,gl.ru_name as area
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl1.chinese_name as city
+            </when>
+            <when test="version == 1">
+                ,gl1.english_name as city
+            </when>
+            <otherwise>
+                ,gl1.ru_name as city
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl2.chinese_name as province
+            </when>
+            <when test="version == 1">
+                ,gl2.english_name as province
+            </when>
+            <otherwise>
+                ,gl2.ru_name as province
+            </otherwise>
+        </choose>
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join lamp_pole l on a.lampid = l.id
+        where a.devType = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getWaterImmersionAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
+        select
+        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+        s.name as section,a.devType,w.number,lp.longitude,lp.latitude,w.name
+        <choose>
+            <when test="version == 0">
+                ,gl.chinese_name as area
+            </when>
+            <when test="version == 1">
+                ,gl.english_name as area
+            </when>
+            <otherwise>
+                ,gl.ru_name as area
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl1.chinese_name as city
+            </when>
+            <when test="version == 1">
+                ,gl1.english_name as city
+            </when>
+            <otherwise>
+                ,gl1.ru_name as city
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl2.chinese_name as province
+            </when>
+            <when test="version == 1">
+                ,gl2.english_name as province
+            </when>
+            <otherwise>
+                ,gl2.ru_name as province
+            </otherwise>
+        </choose>
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join lamp_pole lp on a.lampid = lp.id
+        left join water_immersion_dev_info w on w.lamp_pole_id = lp.id
+        where a.devType = 3
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getElectricBoxAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
+        select
+        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+        s.name as section,a.devType,e.address as `number`,e.longitude,e.latitude,e.name
+        <choose>
+            <when test="version == 0">
+                ,gl.chinese_name as area
+            </when>
+            <when test="version == 1">
+                ,gl.english_name as area
+            </when>
+            <otherwise>
+                ,gl.ru_name as area
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl1.chinese_name as city
+            </when>
+            <when test="version == 1">
+                ,gl1.english_name as city
+            </when>
+            <otherwise>
+                ,gl1.ru_name as city
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl2.chinese_name as province
+            </when>
+            <when test="version == 1">
+                ,gl2.english_name as province
+            </when>
+            <otherwise>
+                ,gl2.ru_name as province
+            </otherwise>
+        </choose>
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join electric_box e on a.lampid = e.id
+        where a.devType = 4
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
 
 </mapper>

+ 11 - 0
src/main/resources/mapper/WorkManageFileMapper.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.welampiot.dao.WorkManageFileDao">
+
+    <select id="getWorkManageFileListById" resultType="WorkManageFileDTO">
+        select w.id,w.url
+        from work_manage_file w
+        where w.work_manage_id = #{id}
+    </select>
+
+</mapper>

+ 159 - 0
src/main/resources/mapper/WorkManageMapper.xml

@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.welampiot.dao.WorkManageDao">
+    
+    <select id="getWorkManageListByVO" resultType="WorkManageDTO" parameterType="WorkManageVO">
+        select w.id,w.number,w.open_time openTime,w.script,w.location,w.status,
+               w.level,w.work_name as workName
+        from work_manage w
+        left join work_manage_file wmf on w.id = wmf.work_manage_id
+        left join section s on w.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        where 1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and w.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and w.number like '%${keyword}%'
+        </if>
+        <choose>
+            <when test="status == 4">
+                and w.status = 4
+            </when>
+            <when test="status == 3">
+                and w.status = 3
+            </when>
+            <when test="status == 2">
+                and w.status = 2
+            </when>
+            <when test="status == 1">
+                and w.status = 1
+            </when>
+            <otherwise>
+                and w.status = 0
+            </otherwise>
+        </choose>
+        <if test="page >= 0 and count > 0">
+            limit #{page},#{count}
+        </if>
+    </select>
+
+    <!-- 总数 -->
+    <select id="getWorkManageTotal" resultType="Integer" parameterType="WorkManageVO">
+        select count(w.id) as total
+        from work_manage w
+        left join section s on w.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            where w.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 未派发数 -->
+    <select id="getWorkManageTotal2" resultType="Integer" parameterType="WorkManageVO">
+        select count(w.id) as total
+        from work_manage w
+        left join section s on w.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        where w.status = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and w.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 处理中数 -->
+    <select id="getWorkManageTotal3" resultType="Integer" parameterType="WorkManageVO">
+        select count(w.id) as total
+        from work_manage w
+        left join section s on w.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        where w.status = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and w.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 复核数 -->
+    <select id="getWorkManageTotal4" resultType="Integer" parameterType="WorkManageVO">
+        select count(w.id) as total
+        from work_manage w
+        left join section s on w.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        where w.status = 2
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and w.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 结案数 -->
+    <select id="getWorkManageTotal5" resultType="Integer" parameterType="WorkManageVO">
+        select count(w.id) as total
+        from work_manage w
+        left join section s on w.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        where w.status = 3
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and w.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <!-- 归档数 -->
+    <select id="getWorkManageTotal6" resultType="Integer" parameterType="WorkManageVO">
+        select count(w.id) as total
+        from work_manage w
+        left join section s on w.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        where w.status = 4
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and w.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+</mapper>