I2新增查询功能

master
liuguijing 1 year ago
parent fc1e415fb1
commit 4804848466

@ -40,6 +40,22 @@
<type>pom</type>
</dependency>
<!-- SpringBoot Web容器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- SpringBoot 拦截器 -->
<dependency>
<groupId>org.springframework.boot</groupId>

@ -0,0 +1,17 @@
package com.shxy.i2.bean;
/**
* API
*
*/
public interface IErrorCode {
/**
*
*/
int getCode();
/**
*
*/
String getMessage();
}

@ -0,0 +1,34 @@
package com.shxy.i2.bean;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
* 线
*/
@Data
public class ListModel implements Serializable {
private List<Beans> list = new ArrayList<>();
@Data
public static class Beans {
private String name;
private BigInteger history;//历史数据量
private BigInteger uploadnum;//已上传数据量
private BigInteger nownum;//今日数据量
private BigInteger nowuploadnum;//今日上传数据量
}
}

@ -0,0 +1,121 @@
package com.shxy.i2.bean;
import cn.hutool.http.HttpStatus;
import java.io.Serializable;
public class ResponseReult<T> implements Serializable {
/**
*
*/
private T data;
/**
*
*/
private int code;
/**
*
*/
private String msg;
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public void setCode(int code, String msg) {
this.code = code;
this.msg = msg;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
/**
*
*
* @return
*/
public static <T> ResponseReult<T> success(T obj) {
ResponseReult<T> success = ResponseReult.success();
if (obj != null) {
success.setData(obj);
}
return success;
}
/**
*
*
* @return
*/
public static <T> ResponseReult<T> success() {
ResponseReult<T> response = new ResponseReult<>();
response.setCode(HttpStatus.HTTP_OK, "操作成功");
return response;
}
/**
*
*
* @param message
*/
public static <T> ResponseReult<T> fail(String message) {
return ResponseReult.error(HttpStatus.HTTP_BAD_REQUEST, message);
}
public static <T> ResponseReult<T> fail(int code, String msg) {
ResponseReult<T> response = new ResponseReult<>();
response.setCode(code, msg);
return response;
}
/**
*
*
* @return
*/
public static <T> ResponseReult<T> error(int code, String msg) {
ResponseReult<T> response = new ResponseReult<>();
response.setCode(code, msg);
return response;
}
/**
*
*
* @param errorCode
*/
public static <T> ResponseReult<T> error(IErrorCode errorCode) {
return ResponseReult.error(errorCode.getCode(), errorCode.getMessage());
}
/**
*
*
* @param message
*/
public static <T> ResponseReult<T> error(String message) {
return ResponseReult.error(HttpStatus.HTTP_INTERNAL_ERROR, message);
}
}

@ -0,0 +1,25 @@
package com.shxy.i2.bean;
import lombok.Data;
/**
* service
*
* @author
*/
@Data
public class ServiceBody<T> {
/**
*
*/
private T data;
/**
*
*/
private int code;
/**
*
*/
private String msg;
}

@ -0,0 +1,17 @@
package com.shxy.i2.bean;
/**
*
*
* @author xzg
*/
public class ServiceStatus {
/**
*
*/
public static final int SUCCESS = 200;
/**
*
*/
public static final int ERROR = 400;
}

@ -0,0 +1,32 @@
package com.shxy.i2.controller;
import com.shxy.i2.bean.ListModel;
import com.shxy.i2.bean.ResponseReult;
import com.shxy.i2.bean.ServiceBody;
import com.shxy.i2.bean.ServiceStatus;
import com.shxy.i2.service.XydlI2Service;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
public class CheckController {
@Autowired
XydlI2Service xydlI2Service;
@RequestMapping("/list")
public ResponseReult<ListModel> list() {
ServiceBody<ListModel> serviceBody = xydlI2Service.list();
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -15,6 +15,10 @@ public interface Data_Byq_JbfdDao {
List<Data_Byq_Jbfd> selectUpload(@Param("isupload") Integer isupload);
Data_Byq_Jbfd selectMaxId();
Data_Byq_Jbfd selectNowId(@Param("date") Date date);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Byq_Jbfd;
import com.shxy.i2.entity.Data_Cnj;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_CnjDao {
List<Data_Cnj> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Cnj selectMaxId();
Data_Cnj selectNowId(@Param("date") Date date);
List<Data_Cnj> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Cnj;
import com.shxy.i2.entity.Data_Dcyw;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_DcywDao {
List<Data_Dcyw> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Dcyw selectMaxId();
Data_Dcyw selectNowId(@Param("date") Date date);
List<Data_Dcyw> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,6 +1,7 @@
package com.shxy.i2.dao;
import com.shxy.i2.bean.SendDataBean;
import com.shxy.i2.entity.Data_Dcyw;
import com.shxy.i2.entity.Data_Dlq_Jbfd;
import org.apache.ibatis.annotations.Param;
@ -13,6 +14,10 @@ public interface Data_Dlq_JbfdDao {
List<Data_Dlq_Jbfd> selectUpload(@Param("isupload") Integer isupload);
Data_Dlq_Jbfd selectMaxId();
Data_Dlq_Jbfd selectNowId(@Param("date") Date date);
List<Data_Dlq_Jbfd> selectUploadById(@Param("maxid") BigInteger maxid);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Dlq_Jbfd;
import com.shxy.i2.entity.Data_Dr_Jyjc;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_Dr_JyjcDao {
List<Data_Dr_Jyjc> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Dr_Jyjc selectMaxId();
Data_Dr_Jyjc selectNowId(@Param("date") Date date);
List<Data_Dr_Jyjc> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Dr_Jyjc;
import com.shxy.i2.entity.Data_Fhdlbx;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,11 @@ public interface Data_FhdlbxDao {
List<Data_Fhdlbx> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Fhdlbx selectMaxId();
Data_Fhdlbx selectNowId(@Param("date") Date date);
List<Data_Fhdlbx> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Fhdlbx;
import com.shxy.i2.entity.Data_Fhzxq;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_FhzxqDao {
List<Data_Fhzxq> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Fhzxq selectMaxId();
Data_Fhzxq selectNowId(@Param("date") Date date);
List<Data_Fhzxq> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Fhzxq;
import com.shxy.i2.entity.Data_Jsyhw_Jyjc;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_Jsyhw_JyjcDao {
List<Data_Jsyhw_Jyjc> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Jsyhw_Jyjc selectMaxId();
Data_Jsyhw_Jyjc selectNowId(@Param("date") Date date);
List<Data_Jsyhw_Jyjc> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Jsyhw_Jyjc;
import com.shxy.i2.entity.Data_Microclimate;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_MicroclimateDao {
List<Data_Microclimate> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Microclimate selectMaxId();
Data_Microclimate selectNowId(@Param("date") Date date);
List<Data_Microclimate> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Microclimate;
import com.shxy.i2.entity.Data_SF6_Qtsf;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_SF6_QtsfDao {
List<Data_SF6_Qtsf> selectUploadById(@Param("maxid") BigInteger maxid);
Data_SF6_Qtsf selectMaxId();
Data_SF6_Qtsf selectNowId(@Param("date") Date date);
List<Data_SF6_Qtsf> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_SF6_Qtsf;
import com.shxy.i2.entity.Data_SF6_Qtyl;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,11 @@ public interface Data_SF6_QtylDao {
List<Data_SF6_Qtyl> selectUploadById(@Param("maxid") BigInteger maxid);
Data_SF6_Qtyl selectMaxId();
Data_SF6_Qtyl selectNowId(@Param("date") Date date);
List<Data_SF6_Qtyl> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,6 +1,8 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_SF6_Qtyl;
import com.shxy.i2.entity.Data_Tx;
import com.shxy.i2.entity.Data_Ysp;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
@ -11,6 +13,10 @@ public interface Data_TxDao {
List<Data_Tx> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Tx selectMaxId();
Data_Tx selectNowId(@Param("date") Date date);
List<Data_Tx> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
@ -18,4 +24,5 @@ public interface Data_TxDao {
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int deleteData(@Param("time") Date time);
}

@ -1,5 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Data_Tx;
import com.shxy.i2.entity.Data_Ws;
import org.apache.ibatis.annotations.Param;
@ -11,6 +12,10 @@ public interface Data_WsDao {
List<Data_Ws> selectUploadById(@Param("maxid") BigInteger maxid);
Data_Ws selectMaxId();
Data_Ws selectNowId(@Param("date") Date date);
List<Data_Ws> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,6 +1,8 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.bean.SendDataBean;
import com.shxy.i2.entity.Data_Byq_Jbfd;
import com.shxy.i2.entity.Data_Ysp;
import org.apache.ibatis.annotations.Param;
@ -24,4 +26,8 @@ public interface Data_YspDao {
int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList<Integer> id, @Param("updateTime") Date updateTime);
int deleteData(@Param("time") Date time);
Data_Ysp selectMaxId();
Data_Ysp selectNowId(@Param("date") Date time);
}

@ -1,6 +1,7 @@
package com.shxy.i2.dao;
import com.shxy.i2.dto.Data_YxlDto;
import com.shxy.i2.entity.Data_Ws;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
@ -11,5 +12,9 @@ public interface Data_YxDao {
List<Data_YxlDto> selectByPrimaryKey(@Param("maxid") BigInteger maxid);
Data_YxlDto selectMaxId();
Data_YxlDto selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
}

@ -5,11 +5,14 @@ import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
public interface Upload_checkDao {
Upload_check selectByPrimaryKey(String checkType);
List<Upload_check> selectAll();
int updateByPrimaryKey(@Param("checkType") String checkType, @Param("value") BigInteger value, @Param("updateTime") Date updateTime);
}

@ -10,6 +10,8 @@ import java.util.List;
public class Data_YxlDto {
BigInteger id;
BigInteger maxid;
BigInteger minid;
Integer sadr;
Date dtime;
Integer ival;

@ -9,6 +9,8 @@ import java.util.Date;
@Data
public class Data_Byq_Jbfd implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Cnj implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Dcyw implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -8,7 +8,8 @@ import java.util.Date;
@Data
public class Data_Dlq_Jbfd implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Dr_Jyjc implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Fhdlbx implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Fhzxq implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Jsyhw_Jyjc implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Microclimate implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_SF6_Qtsf implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -10,7 +10,8 @@ import java.util.Date;
public class Data_SF6_Qtyl implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,6 +9,8 @@ import java.util.Date;
@Data
public class Data_Tx implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;

@ -8,7 +8,8 @@ import java.util.Date;
@Data
public class Data_Ws implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;

@ -9,6 +9,8 @@ import java.util.Date;
@Data
public class Data_Ysp implements Serializable {
private BigInteger id;
private BigInteger maxid;
private BigInteger minid;
private Integer eqmid;

@ -3,12 +3,14 @@ package com.shxy.i2.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
@Data
public class Data_Yx implements Serializable {
private Long id;
private BigInteger maxid;
private BigInteger minid;
private Integer sadr;
private Date dTime;

@ -1,5 +1,7 @@
package com.shxy.i2.service;
import com.shxy.i2.bean.ListModel;
import com.shxy.i2.bean.ServiceBody;
import com.shxy.i2.entity.Niec_Sensors;
import org.apache.cxf.endpoint.Client;
@ -38,4 +40,6 @@ public interface XydlI2Service {
void upload_yx(Client client);
void clear_history();
ServiceBody<ListModel> list();
}

@ -6,13 +6,8 @@ import com.shxy.i2.entity.*;
import com.shxy.i2.service.Webservcies;
import com.shxy.i2.service.XydlI2Service;
import lombok.extern.slf4j.Slf4j;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;
import java.util.HashMap;

@ -3,14 +3,13 @@ package com.shxy.i2.serviceimpl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.shxy.i2.Tool.AsyncMethod;
import com.shxy.i2.Tool.GenerateI2Xml;
import com.shxy.i2.bean.AttrBean;
import com.shxy.i2.bean.SendDataBean;
import com.shxy.i2.bean.YxAttrBean;
import com.shxy.i2.bean.*;
import com.shxy.i2.constant.Constant;
import com.shxy.i2.dao.*;
import com.shxy.i2.dto.Data_YxlDto;
@ -19,9 +18,8 @@ import com.shxy.i2.service.XydlI2Service;
import lombok.extern.slf4j.Slf4j;
import org.apache.cxf.endpoint.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.math.BigDecimal;
import java.math.BigInteger;
@ -105,17 +103,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
value = BigInteger.valueOf(0);
}
}
// Boolean iscontiue = true;
// while (iscontiue) {
List<Data_Byq_Jbfd> data_byq_jbfdlist = data_byq_jbfdDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(data_byq_jbfdlist)) {
log.info("查询byq_jbfd的数据量" + data_byq_jbfdlist.size());
log.info("查询byq_jbfd的数据量 sendlimit " + sendlimit);
// if (data_byq_jbfdlist.size() < 1000) {
// iscontiue = false;
// }
// BigDecimal add = NumberUtil.add(value, data_byq_jbfdlist.size());
// value = add.toBigInteger();
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
@ -195,16 +186,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.BYQJBFDID);
} else {
// iscontiue = false;
log.info("没有查询byq_jbfd的数据量");
}
// }
}
@Override
public void upload_cnj(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.CNJID);
BigInteger value = null;
if (upload_check == null) {
@ -219,9 +206,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询cnj的数据量" + list.size());
log.info("查询cnj的数据量 sendlimit " + sendlimit);
// if (list.size() < 1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -275,16 +259,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.CNJID);
} else {
// iscontiue = false;
log.info("没有查询cnj的数据量");
}
// }
}
@Override
public void upload_dcyw(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DCYWID);
BigInteger value = null;
if (upload_check == null) {
@ -298,9 +278,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Dcyw> list = data_dcywDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询dcyw的数据量" + list.size());
// if (list.size() < 1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -354,16 +331,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.DCYWID);
} else {
// iscontiue = false;
log.info("没有查询dcyw的数据量");
}
// }
}
@Override
public void upload_dlq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DLQJBFDID);
BigInteger value = null;
if (upload_check == null) {
@ -378,9 +351,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询dlq_jbfd的数据量" + list.size());
log.info("查询dlq_jbfd的数据量 sendlimit " + sendlimit);
// if (list.size() < 1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -455,16 +425,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.DLQJBFDID);
} else {
// iscontiue = false;
log.info("没有查询到dlq的数据");
}
// }
}
@Override
public void upload_dr_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DRJYJCID);
BigInteger value = null;
if (upload_check == null) {
@ -478,9 +444,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Dr_Jyjc> list = data_dr_jyjcDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询dr_jyjc的数据量" + list.size());
// if (list.size() < 1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
@ -571,16 +534,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.DRJYJCID);
} else {
// iscontiue = false;
log.info("没有查询dr_jyjc的数据量");
}
// }
}
@Override
public void upload_fhdlbx(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHDLBXID);
BigInteger value = null;
if (upload_check == null) {
@ -594,9 +553,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Fhdlbx> list = data_fhdlbxDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询fhdlbx的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -657,16 +613,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.FHDLBXID);
} else {
// iscontiue = false;
log.info("没有查询fhdlbx的数据量");
}
// }
}
@Override
public void upload_fhzxq(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHZXQID);
BigInteger value = null;
if (upload_check == null) {
@ -680,9 +632,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Fhzxq> list = data_fhzxqDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询fhzxq的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -743,16 +692,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.FHZXQID);
} else {
// iscontiue = false;
log.info("没有查询fhzxq的数据量");
}
// }
}
@Override
public void upload_jsyhw_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.JSYHWJYJCID);
BigInteger value = null;
if (upload_check == null) {
@ -767,9 +712,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询jsyhw_jyjc的数据量" + list.size());
log.info("查询jsyhw_jyjc的数据量 sendlimit " + sendlimit);
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -851,16 +793,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.JSYHWJYJCID);
} else {
// iscontiue = false;
log.info("没有查询jsyhw_jyjc的数据量");
}
// }
}
@Override
public void upload_sf6_qtsf(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTSFID);
BigInteger value = null;
if (upload_check == null) {
@ -874,9 +812,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_SF6_Qtsf> list = data_sf6_qtsfDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询sf6_qtsf的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -937,21 +872,17 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.SF6QTSFID);
} else {
// iscontiue = false;
log.info("没有查询sf6_qtsf的数据量");
}
// }
}
@Override
public void upload_sf6_qtyl(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID);
BigInteger value = null;
if (upload_check == null) {
value = BigInteger.valueOf(0);
}else {
} else {
value = upload_check.getValue();
if (value == null) {
value = BigInteger.valueOf(0);
@ -960,9 +891,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_SF6_Qtyl> list = data_sf6_qtylDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询sf6_qtyl的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -1038,16 +966,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.SF6QTYLID);
} else {
// iscontiue = false;
log.info("没有查询到sf6_qtyl的数据");
}
// }
}
@Override
public void upload_tx(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.TXID);
BigInteger value = null;
if (upload_check == null) {
@ -1061,9 +985,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Tx> list = data_txDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询tx的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -1125,8 +1046,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Override
public void upload_ws(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.WSID);
BigInteger value = null;
if (upload_check == null) {
@ -1140,9 +1059,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Ws> list = data_wsDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询ws的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -1196,16 +1112,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.WSID);
} else {
// iscontiue = false;
log.info("没有查询到ws的数据");
}
// }
}
@Override
public void upload_ysp(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
//查询目前上传的油色谱的id 记录油色谱上传的id大小
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YSPID);
BigInteger value = null;
@ -1220,9 +1132,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Ysp> list = data_yspDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询ysp的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -1342,7 +1251,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.YSPID);
} else {
// iscontiue = false;
log.info("没有查询到ysp的数据");
}
// }
@ -1350,8 +1258,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Override
public void upload_microclimate(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.MICROCLIMATEID);
BigInteger value = null;
if (upload_check == null) {
@ -1365,9 +1271,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Microclimate> list = data_microclimateDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询microclimate的数据量" + list.size());
// if (list.size()<1000) {
// iscontiue = false;
// }
ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
@ -1456,10 +1359,8 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.MICROCLIMATEID);
} else {
// iscontiue = false;
log.info("没有查询到microcimate的数据");
}
// }
}
@Override
@ -1479,9 +1380,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_YxlDto> list = data_yxDao.selectByPrimaryKey(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询yx的数据量" + list.size());
// if (list.size() < 1000) {
// iscontiue = false;
// }
BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) {
Data_YxlDto data_yxlDto = list.get(index);
@ -1553,10 +1451,8 @@ public class XydlI2ServiceImpl implements XydlI2Service {
}
asyncMethod.updateRecordId(maxid, Constant.YXID);
} else {
// iscontiue = false;
log.info("没有查询到yx的数据");
}
// }
}
@Override
@ -1580,5 +1476,125 @@ public class XydlI2ServiceImpl implements XydlI2Service {
data_yxDao.deleteData(dateTime);
}
@Override
public ServiceBody<ListModel> list() {
ListModel listModel = new ListModel();
HashMap<String,BigInteger> map = new HashMap();
List<Upload_check> upload_checks = upload_checkDao.selectAll();
for (Upload_check item:upload_checks) {
map.put(item.getCheckType(), item.getValue());
}
// String today = DateUtil.today();
String today = "2024-02-01";
ListModel.Beans yspbeans = new ListModel.Beans();
yspbeans.setName("油色谱");
Data_Ysp data_ysp1 = data_yspDao.selectMaxId();
Data_Ysp data_ysp2 = data_yspDao.selectNowId(DateUtil.parseDate(today));
BigInteger yspmaxid = data_ysp1.getMaxid();
BigInteger yspuploadnum = map.get(Constant.YSPID);
BigInteger ysptodaymaxid = data_ysp2.getMaxid();
BigInteger ysptodayminid = data_ysp2.getMinid();
BigDecimal ysptodaymul = NumberUtil.sub(ysptodaymaxid, ysptodayminid);
BigDecimal ysptodayupload = NumberUtil.sub(yspuploadnum, ysptodayminid);
yspbeans.setHistory(yspmaxid);
yspbeans.setUploadnum(yspuploadnum);
yspbeans.setNownum(BigInteger.valueOf(ysptodaymul.longValue()));
yspbeans.setNowuploadnum(BigInteger.valueOf(ysptodayupload.longValue()));
listModel.getList().add(yspbeans);
ListModel.Beans txbeans = new ListModel.Beans();
txbeans.setName("铁芯夹件");
Data_Tx data_tx1 = data_txDao.selectMaxId();
Data_Tx data_tx2 = data_txDao.selectNowId(DateUtil.parseDate(today));
BigInteger txmaxid = data_tx1.getMaxid();
BigInteger txuploadnum = map.get(Constant.TXID);
BigInteger txtodaymaxid = data_tx2.getMaxid();
BigInteger txtodayminid = data_tx2.getMinid();
BigDecimal txtodaymul = NumberUtil.sub(txtodaymaxid, txtodayminid);
BigDecimal txtodayupload = NumberUtil.sub(txuploadnum, txtodayminid);
txbeans.setHistory(txmaxid);
txbeans.setUploadnum(txuploadnum);
txbeans.setNownum(BigInteger.valueOf(txtodaymul.longValue()));
txbeans.setNowuploadnum(BigInteger.valueOf(txtodayupload.longValue()));
listModel.getList().add(txbeans);
ListModel.Beans dlqbeans = new ListModel.Beans();
dlqbeans.setName("断路器局放");
Data_Dlq_Jbfd data_dlq_jbfd1 = data_dlq_jbfdDao.selectMaxId();
Data_Dlq_Jbfd data_dlq_jbfd2 = data_dlq_jbfdDao.selectNowId(DateUtil.parseDate(today));
BigInteger dlqmaxid = data_dlq_jbfd1.getMaxid();
BigInteger dlquploadnum = map.get(Constant.DLQJBFDID);
BigInteger dlqtodaymaxid = data_dlq_jbfd2.getMaxid();
BigInteger dlqtodayminid = data_dlq_jbfd2.getMinid();
BigDecimal dlqtodaymul = NumberUtil.sub(dlqtodaymaxid, dlqtodayminid);
BigDecimal dlqtodayupload = NumberUtil.sub(dlquploadnum, dlqtodayminid);
dlqbeans.setHistory(dlqmaxid);
dlqbeans.setUploadnum(dlquploadnum);
dlqbeans.setNownum(BigInteger.valueOf(dlqtodaymul.longValue()));
dlqbeans.setNowuploadnum(BigInteger.valueOf(dlqtodayupload.longValue()));
listModel.getList().add(dlqbeans);
ListModel.Beans sf6beans = new ListModel.Beans();
sf6beans.setName("SF6气体压力");
Data_SF6_Qtyl data_sf6_qtyl1 = data_sf6_qtylDao.selectMaxId();
Data_SF6_Qtyl data_sf6_qtyl2 = data_sf6_qtylDao.selectNowId(DateUtil.parseDate(today));
BigInteger sf6maxid = data_sf6_qtyl1.getMaxid();
BigInteger sf6uploadnum = map.get(Constant.SF6QTYLID);
BigInteger sf6todaymaxid = data_sf6_qtyl2.getMaxid();
BigInteger sf6todayminid = data_sf6_qtyl2.getMinid();
BigDecimal sf6todaymul = NumberUtil.sub(sf6todaymaxid, sf6todayminid);
BigDecimal sf6todayupload = NumberUtil.sub(sf6uploadnum, sf6todayminid);
sf6beans.setHistory(sf6maxid);
sf6beans.setUploadnum(sf6uploadnum);
sf6beans.setNownum(BigInteger.valueOf(sf6todaymul.longValue()));
sf6beans.setNowuploadnum(BigInteger.valueOf(sf6todayupload.longValue()));
listModel.getList().add(sf6beans);
ListModel.Beans jsybeans = new ListModel.Beans();
jsybeans.setName("避雷器");
Data_Jsyhw_Jyjc data_jsyhw_jyjc1 = data_jsyhw_jyjcDao.selectMaxId();
Data_Jsyhw_Jyjc data_jsyhw_jyjc2 = data_jsyhw_jyjcDao.selectNowId(DateUtil.parseDate(today));
BigInteger jsymaxid = data_jsyhw_jyjc1.getMaxid();
BigInteger jsyuploadnum = map.get(Constant.JSYHWJYJCID);
BigInteger jsytodaymaxid = data_jsyhw_jyjc2.getMaxid();
BigInteger jsytodayminid = data_jsyhw_jyjc2.getMinid();
BigDecimal jsytodaymul = NumberUtil.sub(jsytodaymaxid, jsytodayminid);
BigDecimal jsytodayupload = NumberUtil.sub(jsyuploadnum, jsytodayminid);
jsybeans.setHistory(jsymaxid);
jsybeans.setUploadnum(jsyuploadnum);
jsybeans.setNownum(BigInteger.valueOf(jsytodaymul.longValue()));
jsybeans.setNowuploadnum(BigInteger.valueOf(jsytodayupload.longValue()));
listModel.getList().add(jsybeans);
ListModel.Beans yxbeans = new ListModel.Beans();
yxbeans.setName("遥信");
Data_YxlDto data_yxlDto1 = data_yxDao.selectMaxId();
Data_YxlDto data_yxlDto2 = data_yxDao.selectNowId(DateUtil.parseDate(today));
BigInteger yxmaxid = data_yxlDto1.getMaxid();
BigInteger yxuploadnum = map.get(Constant.YXID);
BigInteger yxtodaymaxid = data_yxlDto2.getMaxid();
BigInteger yxtodayminid = data_yxlDto2.getMinid();
BigDecimal yxtodaymul = NumberUtil.sub(yxtodaymaxid, yxtodayminid);
BigDecimal yxtodayupload = NumberUtil.sub(yxuploadnum, yxtodayminid);
yxbeans.setHistory(yxmaxid);
yxbeans.setUploadnum(yxuploadnum);
yxbeans.setNownum(BigInteger.valueOf(yxtodaymul.longValue()));
yxbeans.setNowuploadnum(BigInteger.valueOf(yxtodayupload.longValue()));
listModel.getList().add(yxbeans);
ServiceBody<ListModel> serviceBody = new ServiceBody<ListModel>();
serviceBody.setCode(ServiceStatus.SUCCESS);
serviceBody.setData(listModel);
return serviceBody;
}
}

@ -1,80 +1,76 @@
package com.shxy.i2.timeTask;
import com.shxy.i2.bean.AttrBean;
import com.shxy.i2.service.Webservcies;
import com.shxy.i2.service.XydlI2Service;
import lombok.extern.slf4j.Slf4j;
import org.apache.cxf.endpoint.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @author jingjing
* @date 2023-11-16 15:06
*/
@Component
@EnableScheduling
@Slf4j
//@EnableAsync
public class ScheduledTask {
@Autowired
Webservcies webservcies;
@Autowired
XydlI2Service xydlI2Service;
@Scheduled(fixedDelay = 60 * 60 * 1000)
public void cacyspupload() {
log.info("cacyspupload执行" );
webservcies.uploadyspData();
}
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacjfjcupload() {
log.info("cacjfjcupload执行" );
webservcies.uploadjfjcData();
}
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacupload() {
log.info("cacupload执行" );
webservcies.uploadData();
}
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cactxupload() {
log.info("cactxupload执行" );
webservcies.uploadtxData();
}
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacyxupload() {
log.info("cacyxupload执行" );
webservcies.uploadyxData();
}
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacdcywupload() {
log.info("cacdcywupload执行" );
webservcies.uploaddcywData();
}
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacjsyhwjyjcupload() {
log.info("cacjsyhwjyjcupload执行" );
webservcies.uploadjsyhwjyjcData();
}
@Scheduled(cron = "0 0 13 * * ?")
public void clear() {
log.info("clear" );
xydlI2Service.clear_history();
}
}
//package com.shxy.i2.timeTask;
//
//import com.shxy.i2.service.Webservcies;
//import com.shxy.i2.service.XydlI2Service;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
///**
// * @author jingjing
// * @date 2023-11-16 15:06
// */
//@Component
//@EnableScheduling
//@Slf4j
////@EnableAsync
//public class ScheduledTask {
//
// @Autowired
// Webservcies webservcies;
//
// @Autowired
// XydlI2Service xydlI2Service;
//
// @Scheduled(fixedDelay = 60 * 60 * 1000)
// public void cacyspupload() {
// log.info("cacyspupload执行" );
// webservcies.uploadyspData();
// }
//
// @Scheduled(fixedDelay = 1 * 30 * 1000)
// public void cacjfjcupload() {
// log.info("cacjfjcupload执行" );
// webservcies.uploadjfjcData();
// }
//
// @Scheduled(fixedDelay = 1 * 30 * 1000)
// public void cacupload() {
// log.info("cacupload执行" );
// webservcies.uploadData();
// }
//
// @Scheduled(fixedDelay = 1 * 30 * 1000)
// public void cactxupload() {
// log.info("cactxupload执行" );
// webservcies.uploadtxData();
// }
//
// @Scheduled(fixedDelay = 1 * 30 * 1000)
// public void cacyxupload() {
// log.info("cacyxupload执行" );
// webservcies.uploadyxData();
// }
//
// @Scheduled(fixedDelay = 1 * 30 * 1000)
// public void cacdcywupload() {
// log.info("cacdcywupload执行" );
// webservcies.uploaddcywData();
// }
//
// @Scheduled(fixedDelay = 1 * 30 * 1000)
// public void cacjsyhwjyjcupload() {
// log.info("cacjsyhwjyjcupload执行" );
// webservcies.uploadjsyhwjyjcData();
// }
//
//
// @Scheduled(cron = "0 0 13 * * ?")
// public void clear() {
// log.info("clear" );
// xydlI2Service.clear_history();
// }
//
//}

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_Byq_JbfdDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Byq_Jbfd">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="dischargeCapacity" jdbcType="REAL" property="dischargecapacity"/>
@ -23,9 +25,28 @@
t1.id, t1.eqmid, t1.acquisitionTime, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount, t1.isupload,
t1.dischargeWaveform,t1.create_time, t1.update_time
FROM
data_byq_jbfd t1 where t1.id <![CDATA[>]]> #{maxid}
data_byq_jbfd t1 where t1.id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_byq_jbfd
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_byq_jbfd where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
SELECT
t1.id, t1.eqmid, t1.acquisitionTime, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount, t1.isupload,

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_CnjDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Cnj">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="chargeTime" jdbcType="REAL" property="chargetime"/>
@ -18,8 +20,29 @@
select
<include refid="Base_Column_List"/>
from data_cnj
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_cnj
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_cnj where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_DcywDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Dcyw">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="oilTemperature" jdbcType="REAL" property="oiltemperature"/>
@ -18,8 +20,28 @@
select
<include refid="Base_Column_List"/>
from data_dcyw
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_dcyw
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dcyw where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_Dlq_JbfdDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Dlq_Jbfd">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="phase" jdbcType="VARCHAR" property="phase"/>
@ -26,8 +28,30 @@
t1.isupload,t1.dischargeWaveform,t1.create_time, t1.update_time
FROM
data_dlq_jbfd t1
where t1.id <![CDATA[>]]> #{maxid}
where t1.id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_dlq_jbfd
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dlq_jbfd where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
SELECT

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_Dr_JyjcDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Dr_Jyjc">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="capacitance" jdbcType="REAL" property="capacitance"/>
@ -24,8 +26,26 @@
select
<include refid="Base_Column_List"/>
from data_dr_jyjc
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_dr_jyjc
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dr_jyjc where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_FhdlbxDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Fhdlbx">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="action" jdbcType="INTEGER" property="action"/>
@ -19,9 +21,28 @@
select
<include refid="Base_Column_List"/>
from data_fhdlbx
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_fhdlbx
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_fhdlbx where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_Jsyhw_JyjcDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Jsyhw_Jyjc">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="systemVoltage" jdbcType="REAL" property="systemvoltage"/>
@ -23,8 +25,27 @@
select
<include refid="Base_Column_List"/>
from data_jsyhw_jyjc
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_jsyhw_jyjc
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_jsyhw_jyjc where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
@ -32,6 +53,9 @@
from data_jsyhw_jyjc
where isupload is null or isupload = #{isupload} order by id desc limit 1
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Jsyhw_Jyjc">
update data_jsyhw_jyjc
<set>

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_MicroclimateDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Microclimate">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="airTemperature" jdbcType="REAL" property="airtemperature"/>
@ -26,9 +28,25 @@
select
<include refid="Base_Column_List"/>
from data_microclimate
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_microclimate
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_microclimate where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_SF6_QtsfDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_SF6_Qtsf">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="temperature" jdbcType="REAL" property="temperature"/>
@ -19,8 +21,23 @@
select
<include refid="Base_Column_List"/>
from data_sf6_qtsf
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_sf6_qtsf
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_sf6_qtsf where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_SF6_QtylDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_SF6_Qtyl">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="temperature" jdbcType="REAL" property="temperature"/>
@ -36,8 +38,28 @@
select
<include refid="Base_Column_List"/>
from data_sf6_qtyl
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_sf6_qtyl
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_sf6_qtyl where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_TxDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Tx">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="totalCoreCurrent" jdbcType="REAL" property="totalcorecurrent"/>
@ -13,11 +15,32 @@
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, totalCoreCurrent, isupload, create_time, update_time
</sql>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_tx
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_tx where acquisitionTime >= #{date}
</select>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_tx
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectUpload" resultMap="BaseResultMap">

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_WsDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Ws">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="moisture" jdbcType="REAL" property="moisture"/>
@ -17,9 +19,25 @@
select
<include refid="Base_Column_List"/>
from data_ws
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_ws
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_ws where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_YspDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Ysp">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="H2" jdbcType="REAL" property="h2"/>
@ -23,16 +25,35 @@
id, eqmid, acquisitionTime, H2, CH4, C2H6, C2H4, C2H2, CO, CO2, O2, N2, TotalHydrocarbon,
isupload, create_time, update_time
</sql>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_ysp
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_ysp where acquisitionTime >= #{date}
</select>
<!--//每组只查最大的-->
<select id="selectUploadById" resultMap="BaseResultMap">
SELECT
t1.id, t1.eqmid, t1.acquisitionTime, t1.H2, t1.CH4, t1.C2H6, t1.C2H4, t1.C2H2,t1.CO, t1.CO2, t1.O2, t1.N2,
t1.TotalHydrocarbon,t1.isupload, t1.create_time, t1.update_time
FROM
data_ysp t1 where t1.id <![CDATA[>]]> #{maxid}
data_ysp t1 where t1.id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectUpload" resultMap="BaseResultMap">
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->
@ -139,4 +160,5 @@
from data_ysp
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper>

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_YxDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.dto.Data_YxlDto">
<result column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="sadr" jdbcType="INTEGER" property="sadr"/>
<result column="d_time" jdbcType="TIMESTAMP" property="dtime"/>
<result column="ival" jdbcType="INTEGER" property="ival"/>
@ -26,7 +28,14 @@
c.table_name as table_name,
c.phase as phase
from data_yx a left join niec_points b on a.sadr = b.sadr left join niec_sensors c on b.sensor_id = c.id
where a.id <![CDATA[>]]> #{maxid}
where a.id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_yx
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_yx where d_time >= #{date}
</select>
<delete id="deleteData" >

@ -13,12 +13,22 @@
select
<include refid="Base_Column_List"/>
from upload_check
<if test="checkType != null">
where check_type = #{checkType,jdbcType=VARCHAR}
</if>
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from upload_check
</select>
<update id="updateByPrimaryKey">
update upload_check
set value = #{value},
update_time = #{updateTime}
where check_type = #{checkType}
</update>
</mapper>

@ -3,6 +3,8 @@
<mapper namespace="com.shxy.i2.dao.Data_FhzxqDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Fhzxq">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="maxid" jdbcType="BIGINT" property="maxid"/>
<result column="minid" jdbcType="BIGINT" property="minid"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="action" jdbcType="INTEGER" property="action"/>
@ -18,9 +20,29 @@
select
<include refid="Base_Column_List"/>
from data_fhzxq
where id <![CDATA[>]]> #{maxid}
where id <![CDATA[>]]> #{maxid} limit 10000
</select>
<select id="selectMaxId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid FROM data_fhzxq
</select>
<select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_fhzxq where acquisitionTime >= #{date}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

Loading…
Cancel
Save