前端接口对接
This commit is contained in:
parent
076bd38932
commit
4fe2de9d2d
|
@ -0,0 +1,55 @@
|
|||
package com.zjyr.beidouservice.constenum;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 警报器类型
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AlarmTypeEnum {
|
||||
/**
|
||||
* 电动警报
|
||||
*/
|
||||
DIAN_DONG_ALARM(1, "电动警报"),
|
||||
/**
|
||||
* 电动警报
|
||||
*/
|
||||
DIAN_SHENG_ALARM(2, "电声警报"),
|
||||
/**
|
||||
* 电动警报
|
||||
*/
|
||||
DI_DONG_ALARM(3, "气动警报"),
|
||||
/**
|
||||
* 电动警报
|
||||
*/
|
||||
OTHER_ALARM(4, "其他");
|
||||
|
||||
|
||||
private final Integer code;
|
||||
private final String msg;
|
||||
|
||||
public static String getByCode(Integer code) {
|
||||
AlarmTypeEnum[] values = AlarmTypeEnum.values();
|
||||
for (AlarmTypeEnum v : values) {
|
||||
if (code.equals(v.getCode())) {
|
||||
return v.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Integer> getAllCodes() {
|
||||
AlarmTypeEnum[] values = AlarmTypeEnum.values();
|
||||
List<Integer> codes = new ArrayList<>();
|
||||
for (AlarmTypeEnum v : values) {
|
||||
codes.add(v.getCode());
|
||||
}
|
||||
return codes;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.zjyr.beidouservice.constenum;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 命令执行状态类型
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ExecStatusEnum {
|
||||
|
||||
/**
|
||||
* 执行中
|
||||
*/
|
||||
EXEC_PENDING(0, "执行中"),
|
||||
/**
|
||||
* 电动警报
|
||||
*/
|
||||
EXEC_SUCCESS(1, "执行成功"),
|
||||
/**
|
||||
* 电动警报
|
||||
*/
|
||||
EXEC_FAIL(2, "执行失败"),
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String msg;
|
||||
|
||||
public static String getByCode(Integer code) {
|
||||
ExecStatusEnum[] values = ExecStatusEnum.values();
|
||||
for (ExecStatusEnum v : values) {
|
||||
if (code.equals(v.getCode())) {
|
||||
return v.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.zjyr.beidouservice.constenum;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 厂家类型类型
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ManufacturerTypeEnum {
|
||||
/**
|
||||
* 欧丽
|
||||
*/
|
||||
MANUFACTURER_OULI(0, "欧丽"),
|
||||
/**
|
||||
* 厦门日华
|
||||
*/
|
||||
MANUFACTURER_XIAMEN_RIHUA(1, "厦门日化"),
|
||||
/**
|
||||
* 南京厚华
|
||||
*/
|
||||
MANUFACTURER_NANJING_HOUHUA_(2, "南京厚华"),
|
||||
;
|
||||
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String msg;
|
||||
|
||||
|
||||
public static String getByCode(Integer code) {
|
||||
ManufacturerTypeEnum[] values = ManufacturerTypeEnum.values();
|
||||
for (ManufacturerTypeEnum v : values) {
|
||||
if (code.equals(v.getCode())) {
|
||||
return v.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Integer> getAllCodes() {
|
||||
ManufacturerTypeEnum[] values = ManufacturerTypeEnum.values();
|
||||
List<Integer> codes = new ArrayList<>();
|
||||
for (ManufacturerTypeEnum v : values) {
|
||||
codes.add(v.getCode());
|
||||
}
|
||||
return codes;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.zjyr.beidouservice.controller;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.MyResp;
|
||||
import com.zjyr.beidouservice.pojo.dto.AlarmDevRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceReqDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.ManufacturerRespDTO;
|
||||
import com.zjyr.beidouservice.service.DeviceService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 终端设备
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class DeviceController {
|
||||
|
||||
@Resource
|
||||
DeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 获取省份信息
|
||||
*
|
||||
* @return 省份信息
|
||||
*/
|
||||
@PostMapping("device/location")
|
||||
public MyResp<List<DeviceRespDTO>> getDeviceInfo(@RequestBody DeviceReqDTO deviceReqDTO) {
|
||||
List<DeviceRespDTO> deviceRespDTO = deviceService.getDeviceInfo(deviceReqDTO);
|
||||
return MyResp.success(deviceRespDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取厂家信息
|
||||
*
|
||||
* @return 厂家信息
|
||||
*/
|
||||
@PostMapping("device/manufacturer")
|
||||
public MyResp<ManufacturerRespDTO> getDeviceManufacturerInfo() {
|
||||
ManufacturerRespDTO manufacturerRes = deviceService.getDeviceManufacturerInfo();
|
||||
return MyResp.success(manufacturerRes);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取警报终端信息
|
||||
*
|
||||
* @return 省份信息
|
||||
*/
|
||||
@PostMapping("alarm/device")
|
||||
public MyResp<AlarmDevRespDTO> getAlarmDeviceInfo() {
|
||||
AlarmDevRespDTO alarmDevRespDTO = deviceService.getAlarmDeviceInfo();
|
||||
return MyResp.success(alarmDevRespDTO);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.zjyr.beidouservice.controller;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.MyResp;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
||||
import com.zjyr.beidouservice.service.DeviceTaskService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class DeviceTaskController {
|
||||
|
||||
@Resource
|
||||
DeviceTaskService deviceTaskService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取任务信息
|
||||
*
|
||||
* @return MyResp
|
||||
*/
|
||||
@PostMapping("task/info")
|
||||
public MyResp<List<DeviceTaskRespDTO>> getDeviceTaskInfo() {
|
||||
List<DeviceTaskRespDTO> deviceTaskRespDTOS = deviceTaskService.getDeviceTaskInfo();
|
||||
return MyResp.success(deviceTaskRespDTOS);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.zjyr.beidouservice.controller;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.MyResp;
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CityRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CitySearchDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.OnlyProvinceResp;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.ProvinceSearchDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.ProvinceRespDTO;
|
||||
import com.zjyr.beidouservice.service.LocationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 省份、地市、区描述
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class LocationController {
|
||||
|
||||
@Resource
|
||||
LocationService locationService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取省份信息
|
||||
*
|
||||
* @return 省份信息
|
||||
*/
|
||||
@PostMapping("only/provinces")
|
||||
public MyResp<OnlyProvinceResp> getOnlyProvinces() {
|
||||
OnlyProvinceResp onlyProvinceResp = locationService.getOnlyProvinces();
|
||||
return MyResp.success(onlyProvinceResp);
|
||||
}
|
||||
/**
|
||||
* 获取省份及省份对应的地市信息
|
||||
*
|
||||
* @return 省份及省份对应的地市信息
|
||||
*/
|
||||
@PostMapping("provinces")
|
||||
public MyResp<ProvinceRespDTO> getProvinces(@RequestBody ProvinceSearchDTO provinceSearchDTO) {
|
||||
ProvinceRespDTO provinceResp = locationService.getProvinces(provinceSearchDTO);
|
||||
return MyResp.success(provinceResp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取地市及地市对应的区信息
|
||||
*
|
||||
* @return 地市及地市对应的区信息
|
||||
*/
|
||||
@PostMapping("citys")
|
||||
public MyResp<CityRespDTO> getCity(@RequestBody CitySearchDTO citySearchDTO) {
|
||||
CityRespDTO cityResp = locationService.getCity(citySearchDTO);
|
||||
return MyResp.success(cityResp);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.zjyr.beidouservice.mapper;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dataobject.DevAttributesDO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DevMaunDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DevAttributesMapper {
|
||||
|
||||
List<DevMaunDTO> selectManuByManufacturer(@Param("deviceId") Long deviceId,
|
||||
@Param("manufacturer") String manufacturer);
|
||||
|
||||
|
||||
List<DevAttributesDO> selectManuAll();
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.zjyr.beidouservice.mapper;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dataobject.DevBasicInfoDO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceInfoByLocDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DevBasicInfoMapper {
|
||||
|
||||
List<DevBasicInfoDO> selectDeviceByLoc(DeviceInfoByLocDTO deviceInfoByLocDTO);
|
||||
|
||||
|
||||
DevBasicInfoDO selectDeviceByDeviceId(@Param("deviceId") Long deviceId);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.zjyr.beidouservice.mapper;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dataobject.DevTaskDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DevTaskMapper {
|
||||
|
||||
List<DevTaskDO> selectDevTaskByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.zjyr.beidouservice.mapper;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dataobject.LocCityDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface LocCityMapper {
|
||||
|
||||
List<LocCityDO> selectCityByProvince(@Param("provinceCode") String provinceCode);
|
||||
|
||||
|
||||
List<LocCityDO> selectCity(@Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.zjyr.beidouservice.mapper;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dataobject.LocCountyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface LocCountyMapper {
|
||||
|
||||
List<LocCountyDO> selectCountyByCity(@Param("provinceCode") String provinceCode,
|
||||
@Param("cityCode") String cityCode);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.zjyr.beidouservice.mapper;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dataobject.LocProvinceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface LocProvinceMapper {
|
||||
|
||||
List<LocProvinceDO> selectAllProvince();
|
||||
List<LocProvinceDO> selectProvince(@Param("provinceCode") String provinceCode);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.zjyr.beidouservice.mapper;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dataobject.TaskDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TaskMapper {
|
||||
|
||||
List<TaskDO> selectAllTask();
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.zjyr.beidouservice.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MyResp<T> {
|
||||
|
||||
private int code = Resp.SUCCESS.getCede();
|
||||
private String msg;
|
||||
private T data;
|
||||
|
||||
public static MyResp build() {
|
||||
return new MyResp();
|
||||
}
|
||||
|
||||
public static MyResp result(Resp resp) {
|
||||
return MyResp.builder()
|
||||
.code(resp.getCede())
|
||||
.msg(resp.getMsg())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static <T> MyResp success(T data) {
|
||||
return MyResp.builder()
|
||||
.code(Resp.SUCCESS.getCede())
|
||||
.msg(Resp.SUCCESS.getMsg())
|
||||
.data(data)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static MyResp error(Resp respEnum) {
|
||||
return MyResp.builder()
|
||||
.code(respEnum.getCede())
|
||||
.msg(respEnum.getMsg())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.zjyr.beidouservice.pojo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public enum Resp {
|
||||
//成功返回码
|
||||
SUCCESS(200, "SUCCESS");
|
||||
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
Resp(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getCede() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("code", code);
|
||||
json.put("msg", msg);
|
||||
return json.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.zjyr.beidouservice.pojo.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DevAttributesDO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
private Integer deviceStatus;
|
||||
|
||||
/**
|
||||
* 警报器型号
|
||||
*/
|
||||
private String alarmModel;
|
||||
|
||||
/**
|
||||
* 警报器状态
|
||||
*/
|
||||
private String alarmStatus;
|
||||
|
||||
/**
|
||||
* 警报器类型
|
||||
*/
|
||||
private Integer alarmType;
|
||||
|
||||
/**
|
||||
* 警报器功率
|
||||
*/
|
||||
private Integer alarmPower;
|
||||
|
||||
/**
|
||||
* 警报器厂家
|
||||
*/
|
||||
private Integer alarmManufacturer;
|
||||
|
||||
/**
|
||||
* 警报器安装时间
|
||||
*/
|
||||
private Date alarmInstallTime;
|
||||
|
||||
/**
|
||||
* 控制器型号
|
||||
*/
|
||||
private String controlModel;
|
||||
/**
|
||||
* 控制器状态
|
||||
*/
|
||||
private Integer controlStatus;
|
||||
|
||||
/**
|
||||
* 控制器厂家
|
||||
*/
|
||||
private Integer controlManufacturer;
|
||||
|
||||
/**
|
||||
* 控制器安装时间
|
||||
*/
|
||||
private Date controlInstallTime;
|
||||
|
||||
/**
|
||||
* 后备电源型号
|
||||
*/
|
||||
private String powerModel;
|
||||
|
||||
/**
|
||||
* 后备电源状态
|
||||
*/
|
||||
private Integer powerStatus;
|
||||
|
||||
/**
|
||||
* 后备电源类型
|
||||
*/
|
||||
private Integer powerType;
|
||||
|
||||
/**
|
||||
* 后备电源功率
|
||||
*/
|
||||
private Integer power;
|
||||
|
||||
/**
|
||||
* 后备电源厂家
|
||||
*/
|
||||
private Integer powerManufacturer;
|
||||
|
||||
/**
|
||||
* 后备电源安装时间
|
||||
*/
|
||||
private Date powerInstallTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.zjyr.beidouservice.pojo.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DevBasicInfoDO implements Serializable {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备描述
|
||||
*/
|
||||
private String deviceDesc;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区编码
|
||||
*/
|
||||
private String countyCode;
|
||||
|
||||
|
||||
/**
|
||||
* 所属单位
|
||||
*/
|
||||
private String subordinateUnits;
|
||||
|
||||
/**
|
||||
* 控制站编号
|
||||
*/
|
||||
private Integer controlStationId;
|
||||
|
||||
/**
|
||||
* 管理员
|
||||
*/
|
||||
private String administrator;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 安装地址
|
||||
*/
|
||||
private String installAddr;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private String latitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private String longitude;
|
||||
|
||||
/**
|
||||
* 设备数据、预留字段
|
||||
*/
|
||||
private String devData;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.zjyr.beidouservice.pojo.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DevTaskDO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id,前端界面的记录编号,可以按照规则添加前缀名
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 控制模式 0:无声演练模式 1:大声警报模式
|
||||
*/
|
||||
private Integer controlMode;
|
||||
|
||||
/**
|
||||
* 区id=?区编码
|
||||
*/
|
||||
private String countyCode;
|
||||
|
||||
/**
|
||||
* 控制类型:。1:单点控制 2:市属控制 3:区属控制
|
||||
*/
|
||||
private Integer controlType;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 执行命令
|
||||
*/
|
||||
private String execCmd;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
private Integer execState;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.zjyr.beidouservice.pojo.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LocCityDO implements Serializable {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 地市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市北斗号
|
||||
*/
|
||||
private String beidouBroadcastId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.zjyr.beidouservice.pojo.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LocCountyDO implements Serializable {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 区名称
|
||||
*/
|
||||
private String countyName;
|
||||
|
||||
/**
|
||||
* 区编码
|
||||
*/
|
||||
private String countyCode;
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市北斗号
|
||||
*/
|
||||
private String beidouBroadcastId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.zjyr.beidouservice.pojo.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LocProvinceDO implements Serializable {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 省份名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package com.zjyr.beidouservice.pojo.dataobject;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaskDO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id,前端界面的记录编号,可以按照规则添加前缀名
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 控制通道。2:无线 3:北斗 4:电话 5:all
|
||||
*/
|
||||
private Integer controlChannel;
|
||||
|
||||
/**
|
||||
* 北斗号,如果以市为单位,则携带市北斗号,区为单位携带区北斗号,具体设备则携带区北斗号
|
||||
*/
|
||||
private Integer beidouId;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区编码
|
||||
*/
|
||||
private String countyCode;
|
||||
|
||||
/**
|
||||
* 设备id,多个设备,相隔
|
||||
*/
|
||||
private String deviceIds;
|
||||
|
||||
/**
|
||||
* 执行设备数量
|
||||
*/
|
||||
private Integer deviceNum;
|
||||
|
||||
/**
|
||||
* 执行正常设备数量
|
||||
*/
|
||||
private Integer execNormalNum;
|
||||
|
||||
/**
|
||||
* 执行异常设备数量
|
||||
*/
|
||||
private Integer execAbnormalNum;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AlarmDevContentDTO {
|
||||
/**
|
||||
* 警报器设备类型
|
||||
*/
|
||||
private String alarmType;
|
||||
/**
|
||||
* 该类型的数量
|
||||
*/
|
||||
private Integer alarmNum;
|
||||
|
||||
/**
|
||||
* 该类型的占比
|
||||
*/
|
||||
private Double alarmRatio;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AlarmDevRespDTO {
|
||||
/**
|
||||
* 警报器设备总数
|
||||
*/
|
||||
private Integer alarmDevTotalNum;
|
||||
|
||||
/**
|
||||
* 警报器设备类型、数量、占比
|
||||
*/
|
||||
private List<AlarmDevContentDTO> data;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DevMaunDTO {
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 警报器厂家
|
||||
*/
|
||||
private Integer alarmManufacturer;
|
||||
|
||||
/**
|
||||
* 控制器厂家
|
||||
*/
|
||||
private Integer controlManufacturer;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceInfoByLocDTO {
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区编码
|
||||
*/
|
||||
private String countyCode;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceReqDTO {
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区编码
|
||||
*/
|
||||
private String countyCode;
|
||||
|
||||
/**
|
||||
* 厂家
|
||||
*/
|
||||
private String manufacturer;
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceRespDTO {
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区编码
|
||||
*/
|
||||
private String countyCode;
|
||||
|
||||
/**
|
||||
* 安装地址,用于展示经纬度
|
||||
*/
|
||||
private String installAddr;
|
||||
|
||||
/**
|
||||
* 警报器厂家
|
||||
*/
|
||||
private String alarmManufacturer;
|
||||
|
||||
/**
|
||||
* 控制器厂家
|
||||
*/
|
||||
private String controlManufacturer;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceTaskContentDTO {
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
|
||||
/**
|
||||
* 回示时间
|
||||
*/
|
||||
private Date respTime;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
private String execStateMsg;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceTaskRespDTO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务id,前端界面的记录编号,可以按照规则添加前缀名
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
private Date recodeTime;
|
||||
|
||||
/**
|
||||
* 执行设备数量
|
||||
*/
|
||||
private Integer deviceNum;
|
||||
|
||||
/**
|
||||
* 执行正常设备数量
|
||||
*/
|
||||
private Integer execNormalNum;
|
||||
|
||||
/**
|
||||
* 执行异常设备数量
|
||||
*/
|
||||
private Integer execAbnormalNum;
|
||||
|
||||
/**
|
||||
* 回市率 回示率通常用于描述在特定时间段内对特定请求或行动的响应数量与总请求数量之间的比率
|
||||
*/
|
||||
private Double respRate;
|
||||
|
||||
/**
|
||||
* 任务详细信息
|
||||
*/
|
||||
private List<DeviceTaskContentDTO> data;
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ManufacturerContentDTO {
|
||||
|
||||
/**
|
||||
* 厂家名称
|
||||
*/
|
||||
private String ManufacturerName;
|
||||
|
||||
/**
|
||||
* 厂家编码
|
||||
*/
|
||||
private Integer ManufacturerType;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.zjyr.beidouservice.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ManufacturerRespDTO {
|
||||
|
||||
|
||||
List<ManufacturerContentDTO> data;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.city;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CityContent {
|
||||
/**
|
||||
* 地市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 地市对应的区信息
|
||||
*/
|
||||
private List<CountyContent> countyList;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.city;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CityCountyDTO {
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
/**
|
||||
* 地市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 地市包含的区信息
|
||||
*/
|
||||
List<CountyContent> countyList;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.city;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CityRespDTO {
|
||||
|
||||
List<CityCountyDTO> cityList;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.city;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CitySearchDTO implements Serializable {
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.city;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CountyContent {
|
||||
/**
|
||||
* 区名称
|
||||
*/
|
||||
private String countyName;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String countyCode;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.province;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CityContentDTO {
|
||||
/**
|
||||
* 地市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 地市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.province;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class OnlyProvinceContentDTO {
|
||||
/**
|
||||
* 省份名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.province;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class OnlyProvinceResp {
|
||||
List<OnlyProvinceContentDTO> onlyProvinceList;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.province;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class ProvinceContent {
|
||||
/**
|
||||
* 省份名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* s省对应的地市信息
|
||||
*/
|
||||
private List<CityContentDTO> cityList;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.province;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class ProvinceRespDTO {
|
||||
/**
|
||||
* 省份信息
|
||||
*/
|
||||
List<ProvinceContent> provinceList;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.zjyr.beidouservice.pojo.dto.province;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProvinceSearchDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
private String provinceCode;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.zjyr.beidouservice.service;
|
||||
import com.zjyr.beidouservice.pojo.dto.AlarmDevRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceReqDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.ManufacturerRespDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface DeviceService {
|
||||
/**
|
||||
* 获取省份信息
|
||||
*
|
||||
* @return 省份信息
|
||||
*/
|
||||
List<DeviceRespDTO> getDeviceInfo(DeviceReqDTO deviceReqDTO);
|
||||
|
||||
/**
|
||||
* 获取厂家信息
|
||||
*
|
||||
* @return 厂家信息
|
||||
*/
|
||||
ManufacturerRespDTO getDeviceManufacturerInfo();
|
||||
|
||||
/**
|
||||
* 获取警报终端信息
|
||||
*
|
||||
* @return 省份信息
|
||||
*/
|
||||
AlarmDevRespDTO getAlarmDeviceInfo();
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.zjyr.beidouservice.service;
|
||||
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceTaskService {
|
||||
/**
|
||||
* 获取任务信息
|
||||
*
|
||||
* @return DeviceTaskRespDTO
|
||||
*/
|
||||
List<DeviceTaskRespDTO> getDeviceTaskInfo();
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.zjyr.beidouservice.service;
|
||||
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CityRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CitySearchDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.OnlyProvinceResp;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.ProvinceSearchDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.ProvinceRespDTO;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LocationService {
|
||||
/**
|
||||
* 获取省份信息
|
||||
*
|
||||
* @return 省份信息
|
||||
*/
|
||||
OnlyProvinceResp getOnlyProvinces();
|
||||
|
||||
/**
|
||||
* 获取省份信息
|
||||
*
|
||||
* @return ProvinceRespDTO
|
||||
*/
|
||||
ProvinceRespDTO getProvinces(ProvinceSearchDTO provinceSearchDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 获取地市信息
|
||||
*
|
||||
* @return CityRespDTO
|
||||
*/
|
||||
CityRespDTO getCity(CitySearchDTO citySearchDTO);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package com.zjyr.beidouservice.service.impl;
|
||||
|
||||
import com.zjyr.beidouservice.constenum.AlarmTypeEnum;
|
||||
import com.zjyr.beidouservice.constenum.ManufacturerTypeEnum;
|
||||
import com.zjyr.beidouservice.mapper.DevAttributesMapper;
|
||||
import com.zjyr.beidouservice.mapper.DevBasicInfoMapper;
|
||||
import com.zjyr.beidouservice.pojo.dataobject.DevAttributesDO;
|
||||
import com.zjyr.beidouservice.pojo.dataobject.DevBasicInfoDO;
|
||||
import com.zjyr.beidouservice.pojo.dto.AlarmDevContentDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.AlarmDevRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DevMaunDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceInfoByLocDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceReqDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.ManufacturerContentDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.ManufacturerRespDTO;
|
||||
import com.zjyr.beidouservice.service.DeviceService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DeviceServiceImpl implements DeviceService {
|
||||
|
||||
@Resource
|
||||
DevBasicInfoMapper devBasicInfoMapper;
|
||||
|
||||
@Resource
|
||||
DevAttributesMapper devAttributesMapper;
|
||||
|
||||
@Override
|
||||
public List<DeviceRespDTO> getDeviceInfo(DeviceReqDTO deviceReqDTO) {
|
||||
log.info("get device info : [{}]", deviceReqDTO);
|
||||
List<DeviceRespDTO> deviceRespList = new ArrayList<>();
|
||||
|
||||
//根据省份、地市、区信息查询设备
|
||||
DeviceInfoByLocDTO searchDTO = new DeviceInfoByLocDTO();
|
||||
searchDTO.setProvinceCode(deviceReqDTO.getProvinceCode());
|
||||
searchDTO.setCityCode(deviceReqDTO.getCityCode());
|
||||
searchDTO.setCountyCode(deviceReqDTO.getCountyCode());
|
||||
log.info("device search info : [{}]", searchDTO);
|
||||
|
||||
List<DevBasicInfoDO> devBasicInfoList = devBasicInfoMapper.selectDeviceByLoc(searchDTO);
|
||||
if (devBasicInfoList.isEmpty()) {
|
||||
log.warn("根据省份、地市、区编码未查找到设备信息");
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
devBasicInfoList.forEach(dev -> {
|
||||
Long deviceId = dev.getDeviceId();
|
||||
String manufacturer = deviceReqDTO.getManufacturer();
|
||||
List<DevMaunDTO> devMaunDTO = devAttributesMapper.selectManuByManufacturer(deviceId, manufacturer);
|
||||
//根据过滤过厂商的device查找device基本信息
|
||||
devMaunDTO.forEach(v -> {
|
||||
DeviceRespDTO deviceResp = new DeviceRespDTO();
|
||||
deviceResp.setDeviceId(v.getDeviceId());
|
||||
deviceResp.setAlarmManufacturer(ManufacturerTypeEnum.getByCode(v.getAlarmManufacturer()));
|
||||
deviceResp.setControlManufacturer(ManufacturerTypeEnum.getByCode(v.getControlManufacturer()));
|
||||
|
||||
//根据deviceId查找device basic info
|
||||
DevBasicInfoDO devBasicInfo = devBasicInfoMapper.selectDeviceByDeviceId(v.getDeviceId());
|
||||
deviceResp.setDeviceName(devBasicInfo.getDeviceName());
|
||||
deviceResp.setProvinceCode(devBasicInfo.getProvinceCode());
|
||||
deviceResp.setCityCode(devBasicInfo.getCityCode());
|
||||
deviceResp.setCountyCode(devBasicInfo.getCountyCode());
|
||||
|
||||
deviceRespList.add(deviceResp);
|
||||
});
|
||||
});
|
||||
|
||||
return deviceRespList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManufacturerRespDTO getDeviceManufacturerInfo() {
|
||||
ManufacturerRespDTO manufacturerResp = new ManufacturerRespDTO();
|
||||
//获取厂家名称和类型
|
||||
List<ManufacturerContentDTO> contents = new ArrayList<>();
|
||||
List<Integer> codeList = ManufacturerTypeEnum.getAllCodes();
|
||||
codeList.forEach(v->{
|
||||
ManufacturerContentDTO content = new ManufacturerContentDTO();
|
||||
content.setManufacturerType(v);
|
||||
content.setManufacturerName(ManufacturerTypeEnum.getByCode(v));
|
||||
|
||||
contents.add(content);
|
||||
});
|
||||
|
||||
manufacturerResp.setData(contents);
|
||||
return manufacturerResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlarmDevRespDTO getAlarmDeviceInfo() {
|
||||
AlarmDevRespDTO respDTO = new AlarmDevRespDTO();
|
||||
List<AlarmDevContentDTO> contents = new ArrayList<>();
|
||||
|
||||
//获取所有的设备属性信息
|
||||
List<DevAttributesDO> devMaunDTOList = devAttributesMapper.selectManuAll();
|
||||
if (devMaunDTOList.isEmpty()) {
|
||||
log.warn("不存在告警终端");
|
||||
return new AlarmDevRespDTO();
|
||||
}
|
||||
|
||||
int totalMum = devMaunDTOList.size();
|
||||
|
||||
//分别过滤出不同的警报器类型
|
||||
List<Integer> typeList = AlarmTypeEnum.getAllCodes();
|
||||
typeList.forEach(type -> {
|
||||
AlarmDevContentDTO content = new AlarmDevContentDTO();
|
||||
String typeMsg = AlarmTypeEnum.getByCode(type);
|
||||
log.info("alarm type :[{}]", typeMsg);
|
||||
|
||||
//过滤出不同类型的设备属性
|
||||
List<DevAttributesDO> devType = devMaunDTOList.stream().filter(v -> v.getAlarmType().equals(type)).collect(Collectors.toList());
|
||||
content.setAlarmType(typeMsg);
|
||||
content.setAlarmNum(devType.size());
|
||||
double ratio = (double) devType.size() / (double) totalMum;
|
||||
content.setAlarmRatio(ratio);
|
||||
|
||||
contents.add(content);
|
||||
});
|
||||
|
||||
respDTO.setAlarmDevTotalNum(totalMum);
|
||||
respDTO.setData(contents);
|
||||
return respDTO;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package com.zjyr.beidouservice.service.impl;
|
||||
|
||||
import com.zjyr.beidouservice.constenum.ExecStatusEnum;
|
||||
import com.zjyr.beidouservice.mapper.DevTaskMapper;
|
||||
import com.zjyr.beidouservice.mapper.TaskMapper;
|
||||
import com.zjyr.beidouservice.pojo.dataobject.DevTaskDO;
|
||||
import com.zjyr.beidouservice.pojo.dataobject.TaskDO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskContentDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
||||
import com.zjyr.beidouservice.service.DeviceTaskService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DeviceTaskServiceImpl implements DeviceTaskService {
|
||||
|
||||
@Resource
|
||||
DevTaskMapper devTaskMapper;
|
||||
|
||||
@Resource
|
||||
TaskMapper taskMapper;
|
||||
|
||||
@Override
|
||||
public List<DeviceTaskRespDTO> getDeviceTaskInfo() {
|
||||
log.info(" get all device task information");
|
||||
List<DeviceTaskRespDTO> respDTOList = new ArrayList<>();
|
||||
|
||||
//获取所有任务id
|
||||
List<TaskDO> taskDOList = taskMapper.selectAllTask();
|
||||
if (taskDOList.isEmpty()) {
|
||||
log.warn("不存在终端设备告警任务");
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
taskDOList.forEach(task -> {
|
||||
DeviceTaskRespDTO taskResp = new DeviceTaskRespDTO();
|
||||
taskResp.setId(task.getId());
|
||||
taskResp.setTaskId(task.getTaskId());
|
||||
//告警任务记录时间为任务创建时间
|
||||
taskResp.setRecodeTime(task.getCreateTime());
|
||||
|
||||
|
||||
//告警任务回示率,收到响应信息的设备数量(执行成功、执行失败)/总设备数量
|
||||
int respNum = task.getExecNormalNum() + task.getExecAbnormalNum();
|
||||
int deviceNum = task.getDeviceNum();
|
||||
double respRate = (double) respNum / (double) deviceNum;
|
||||
|
||||
//告警任务执行设备数量、执行正常数量、执行异常数量、回示率
|
||||
taskResp.setDeviceNum(deviceNum);
|
||||
taskResp.setExecNormalNum(task.getExecNormalNum());
|
||||
taskResp.setExecAbnormalNum(task.getExecAbnormalNum());
|
||||
taskResp.setRespRate(respRate);
|
||||
|
||||
//获取任务id详细信息
|
||||
List<DeviceTaskContentDTO> devTaskContents = new ArrayList<>();
|
||||
List<DevTaskDO> devTaskDOList = devTaskMapper.selectDevTaskByTaskId(task.getTaskId());
|
||||
if (devTaskDOList.isEmpty()) {
|
||||
log.warn("根据任务Id: [{}] 获取不到告警任务详情信息", task.getTaskId());
|
||||
taskResp.setData(new ArrayList<>());
|
||||
}
|
||||
|
||||
devTaskDOList.forEach(devTask -> {
|
||||
DeviceTaskContentDTO devTaskContent = new DeviceTaskContentDTO();
|
||||
devTaskContent.setDeviceId(devTask.getDeviceId());
|
||||
devTaskContent.setDeviceName(devTask.getDeviceName());
|
||||
//回示时间为dev task表中的更新时间,收到执行状态后更新时间
|
||||
devTaskContent.setRespTime(devTask.getUpdateTime());
|
||||
devTaskContent.setExecStateMsg(ExecStatusEnum.getByCode(devTask.getExecState()));
|
||||
|
||||
devTaskContents.add(devTaskContent);
|
||||
|
||||
});
|
||||
|
||||
taskResp.setData(devTaskContents);
|
||||
respDTOList.add(taskResp);
|
||||
|
||||
});
|
||||
|
||||
// 使用自定义比较器按recodeTime排序
|
||||
respDTOList.sort(new Comparator<DeviceTaskRespDTO>() {
|
||||
public int compare(DeviceTaskRespDTO t1, DeviceTaskRespDTO t2) {
|
||||
return t2.getRecodeTime().compareTo(t1.getRecodeTime());
|
||||
}
|
||||
});
|
||||
|
||||
return respDTOList;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,140 @@
|
|||
package com.zjyr.beidouservice.service.impl;
|
||||
|
||||
import com.zjyr.beidouservice.mapper.LocCityMapper;
|
||||
import com.zjyr.beidouservice.mapper.LocCountyMapper;
|
||||
import com.zjyr.beidouservice.mapper.LocProvinceMapper;
|
||||
import com.zjyr.beidouservice.pojo.dataobject.LocCityDO;
|
||||
import com.zjyr.beidouservice.pojo.dataobject.LocCountyDO;
|
||||
import com.zjyr.beidouservice.pojo.dataobject.LocProvinceDO;
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CityCountyDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CityRespDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CitySearchDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.city.CountyContent;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.CityContentDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.OnlyProvinceContentDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.OnlyProvinceResp;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.ProvinceContent;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.ProvinceSearchDTO;
|
||||
import com.zjyr.beidouservice.pojo.dto.province.ProvinceRespDTO;
|
||||
import com.zjyr.beidouservice.service.LocationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LocationServiceImpl implements LocationService {
|
||||
@Resource
|
||||
LocProvinceMapper locProvinceMapper;
|
||||
|
||||
@Resource
|
||||
LocCityMapper locCityMapper;
|
||||
|
||||
@Resource
|
||||
LocCountyMapper locCountyMapper;
|
||||
|
||||
@Override
|
||||
public OnlyProvinceResp getOnlyProvinces() {
|
||||
OnlyProvinceResp onlyProvinceResp = new OnlyProvinceResp();
|
||||
List<OnlyProvinceContentDTO> onlyProvinceList = new ArrayList<>();
|
||||
|
||||
//获取省份信息
|
||||
List<LocProvinceDO> provinceDOS = locProvinceMapper.selectAllProvince();
|
||||
if (provinceDOS.isEmpty()) {
|
||||
log.warn("不存在省份信息");
|
||||
return new OnlyProvinceResp();
|
||||
}
|
||||
|
||||
provinceDOS.forEach(province ->{
|
||||
OnlyProvinceContentDTO onlyProvinceContent = new OnlyProvinceContentDTO();
|
||||
onlyProvinceContent.setProvinceName(province.getProvinceName());
|
||||
onlyProvinceContent.setProvinceCode(province.getProvinceCode());
|
||||
onlyProvinceList.add(onlyProvinceContent);
|
||||
});
|
||||
|
||||
onlyProvinceResp.setOnlyProvinceList(onlyProvinceList);
|
||||
return onlyProvinceResp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProvinceRespDTO getProvinces(ProvinceSearchDTO provinceSearchDTO) {
|
||||
ProvinceRespDTO provinceResp = new ProvinceRespDTO();
|
||||
List<ProvinceContent> provinceContents = new ArrayList<>();
|
||||
|
||||
//获取省份信息
|
||||
String provinceCode = provinceSearchDTO.getProvinceCode();
|
||||
List<LocProvinceDO> provinceDOS = locProvinceMapper.selectProvince(provinceCode);
|
||||
if (provinceDOS.isEmpty()) {
|
||||
log.warn("不存在省份信息");
|
||||
return new ProvinceRespDTO();
|
||||
}
|
||||
|
||||
|
||||
provinceDOS.forEach(province -> {
|
||||
ProvinceContent provinceContent = new ProvinceContent();
|
||||
provinceContent.setProvinceName(province.getProvinceName());
|
||||
provinceContent.setProvinceCode(province.getProvinceCode());
|
||||
|
||||
//根据省份查询对应的地市信息
|
||||
List<CityContentDTO> cityContentDTOList = new ArrayList<>();
|
||||
List<LocCityDO> cityDOList = locCityMapper.selectCityByProvince(province.getProvinceCode());
|
||||
cityDOList.forEach(city -> {
|
||||
CityContentDTO cityContent = new CityContentDTO();
|
||||
cityContent.setCityName(city.getCityName());
|
||||
cityContent.setCityCode(city.getCityCode());
|
||||
cityContentDTOList.add(cityContent);
|
||||
});
|
||||
|
||||
provinceContent.setCityList(cityContentDTOList);
|
||||
provinceContents.add(provinceContent);
|
||||
|
||||
});
|
||||
|
||||
provinceResp.setProvinceList(provinceContents);
|
||||
return provinceResp;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CityRespDTO getCity(CitySearchDTO citySearchDTO) {
|
||||
CityRespDTO cityResp = new CityRespDTO();
|
||||
List<CityCountyDTO> cityContents = new ArrayList<>();
|
||||
|
||||
//获取地市信息
|
||||
String provinceCode = citySearchDTO.getProvinceCode();
|
||||
String cityCode = citySearchDTO.getCityCode();
|
||||
List<LocCityDO> cityDOS = locCityMapper.selectCity(provinceCode, cityCode);
|
||||
if (cityDOS.isEmpty()) {
|
||||
log.warn("不存在地市信息");
|
||||
return new CityRespDTO();
|
||||
}
|
||||
|
||||
cityDOS.forEach(city -> {
|
||||
CityCountyDTO cityContent = new CityCountyDTO();
|
||||
cityContent.setProvinceCode(city.getProvinceCode());
|
||||
cityContent.setCityName(city.getCityName());
|
||||
cityContent.setCityCode(city.getCityCode());
|
||||
|
||||
//根据地市查询对应的区信息
|
||||
List<CountyContent> countyContentList = new ArrayList<>();
|
||||
List<LocCountyDO> countyDOList = locCountyMapper.selectCountyByCity(city.getProvinceCode(), city.getCityCode());
|
||||
countyDOList.forEach(county -> {
|
||||
CountyContent countyContent = new CountyContent();
|
||||
countyContent.setCountyName(county.getCountyName());
|
||||
countyContent.setCountyCode(county.getCountyCode());
|
||||
countyContentList.add(countyContent);
|
||||
});
|
||||
|
||||
cityContent.setCountyList(countyContentList);
|
||||
cityContents.add(cityContent);
|
||||
|
||||
});
|
||||
|
||||
cityResp.setCityList(cityContents);
|
||||
return cityResp;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
<?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.zjyr.beidouservice.mapper.DevAttributesMapper">
|
||||
<resultMap id="device_attributes" type="com.zjyr.beidouservice.pojo.dataobject.DevAttributesDO">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="deviceId" column="device_id" jdbcType="BIGINT"/>
|
||||
<result property="deviceStatus" column="device_status" jdbcType="INTEGER"/>
|
||||
<result property="alarmModel" column="alarm_model" jdbcType="VARCHAR"/>
|
||||
<result property="alarmStatus" column="alarm_status" jdbcType="INTEGER"/>
|
||||
<result property="alarmType" column="alarm_type" jdbcType="INTEGER"/>
|
||||
<result property="alarmPower" column="alarm_power" jdbcType="INTEGER"/>
|
||||
<result property="alarmManufacturer" column="alarm_manufacturer" jdbcType="INTEGER"/>
|
||||
<result property="alarmInstallTime" column="alarm_install_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="controlModel" column="control_model" jdbcType="VARCHAR"/>
|
||||
<result property="controlStatus" column="control_status" jdbcType="INTEGER"/>
|
||||
<result property="controlManufacturer" column="control_manufacturer" jdbcType="INTEGER"/>
|
||||
<result property="controlInstallTime" column="control_install_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="powerModel" column="power_model" jdbcType="VARCHAR"/>
|
||||
<result property="powerStatus" column="power_status" jdbcType="INTEGER"/>
|
||||
<result property="powerType" column="power_type" jdbcType="INTEGER"/>
|
||||
<result property="power" column="power" jdbcType="INTEGER"/>
|
||||
<result property="powerManufacturer" column="power_manufacturer" jdbcType="INTEGER"/>
|
||||
<result property="powerInstallTime" column="power_install_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectManuByManufacturer" resultType="com.zjyr.beidouservice.pojo.dto.DevMaunDTO">
|
||||
select device_id as deviceId,
|
||||
alarm_manufacturer as alarmManufacturer,
|
||||
control_manufacturer as controlManufacturer
|
||||
from device_attributes
|
||||
<where>
|
||||
<if test="deviceId != null">
|
||||
and device_id = #{deviceId}
|
||||
</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">
|
||||
and (alarm_manufacturer = #{manufacturer} or control_manufacturer = #{manufacturer})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectManuAll" resultType="com.zjyr.beidouservice.pojo.dto.DevMaunDTO" resultMap="device_attributes">
|
||||
select *
|
||||
from device_attributes
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,48 @@
|
|||
<?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.zjyr.beidouservice.mapper.DevBasicInfoMapper">
|
||||
<resultMap id="device_basic_info" type="com.zjyr.beidouservice.pojo.dataobject.DevBasicInfoDO">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="deviceId" column="device_id" jdbcType="INTEGER"/>
|
||||
<result property="deviceName" column="device_name" jdbcType="VARCHAR"/>
|
||||
<result property="deviceDesc" column="device_desc" jdbcType="VARCHAR"/>
|
||||
<result property="provinceCode" column="province_code" jdbcType="VARCHAR"/>
|
||||
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
|
||||
<result property="countyCode" column="county_code" jdbcType="VARCHAR"/>
|
||||
<result property="subordinateUnits" column="subordinate_units" jdbcType="VARCHAR"/>
|
||||
<result property="controlStationId" column="control_station_id" jdbcType="INTEGER"/>
|
||||
<result property="administrator" column="administrator" jdbcType="VARCHAR"/>
|
||||
<result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
||||
<result property="installAddr" column="install_addr" jdbcType="VARCHAR"/>
|
||||
<result property="latitude" column="latitude" jdbcType="VARCHAR"/>
|
||||
<result property="longitude" column="longitude" jdbcType="VARCHAR"/>
|
||||
<result property="devData" column="dev_data" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDeviceByLoc" resultType="com.zjyr.beidouservice.pojo.dataobject.DevBasicInfoDO"
|
||||
parameterType="com.zjyr.beidouservice.pojo.dto.DeviceInfoByLocDTO" resultMap="device_basic_info">
|
||||
select *
|
||||
from device_basic_info
|
||||
<where>
|
||||
<if test="provinceCode != null and provinceCode != ''">
|
||||
and province_code = #{provinceCode}
|
||||
</if>
|
||||
<if test="cityCode != null and cityCode != ''">
|
||||
and city_code = #{cityCode}
|
||||
</if>
|
||||
<if test="countyCode != null and countyCode != ''">
|
||||
and county_code = #{countyCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceByDeviceId" resultType="com.zjyr.beidouservice.pojo.dataobject.DevBasicInfoDO"
|
||||
parameterType="java.lang.Long" resultMap="device_basic_info">
|
||||
select *
|
||||
from device_basic_info
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,26 @@
|
|||
<?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.zjyr.beidouservice.mapper.DevTaskMapper">
|
||||
<resultMap id="device_task" type="com.zjyr.beidouservice.pojo.dataobject.DevTaskDO">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
|
||||
<result property="controlMode" column="control_mode" jdbcType="INTEGER"/>
|
||||
<result property="countyCode" column="county_code" jdbcType="VARCHAR"/>
|
||||
<result property="controlType" column="control_type" jdbcType="INTEGER"/>
|
||||
<result property="deviceId" column="device_id" jdbcType="INTEGER"/>
|
||||
<result property="deviceName" column="device_name" jdbcType="VARCHAR"/>
|
||||
<result property="execCmd" column="exec_cmd" jdbcType="VARCHAR"/>
|
||||
<result property="execState" column="exec_state" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDevTaskByTaskId" resultType="com.zjyr.beidouservice.pojo.dataobject.DevTaskDO"
|
||||
parameterType="java.lang.String" resultMap="device_task">
|
||||
select *
|
||||
from device_task
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,40 @@
|
|||
<?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.zjyr.beidouservice.mapper.LocCityMapper">
|
||||
<resultMap id="location_city" type="com.zjyr.beidouservice.pojo.dataobject.LocCityDO">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="cityName" column="city_name" jdbcType="VARCHAR"/>
|
||||
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
|
||||
<result property="provinceCode" column="province_code" jdbcType="VARCHAR"/>
|
||||
<result property="beidouBroadcastId" column="beidou_broadcast_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectCity" resultType="com.zjyr.beidouservice.pojo.dataobject.LocCityDO"
|
||||
parameterType="java.lang.String" resultMap="location_city">
|
||||
select *
|
||||
from location_city
|
||||
<where>
|
||||
<if test="provinceCode != null and provinceCode != ''">
|
||||
and province_code = #{provinceCode}
|
||||
</if>
|
||||
<if test="cityCode != null and cityCode != ''">
|
||||
and city_code = #{cityCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCityByProvince" resultType="com.zjyr.beidouservice.pojo.dataobject.LocCityDO"
|
||||
parameterType="java.lang.String" resultMap="location_city">
|
||||
select *
|
||||
from location_city
|
||||
<where>
|
||||
<if test="provinceCode != null and provinceCode != ''">
|
||||
and province_code = #{provinceCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,30 @@
|
|||
<?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.zjyr.beidouservice.mapper.LocCountyMapper">
|
||||
<resultMap id="location_county" type="com.zjyr.beidouservice.pojo.dataobject.LocCountyDO">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="countyName" column="county_name" jdbcType="VARCHAR"/>
|
||||
<result property="countyCode" column="county_code" jdbcType="VARCHAR"/>
|
||||
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
|
||||
<result property="provinceCode" column="province_code" jdbcType="VARCHAR"/>
|
||||
<result property="beidouBroadcastId" column="beidou_broadcast_id" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCountyByCity" resultType="com.zjyr.beidouservice.pojo.dataobject.LocCountyDO"
|
||||
parameterType="java.lang.String" resultMap="location_county">
|
||||
select *
|
||||
from location_county
|
||||
<where>
|
||||
<if test="provinceCode != null and provinceCode != ''">
|
||||
and province_code = #{provinceCode}
|
||||
</if>
|
||||
<if test="cityCode != null and cityCode != ''">
|
||||
and city_code = #{cityCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,30 @@
|
|||
<?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.zjyr.beidouservice.mapper.LocProvinceMapper">
|
||||
<resultMap id="location_province" type="com.zjyr.beidouservice.pojo.dataobject.LocProvinceDO">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="provinceName" column="province_name" jdbcType="VARCHAR"/>
|
||||
<result property="provinceCode" column="province_code" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectAllProvince" resultType="com.zjyr.beidouservice.pojo.dataobject.LocProvinceDO"
|
||||
resultMap="location_province">
|
||||
select *
|
||||
from location_province
|
||||
</select>
|
||||
|
||||
<select id="selectProvince" resultType="com.zjyr.beidouservice.pojo.dataobject.LocProvinceDO"
|
||||
resultMap="location_province">
|
||||
select *
|
||||
from location_province
|
||||
<where>
|
||||
<if test="provinceCode != null and provinceCode != ''">
|
||||
and province_code = #{provinceCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,26 @@
|
|||
<?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.zjyr.beidouservice.mapper.TaskMapper">
|
||||
<resultMap id="task" type="com.zjyr.beidouservice.pojo.dataobject.TaskDO">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
|
||||
<result property="controlChannel" column="control_channel" jdbcType="INTEGER"/>
|
||||
<result property="beidouId" column="beidou_id" jdbcType="INTEGER"/>
|
||||
<result property="provinceCode" column="province_code" jdbcType="VARCHAR"/>
|
||||
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
|
||||
<result property="countyCode" column="county_code" jdbcType="VARCHAR"/>
|
||||
<result property="deviceIds" column="device_ids" jdbcType="VARCHAR"/>
|
||||
<result property="deviceNum" column="device_num" jdbcType="INTEGER"/>
|
||||
<result property="execNormalNum" column="exec_normal_num" jdbcType="INTEGER"/>
|
||||
<result property="execAbnormalNum" column="exec_abnormal_num" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectAllTask" resultType="com.zjyr.beidouservice.pojo.dataobject.TaskDO" resultMap="task">
|
||||
select *
|
||||
from task
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue