新增二级文件夹
parent
5ee190e5a4
commit
421e81282f
@ -0,0 +1,18 @@
|
||||
CREATE TABLE `terminal_main_favors` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name_UNIQUE` (`name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
|
||||
CREATE TABLE `terminal_favors` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`main_id` int DEFAULT NULL COMMENT '一级文件夹id',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name_UNIQUE` (`name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
@ -0,0 +1,87 @@
|
||||
package com.shxy.xymanager_admin.controller;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.shxy.xymanager_common.annotation.Log;
|
||||
import com.shxy.xymanager_common.base.BaseController;
|
||||
import com.shxy.xymanager_common.base.ResponseReult;
|
||||
import com.shxy.xymanager_common.bean.ServiceBody;
|
||||
import com.shxy.xymanager_common.bean.ServiceStatus;
|
||||
import com.shxy.xymanager_common.model.OpenTerminalsModel;
|
||||
import com.shxy.xymanager_common.model.TerminalPhotoListForOpenModel;
|
||||
import com.shxy.xymanager_common.model.TerminalStatisticsModel;
|
||||
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
|
||||
import com.shxy.xymanager_common.vo.*;
|
||||
import com.shxy.xymanager_service.service.OpenService;
|
||||
import com.shxy.xymanager_service.service.TerminalPhotoService;
|
||||
import com.shxy.xymanager_service.service.TerminalService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Api(value = "新疆平台接口", tags = "新疆平台相关")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class OpenXJController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
TerminalPhotoService terminalPhotoService;
|
||||
|
||||
@Autowired
|
||||
TerminalService terminalService;
|
||||
|
||||
@Autowired
|
||||
OpenService openService;
|
||||
|
||||
@ApiOperation(value = "新疆设备列表接口", notes = "新疆设备列表接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/getXJDeviceList")
|
||||
@Log(title = "设备列表接口", type = "查询")
|
||||
public ResponseReult<List<OpenTerminalsModel>> getDeviceListForXJ() {
|
||||
ServiceBody<List<OpenTerminalsModel>> serviceBody = openService.getDeviceListForXJ();
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新疆图片查询", notes = "新疆图片查询", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
||||
@RequestMapping("/getXJPhotoList")
|
||||
@Log(title = "对外图片查询", type = "查询")
|
||||
public ResponseReult<TerminalPhotoListForOpenModel> getXJPhotoList(@RequestHeader HttpHeaders headers, @RequestBody @Validated OpenTerminalAndTimeVo vo) {
|
||||
String requestIp = HeaderUtil.getRequestIp(headers);
|
||||
ServiceBody<TerminalPhotoListForOpenModel> serviceBody = terminalPhotoService.getPhotoListForOpen(requestIp, vo);
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新疆远程拍照(短视频)控制", notes = "新疆远程拍照(短视频)控制接口", httpMethod = "POST")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 1, message = "设备参数缺少"), @ApiResponse(code = 2, message = "设备不存在")})
|
||||
@RequestMapping("/ctrlXJCmaDeviceCapture")
|
||||
@Log(title = "远程拍照(短视频)控制", type = "查询")
|
||||
public ResponseReult<String> ctrlCmaDeviceCapture(@RequestBody @Validated OpenXJDeviceCaptureVo vo) {
|
||||
ServiceBody<String> serviceBody = openService.ctrlXJCmaDeviceCapture(vo);
|
||||
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
||||
return ResponseReult.success(serviceBody.getData());
|
||||
} else {
|
||||
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.shxy.xymanager_common.dto;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import com.shxy.xymanager_common.enums.CommonStatus;
|
||||
import com.shxy.xymanager_common.util.MyDateUtils;
|
||||
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "对外设备列表", description = "对外设备列表")
|
||||
public class OpenTerminalsAndStatusDto implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", example = "123456")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "装置编号", example = "123456")
|
||||
private String cmdid;
|
||||
|
||||
@ApiModelProperty(value = "装置原始编号", example = "123456")
|
||||
private Short orgId;
|
||||
|
||||
@ApiModelProperty(value = "装置名称", example = "123456")
|
||||
private String equipName;
|
||||
|
||||
@ApiModelProperty(value = "装置显示名称", example = "123456")
|
||||
private String displayName;
|
||||
|
||||
private String model;
|
||||
|
||||
@ApiModelProperty(value = "装置出厂版本", example = "123456")
|
||||
private String essentialInfoVersion;
|
||||
|
||||
private Integer hasPan;
|
||||
|
||||
@ApiModelProperty(value = "装置生产厂家", example = "123456")
|
||||
private String bsManufacturer;
|
||||
|
||||
@ApiModelProperty(value = "装置生产日期", example = "123456")
|
||||
private Date bsProductionDate;
|
||||
|
||||
@ApiModelProperty(value = "装置出厂编号", example = "123456")
|
||||
private String bsIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "纬度", example = "123456")
|
||||
private Double latitude;
|
||||
|
||||
@ApiModelProperty(value = "经度", example = "123456")
|
||||
private Double longitude;
|
||||
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "规约编号", example = "123456")
|
||||
private Integer protocol;
|
||||
|
||||
private Short signalStrength4g;
|
||||
|
||||
private BigInteger bootTime;
|
||||
|
||||
private float batteryCapacity;
|
||||
|
||||
private float batteryVoltage;
|
||||
|
||||
private BigInteger lastHeartbeat;
|
||||
|
||||
@ApiModelProperty(value = "在线状态", example = "0--掉线1--在线")
|
||||
private Integer onlinestatus;
|
||||
|
||||
public Integer getOnlinestatus() {
|
||||
if (lastHeartbeat == null) {
|
||||
return CommonStatus.DELETE.value();
|
||||
}
|
||||
long time = MyDateUtils.TimeSecond2MillSecond(lastHeartbeat.longValue());
|
||||
DateTime date = MyDateUtils.date(time);
|
||||
long between = MyDateUtils.between(MyDateUtils.getNowDate(), date, DateUnit.MINUTE);
|
||||
if (between > TerminalUtils.hearttime) {
|
||||
return CommonStatus.DELETE.value();
|
||||
} else {
|
||||
return CommonStatus.EFFECTIVE.value();
|
||||
}
|
||||
}
|
||||
private String sim;
|
||||
private Date workingDate;
|
||||
private Integer netType;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.shxy.xymanager_common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TerminalMainFavors implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
@ -0,0 +1,451 @@
|
||||
package com.shxy.xymanager_common.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class TerminalMainFavorsExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public TerminalMainFavorsExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(Date value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Date value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Date value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(Date value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<Date> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.shxy.xymanager_common.model;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import com.shxy.xymanager_common.enums.CommonStatus;
|
||||
import com.shxy.xymanager_common.util.MyDateUtils;
|
||||
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "对外设备列表", description = "对外设备列表")
|
||||
public class OpenTerminalsModel implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", example = "123456")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "装置编号", example = "123456")
|
||||
private String cmdid;
|
||||
|
||||
@ApiModelProperty(value = "装置显示名称", example = "123456")
|
||||
private String displayName;
|
||||
|
||||
@ApiModelProperty(value = "装置出厂版本", example = "123456")
|
||||
private String essentialInfoVersion;
|
||||
|
||||
@ApiModelProperty(value = "装置生产厂家", example = "123456")
|
||||
private String bsManufacturer;
|
||||
|
||||
@ApiModelProperty(value = "装置生产日期", example = "123456")
|
||||
private Date bsProductionDate;
|
||||
|
||||
@ApiModelProperty(value = "装置出厂编号", example = "123456")
|
||||
private String bsIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "纬度", example = "123456")
|
||||
private Double latitude;
|
||||
|
||||
@ApiModelProperty(value = "经度", example = "123456")
|
||||
private Double longitude;
|
||||
|
||||
@ApiModelProperty(value = "规约编号", example = "123456")
|
||||
private Integer protocol;
|
||||
|
||||
@ApiModelProperty(value = "最后一次心跳时间", example = "123456")
|
||||
private BigInteger lastHeartbeat;
|
||||
|
||||
@ApiModelProperty(value = "在线状态", example = "0--掉线1--在线")
|
||||
private Integer onlinestatus;
|
||||
|
||||
public Integer getOnlinestatus() {
|
||||
if (lastHeartbeat == null) {
|
||||
return CommonStatus.DELETE.value();
|
||||
}
|
||||
long time = MyDateUtils.TimeSecond2MillSecond(lastHeartbeat.longValue());
|
||||
DateTime date = MyDateUtils.date(time);
|
||||
long between = MyDateUtils.between(MyDateUtils.getNowDate(), date, DateUnit.MINUTE);
|
||||
if (between > TerminalUtils.hearttime) {
|
||||
return CommonStatus.DELETE.value();
|
||||
} else {
|
||||
return CommonStatus.EFFECTIVE.value();
|
||||
}
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.shxy.xymanager_common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "新疆抓拍参数", description = "新疆抓拍参数描述")
|
||||
public class OpenXJDeviceCaptureVo {
|
||||
|
||||
@ApiModelProperty(value = "装置编号", example = "123455")
|
||||
private String cmdId;
|
||||
|
||||
@ApiModelProperty(value = "操作", example = "1--拍照 2--拍视频")
|
||||
private Integer operateType;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.shxy.xymanager_dao.dao;
|
||||
|
||||
import com.shxy.xymanager_common.entity.TerminalMainFavors;
|
||||
import com.shxy.xymanager_common.entity.TerminalMainFavorsExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TerminalMainFavorsDao {
|
||||
long countByExample(TerminalMainFavorsExample example);
|
||||
|
||||
int deleteByExample(TerminalMainFavorsExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TerminalMainFavors record);
|
||||
|
||||
int insertSelective(TerminalMainFavors record);
|
||||
|
||||
List<TerminalMainFavors> selectByExample(TerminalMainFavorsExample example);
|
||||
|
||||
TerminalMainFavors selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") TerminalMainFavors record, @Param("example") TerminalMainFavorsExample example);
|
||||
|
||||
int updateByExample(@Param("record") TerminalMainFavors record, @Param("example") TerminalMainFavorsExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(TerminalMainFavors record);
|
||||
|
||||
int updateByPrimaryKey(TerminalMainFavors record);
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
<?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.shxy.xymanager_dao.dao.TerminalMainFavorsDao">
|
||||
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalMainFavors">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.shxy.xymanager_common.entity.TerminalMainFavorsExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from terminal_main_favors
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from terminal_main_favors
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from terminal_main_favors
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.shxy.xymanager_common.entity.TerminalMainFavorsExample">
|
||||
delete from terminal_main_favors
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalMainFavors">
|
||||
insert into terminal_main_favors (id, name, create_time,
|
||||
update_time)
|
||||
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalMainFavors">
|
||||
insert into terminal_main_favors
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.shxy.xymanager_common.entity.TerminalMainFavorsExample" resultType="java.lang.Long">
|
||||
select count(*) from terminal_main_favors
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update terminal_main_favors
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update terminal_main_favors
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalMainFavors">
|
||||
update terminal_main_favors
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalMainFavors">
|
||||
update terminal_main_favors
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue