I2新增查询功能和代码优化

master
liuguijing 1 year ago
parent f5102276ae
commit 32dbd5ba6c

@ -0,0 +1,8 @@
CREATE TABLE `upload_statics` (
`id` int NOT NULL AUTO_INCREMENT,
`check_type` varchar(32) NOT NULL,
`first_value` bigint DEFAULT NULL,
`upload_time` date DEFAULT NULL COMMENT '上传记录的日期',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='i2上传Id的确认表';

@ -21,47 +21,6 @@ import java.util.List;
@Component @Component
//@EnableAsync //@EnableAsync
public class AsyncMethod { public class AsyncMethod {
@Autowired
private Data_Dlq_JbfdDao data_dlq_jbfdDao;
@Autowired
private Data_Byq_JbfdDao data_byq_jbfdDao;
@Autowired
private Data_SF6_QtylDao data_sf6_qtylDao;
@Autowired
private Data_YspDao data_yspDao;
@Autowired
private Data_WsDao data_wsDao;
@Autowired
private Data_TxDao data_txDao;
@Autowired
private Data_DcywDao data_dcywDao;
@Autowired
private Data_Dr_JyjcDao data_dr_jyjcDao;
@Autowired
private Data_Jsyhw_JyjcDao data_jsyhw_jyjcDao;
@Autowired
private Data_FhzxqDao data_fhzxqDao;
@Autowired
private Data_FhdlbxDao data_fhdlbxDao;
@Autowired
private Data_SF6_QtsfDao data_sf6_qtsfDao;
@Autowired
private Data_MicroclimateDao data_microclimateDao;
@Autowired
private Data_CnjDao data_cnjDao;
@Autowired @Autowired
private Upload_checkDao upload_checkDao; private Upload_checkDao upload_checkDao;
@ -71,104 +30,7 @@ public class AsyncMethod {
// @Async(value = "asyncServiceExecutor") // @Async(value = "asyncServiceExecutor")
public void sendData(Client client, List<BigInteger> idlist, String xml, String type) throws Exception { public void sendData2(String xml) throws Exception {
Object[] objects = client.invoke("uploadCACData", xml);
String threadId = Thread.currentThread().getName();
log.info("线程序号: " + threadId + "当前时间:" + new Date());
if (objects != null && objects.length > 0) {
String string = String.valueOf(objects[0]);
log.info("返回的长度 " + objects.length + " 返回的对象 " + string);
JSONObject jsonObject = XML.toJSONObject(string);
if (jsonObject != null) {
JSONObject response = (JSONObject) jsonObject.get("response");
if (response != null) {
JSONObject result = (JSONObject) response.get("result");
if (result != null) {
Integer code = (Integer) result.get("code");
if (code != null && code.intValue() == 0) {
log.info("上传成功");
log.info("修改的id: " + idlist.toString());
if (CollectionUtil.isNotEmpty(idlist)) {
if (StrUtil.equals(type, Constant.SF6_QTYL)) {
data_sf6_qtylDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.BYQ_JBFD)) {
data_byq_jbfdDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.DLQJBFD)) {
data_dlq_jbfdDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.YSP)) {
data_yspDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.WS)) {
data_wsDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.TX)) {
data_txDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.DCYW)) {
data_dcywDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.DRJYJC)) {
data_dr_jyjcDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.JSYHW)) {
data_jsyhw_jyjcDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.FHZXQ)) {
data_fhzxqDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.FHDLBX)) {
data_fhdlbxDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.CNJ)) {
data_cnjDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.SF6_QTSF)) {
data_sf6_qtsfDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
} else if (StrUtil.equals(type, Constant.WQX)) {
data_microclimateDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date());
}
}
} else {
log.info("上传失败");
}
}
}
}
}
}
// @Async(value = "asyncServiceExecutor")
public void sendJBFDData2(Client client, BigInteger maxid, ArrayList<Integer> list1, String xml, String type) throws Exception {
Object[] objects = client.invoke("uploadCACData", xml);
String threadId = Thread.currentThread().getName();
log.info("线程序号: " + threadId + "当前时间:" + new Date());
// log.info("上传的油色谱数据: " + xml);
if (objects != null && objects.length > 0) {
String string = String.valueOf(objects[0]);
log.info("返回的长度 " + objects.length + " 返回的对象 " + string);
JSONObject jsonObject = XML.toJSONObject(string);
if (jsonObject != null) {
JSONObject response = (JSONObject) jsonObject.get("response");
if (response != null) {
JSONObject result = (JSONObject) response.get("result");
if (result != null) {
Integer code = (Integer) result.get("code");
if (code != null && code.intValue() == 0) {
log.info("上传成功");
log.info("修改的id: " + list1.toString());
if (CollectionUtil.isNotEmpty(list1)) {
if (StrUtil.equals(type, Constant.BYQ_JBFD)) {
data_byq_jbfdDao.updateDataList2(CommonStatus.UPLOAD.value(), maxid, list1, new Date());
} else if (StrUtil.equals(type, Constant.DLQJBFD)) {
data_dlq_jbfdDao.updateDataList2(CommonStatus.UPLOAD.value(), maxid, list1, new Date());
} else if (StrUtil.equals(type, Constant.YSP)) {
data_yspDao.updateDataList2(CommonStatus.UPLOAD.value(), maxid, list1, new Date());
}
}
} else {
log.info("上传失败");
}
}
}
}
}
}
// @Async(value = "asyncServiceExecutor")
public void sendData2(Client client, String xml) throws Exception {
Object[] objects = createDynamicClient.invoke("uploadCACData", xml); Object[] objects = createDynamicClient.invoke("uploadCACData", xml);
String threadId = Thread.currentThread().getName(); String threadId = Thread.currentThread().getName();
log.info("线程序号: " + threadId + "当前时间:" + new Date()); log.info("线程序号: " + threadId + "当前时间:" + new Date());
@ -193,34 +55,6 @@ public class AsyncMethod {
} }
} }
// @Async(value = "asyncServiceExecutor")
public void sendYxData(Client client, BigInteger maxid, String xml) throws Exception {
// Object[] objects = client.invoke("uploadCACData", xml);
// if (objects != null && objects.length > 0) {
// String string = String.valueOf(objects[0]);
// log.info("返回的长度 " + objects.length + " 返回的对象 " + string);
// JSONObject jsonObject = XML.toJSONObject(string);
// if (jsonObject != null) {
// JSONObject response = (JSONObject) jsonObject.get("response");
// if (response != null) {
// JSONObject result = (JSONObject) response.get("result");
// if (result != null) {
// Integer code = (Integer) result.get("code");
// if (code != null && code.intValue() == 0) {
// log.info("上传成功");
if (maxid != null && maxid.longValue() > 0) {
upload_checkDao.updateByPrimaryKey(Constant.YXID, maxid, new Date());
}
// } else {
// log.info("上传失败");
// }
// }
// }
// }
// }
}
// @Async(value = "asyncServiceExecutor") // @Async(value = "asyncServiceExecutor")
public void updateRecordId(BigInteger maxid,String type) { public void updateRecordId(BigInteger maxid,String type) {
if (maxid != null && maxid.longValue() > 0) { if (maxid != null && maxid.longValue() > 0) {

@ -17,4 +17,5 @@ public interface Data_Byq_JbfdDao {
Data_Byq_Jbfd selectNowId(@Param("date") Date date); Data_Byq_Jbfd selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,5 +16,5 @@ public interface Data_CnjDao {
Data_Cnj selectNowId(@Param("date") Date date); Data_Cnj selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,5 +16,5 @@ public interface Data_DcywDao {
Data_Dcyw selectNowId(@Param("date") Date date); Data_Dcyw selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -19,4 +19,5 @@ public interface Data_Dlq_JbfdDao {
List<Data_Dlq_Jbfd> selectUploadById(@Param("maxid") BigInteger maxid); List<Data_Dlq_Jbfd> selectUploadById(@Param("maxid") BigInteger maxid);
int deleteData(@Param("time") Date time);
} }

@ -16,4 +16,5 @@ public interface Data_Dr_JyjcDao {
Data_Dr_Jyjc selectNowId(@Param("date") Date date); Data_Dr_Jyjc selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,5 +16,5 @@ public interface Data_FhdlbxDao {
Data_Fhdlbx selectNowId(@Param("date") Date date); Data_Fhdlbx selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,4 +16,5 @@ public interface Data_FhzxqDao {
Data_Fhzxq selectNowId(@Param("date") Date date); Data_Fhzxq selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,4 +16,5 @@ public interface Data_Jsyhw_JyjcDao {
Data_Jsyhw_Jyjc selectNowId(@Param("date") Date date); Data_Jsyhw_Jyjc selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,5 +16,5 @@ public interface Data_MicroclimateDao {
Data_Microclimate selectNowId(@Param("date") Date date); Data_Microclimate selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,4 +16,5 @@ public interface Data_SF6_QtsfDao {
Data_SF6_Qtsf selectNowId(@Param("date") Date date); Data_SF6_Qtsf selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,5 +16,5 @@ public interface Data_SF6_QtylDao {
Data_SF6_Qtyl selectNowId(@Param("date") Date date); Data_SF6_Qtyl selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -17,5 +17,5 @@ public interface Data_TxDao {
Data_Tx selectNowId(@Param("date") Date date); Data_Tx selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -16,4 +16,5 @@ public interface Data_WsDao {
Data_Ws selectNowId(@Param("date") Date date); Data_Ws selectNowId(@Param("date") Date date);
int deleteData(@Param("time") Date time);
} }

@ -18,4 +18,6 @@ public interface Data_YspDao {
Data_Ysp selectMaxId(); Data_Ysp selectMaxId();
Data_Ysp selectNowId(@Param("date") Date time); Data_Ysp selectNowId(@Param("date") Date time);
int deleteData(@Param("time") Date time);
} }

@ -0,0 +1,30 @@
package com.shxy.i2.dao;
import com.shxy.i2.entity.Upload_Statics;
import com.shxy.i2.entity.Upload_StaticsExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface Upload_StaticsDao {
long countByExample(Upload_StaticsExample example);
int deleteByExample(Upload_StaticsExample example);
int deleteByPrimaryKey(String checkType);
int insert(Upload_Statics record);
int insertSelective(Upload_Statics record);
List<Upload_Statics> selectByExample(Upload_StaticsExample example);
Upload_Statics selectByPrimaryKey(String checkType);
int updateByExampleSelective(@Param("record") Upload_Statics record, @Param("example") Upload_StaticsExample example);
int updateByExample(@Param("record") Upload_Statics record, @Param("example") Upload_StaticsExample example);
int updateByPrimaryKeySelective(Upload_Statics record);
int updateByPrimaryKey(Upload_Statics record);
}

@ -0,0 +1,23 @@
package com.shxy.i2.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
@Data
public class Upload_Statics implements Serializable {
private String checkType;
private Integer id;
private BigInteger firstValue;
private Date uploadTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,538 @@
package com.shxy.i2.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class Upload_StaticsExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public Upload_StaticsExample() {
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));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andCheckTypeIsNull() {
addCriterion("check_type is null");
return (Criteria) this;
}
public Criteria andCheckTypeIsNotNull() {
addCriterion("check_type is not null");
return (Criteria) this;
}
public Criteria andCheckTypeEqualTo(String value) {
addCriterion("check_type =", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeNotEqualTo(String value) {
addCriterion("check_type <>", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeGreaterThan(String value) {
addCriterion("check_type >", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeGreaterThanOrEqualTo(String value) {
addCriterion("check_type >=", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeLessThan(String value) {
addCriterion("check_type <", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeLessThanOrEqualTo(String value) {
addCriterion("check_type <=", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeLike(String value) {
addCriterion("check_type like", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeNotLike(String value) {
addCriterion("check_type not like", value, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeIn(List<String> values) {
addCriterion("check_type in", values, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeNotIn(List<String> values) {
addCriterion("check_type not in", values, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeBetween(String value1, String value2) {
addCriterion("check_type between", value1, value2, "checkType");
return (Criteria) this;
}
public Criteria andCheckTypeNotBetween(String value1, String value2) {
addCriterion("check_type not between", value1, value2, "checkType");
return (Criteria) this;
}
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 andFirstValueIsNull() {
addCriterion("first_value is null");
return (Criteria) this;
}
public Criteria andFirstValueIsNotNull() {
addCriterion("first_value is not null");
return (Criteria) this;
}
public Criteria andFirstValueEqualTo(Long value) {
addCriterion("first_value =", value, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueNotEqualTo(Long value) {
addCriterion("first_value <>", value, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueGreaterThan(Long value) {
addCriterion("first_value >", value, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueGreaterThanOrEqualTo(Long value) {
addCriterion("first_value >=", value, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueLessThan(Long value) {
addCriterion("first_value <", value, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueLessThanOrEqualTo(Long value) {
addCriterion("first_value <=", value, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueIn(List<Long> values) {
addCriterion("first_value in", values, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueNotIn(List<Long> values) {
addCriterion("first_value not in", values, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueBetween(Long value1, Long value2) {
addCriterion("first_value between", value1, value2, "firstValue");
return (Criteria) this;
}
public Criteria andFirstValueNotBetween(Long value1, Long value2) {
addCriterion("first_value not between", value1, value2, "firstValue");
return (Criteria) this;
}
public Criteria andUploadTimeIsNull() {
addCriterion("upload_time is null");
return (Criteria) this;
}
public Criteria andUploadTimeIsNotNull() {
addCriterion("upload_time is not null");
return (Criteria) this;
}
public Criteria andUploadTimeEqualTo(Date value) {
addCriterionForJDBCDate("upload_time =", value, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("upload_time <>", value, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeGreaterThan(Date value) {
addCriterionForJDBCDate("upload_time >", value, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("upload_time >=", value, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeLessThan(Date value) {
addCriterionForJDBCDate("upload_time <", value, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("upload_time <=", value, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeIn(List<Date> values) {
addCriterionForJDBCDate("upload_time in", values, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("upload_time not in", values, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("upload_time between", value1, value2, "uploadTime");
return (Criteria) this;
}
public Criteria andUploadTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("upload_time not between", value1, value2, "uploadTime");
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);
}
}
}

@ -9,37 +9,40 @@ import java.util.HashMap;
public interface XydlI2Service { public interface XydlI2Service {
void upload_byq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_byq_jbfd( HashMap<Integer, Niec_Sensors> equipMap);
void upload_sf6_qtyl(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_sf6_qtyl( HashMap<Integer, Niec_Sensors> equipMap);
void upload_dcyw(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_dcyw(HashMap<Integer, Niec_Sensors> equipMap);
void upload_fhdlbx(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_fhdlbx( HashMap<Integer, Niec_Sensors> equipMap);
void upload_fhzxq(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_fhzxq(HashMap<Integer, Niec_Sensors> equipMap);
void upload_sf6_qtsf(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_sf6_qtsf( HashMap<Integer, Niec_Sensors> equipMap);
void upload_tx(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_tx( HashMap<Integer, Niec_Sensors> equipMap);
void upload_ws(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_ws( HashMap<Integer, Niec_Sensors> equipMap);
void upload_dr_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_dr_jyjc( HashMap<Integer, Niec_Sensors> equipMap);
void upload_jsyhw_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_jsyhw_jyjc( HashMap<Integer, Niec_Sensors> equipMap);
void upload_microclimate(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_microclimate( HashMap<Integer, Niec_Sensors> equipMap);
void upload_dlq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_dlq_jbfd( HashMap<Integer, Niec_Sensors> equipMap);
void upload_ysp(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_ysp(HashMap<Integer, Niec_Sensors> equipMap);
void upload_cnj(Client client, HashMap<Integer, Niec_Sensors> equipMap); void upload_cnj( HashMap<Integer, Niec_Sensors> equipMap);
void upload_yx(Client client); void upload_yx();
void clear_history(); void clear_history();
ServiceBody<ListModel> list(); ServiceBody<ListModel> list();
void statics();
} }

@ -56,16 +56,16 @@ public class WebServiceImpl implements Webservcies {
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item); equipMap.put(item.getId(), item);
} }
xydlI2Service.upload_sf6_qtyl(null, equipMap); xydlI2Service.upload_sf6_qtyl( equipMap);
xydlI2Service.upload_fhdlbx(null, equipMap); xydlI2Service.upload_fhdlbx(equipMap);
xydlI2Service.upload_fhzxq(null, equipMap); xydlI2Service.upload_fhzxq( equipMap);
xydlI2Service.upload_sf6_qtsf(null, equipMap); xydlI2Service.upload_sf6_qtsf( equipMap);
xydlI2Service.upload_ws(null, equipMap); xydlI2Service.upload_ws( equipMap);
xydlI2Service.upload_dr_jyjc(null, equipMap); xydlI2Service.upload_dr_jyjc( equipMap);
xydlI2Service.upload_microclimate(null, equipMap); xydlI2Service.upload_microclimate( equipMap);
xydlI2Service.upload_cnj(null, equipMap); xydlI2Service.upload_cnj( equipMap);
log.info("实时数据定时任务结束"); log.info("实时数据定时任务结束");
} }
@ -79,7 +79,7 @@ public class WebServiceImpl implements Webservcies {
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item); equipMap.put(item.getId(), item);
} }
xydlI2Service.upload_tx(null, equipMap); xydlI2Service.upload_tx( equipMap);
log.info("实时数据定时任务结束"); log.info("实时数据定时任务结束");
} }
@ -95,7 +95,7 @@ public class WebServiceImpl implements Webservcies {
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item); equipMap.put(item.getId(), item);
} }
xydlI2Service.upload_ysp(null, equipMap); xydlI2Service.upload_ysp( equipMap);
log.info("油色谱数据定时任务结束"); log.info("油色谱数据定时任务结束");
} }
@ -108,14 +108,14 @@ public class WebServiceImpl implements Webservcies {
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item); equipMap.put(item.getId(), item);
} }
xydlI2Service.upload_dlq_jbfd(null, equipMap); xydlI2Service.upload_dlq_jbfd( equipMap);
xydlI2Service.upload_byq_jbfd(null, equipMap); xydlI2Service.upload_byq_jbfd( equipMap);
log.info("局放监测数据定时任务结束"); log.info("局放监测数据定时任务结束");
} }
@Override @Override
public void uploadyxData() { public void uploadyxData() {
log.info("实时数据定时任务启动"); log.info("实时数据定时任务启动");
// 动态客户端 // 动态客户端
log.info("开始执行定时任务-查询数据库"); log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap(); HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
@ -123,7 +123,7 @@ public class WebServiceImpl implements Webservcies {
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item); equipMap.put(item.getId(), item);
} }
xydlI2Service.upload_yx(null); xydlI2Service.upload_yx();
log.info("实时数据定时任务结束"); log.info("实时数据定时任务结束");
} }
@ -137,7 +137,7 @@ public class WebServiceImpl implements Webservcies {
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item); equipMap.put(item.getId(), item);
} }
xydlI2Service.upload_dcyw(null, equipMap); xydlI2Service.upload_dcyw( equipMap);
log.info("实时数据定时任务结束"); log.info("实时数据定时任务结束");
} }
@ -151,7 +151,7 @@ public class WebServiceImpl implements Webservcies {
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item); equipMap.put(item.getId(), item);
} }
xydlI2Service.upload_jsyhw_jyjc(null, equipMap); xydlI2Service.upload_jsyhw_jyjc( equipMap);
log.info("实时数据定时任务结束"); log.info("实时数据定时任务结束");
} }

@ -3,7 +3,6 @@ package com.shxy.i2.serviceimpl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -16,10 +15,8 @@ import com.shxy.i2.dto.Data_YxlDto;
import com.shxy.i2.entity.*; import com.shxy.i2.entity.*;
import com.shxy.i2.service.XydlI2Service; import com.shxy.i2.service.XydlI2Service;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.cxf.endpoint.Client;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
@ -75,13 +72,15 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Autowired @Autowired
private Data_MicroclimateDao data_microclimateDao; private Data_MicroclimateDao data_microclimateDao;
@Autowired @Autowired
private Upload_checkDao upload_checkDao; private Upload_checkDao upload_checkDao;
@Autowired @Autowired
private Data_YxDao data_yxDao; private Data_YxDao data_yxDao;
@Autowired
private Upload_StaticsDao upload_staticsDao;
@Autowired @Autowired
AsyncMethod asyncMethod; AsyncMethod asyncMethod;
@ -91,7 +90,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
public static int sendlimit = 1000; public static int sendlimit = 1000;
@Override @Override
public void upload_byq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_byq_jbfd(HashMap<Integer, Niec_Sensors> equipMap) {
//查询目前上传的变压器局部放电的id 记录变压器局部放电上传的id大小 //查询目前上传的变压器局部放电的id 记录变压器局部放电上传的id大小
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.BYQJBFDID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.BYQJBFDID);
BigInteger value = null; BigInteger value = null;
@ -176,7 +175,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
sendDataBean.setMaxid(id); sendDataBean.setMaxid(id);
if ((index != 0 && index % sendlimit == 0) || index == (data_byq_jbfdlist.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (data_byq_jbfdlist.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -191,7 +190,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_cnj(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_cnj(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.CNJID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.CNJID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -249,7 +248,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -264,7 +263,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_dcyw(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_dcyw(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DCYWID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DCYWID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -321,7 +320,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -336,7 +335,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_dlq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_dlq_jbfd(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DLQJBFDID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DLQJBFDID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -415,7 +414,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -430,7 +429,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_dr_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_dr_jyjc(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DRJYJCID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DRJYJCID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -524,7 +523,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -539,7 +538,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_fhdlbx(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_fhdlbx(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHDLBXID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHDLBXID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -603,7 +602,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -618,7 +617,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_fhzxq(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_fhzxq(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHZXQID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHZXQID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -682,7 +681,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -697,7 +696,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_jsyhw_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_jsyhw_jyjc(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.JSYHWJYJCID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.JSYHWJYJCID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -783,7 +782,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -798,7 +797,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_sf6_qtsf(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_sf6_qtsf(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTSFID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTSFID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -862,7 +861,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -877,7 +876,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_sf6_qtyl(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_sf6_qtyl(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -956,7 +955,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
log.info("开始传输"); log.info("开始传输");
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -971,7 +970,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_tx(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_tx(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.TXID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.TXID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -1028,7 +1027,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -1045,7 +1044,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_ws(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_ws(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.WSID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.WSID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -1102,7 +1101,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -1117,7 +1116,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_ysp(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_ysp(HashMap<Integer, Niec_Sensors> equipMap) {
//查询目前上传的油色谱的id 记录油色谱上传的id大小 //查询目前上传的油色谱的id 记录油色谱上传的id大小
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YSPID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YSPID);
BigInteger value = null; BigInteger value = null;
@ -1241,7 +1240,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
log.info("测试断点4"); log.info("测试断点4");
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
log.info("ysp组装完成开始上传"); log.info("ysp组装完成开始上传");
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -1253,11 +1252,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} else { } else {
log.info("没有查询到ysp的数据"); log.info("没有查询到ysp的数据");
} }
// }
} }
@Override @Override
public void upload_microclimate(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_microclimate(HashMap<Integer, Niec_Sensors> equipMap) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.MICROCLIMATEID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.MICROCLIMATEID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -1349,7 +1347,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -1364,9 +1362,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
@Override @Override
public void upload_yx(Client client) { public void upload_yx() {
// Boolean iscontiue = true;
// while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YXID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YXID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -1442,12 +1438,11 @@ public class XydlI2ServiceImpl implements XydlI2Service {
try { try {
String xml = GenerateI2Xml.generateYxCacXml(attr); String xml = GenerateI2Xml.generateYxCacXml(attr);
if (xml != null && !xml.equals("")) { if (xml != null && !xml.equals("")) {
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(xml);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
asyncMethod.updateRecordId(maxid, Constant.YXID); asyncMethod.updateRecordId(maxid, Constant.YXID);
} else { } else {
@ -1458,7 +1453,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Override @Override
public void clear_history() { public void clear_history() {
log.info("开启定时删除"); log.info("开启定时删除");
DateTime dateTime = DateUtil.offsetDay(new Date(), -3); DateTime dateTime = DateUtil.offsetDay(new Date(), -7);
data_byq_jbfdDao.deleteData(dateTime); data_byq_jbfdDao.deleteData(dateTime);
data_cnjDao.deleteData(dateTime); data_cnjDao.deleteData(dateTime);
data_dcywDao.deleteData(dateTime); data_dcywDao.deleteData(dateTime);
@ -1479,14 +1474,14 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Override @Override
public ServiceBody<ListModel> list() { public ServiceBody<ListModel> list() {
ListModel listModel = new ListModel(); ListModel listModel = new ListModel();
HashMap<String,BigInteger> map = new HashMap(); HashMap<String, BigInteger> map = new HashMap();
List<Upload_check> upload_checks = upload_checkDao.selectAll(); List<Upload_check> upload_checks = upload_checkDao.selectAll();
for (Upload_check item:upload_checks) { for (Upload_check item : upload_checks) {
map.put(item.getCheckType(), item.getValue()); map.put(item.getCheckType(), item.getValue());
} }
// String today = DateUtil.today(); String today = DateUtil.today();
String today = "2024-02-01"; // String today = "2024-02-01";
ListModel.Beans yspbeans = new ListModel.Beans(); ListModel.Beans yspbeans = new ListModel.Beans();
yspbeans.setName("油色谱"); yspbeans.setName("油色谱");
@ -1504,7 +1499,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
yspbeans.setNowuploadnum(BigInteger.valueOf(ysptodayupload.longValue())); yspbeans.setNowuploadnum(BigInteger.valueOf(ysptodayupload.longValue()));
listModel.getList().add(yspbeans); listModel.getList().add(yspbeans);
ListModel.Beans txbeans = new ListModel.Beans(); ListModel.Beans txbeans = new ListModel.Beans();
txbeans.setName("铁芯夹件"); txbeans.setName("铁芯夹件");
Data_Tx data_tx1 = data_txDao.selectMaxId(); Data_Tx data_tx1 = data_txDao.selectMaxId();
@ -1521,7 +1515,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
txbeans.setNowuploadnum(BigInteger.valueOf(txtodayupload.longValue())); txbeans.setNowuploadnum(BigInteger.valueOf(txtodayupload.longValue()));
listModel.getList().add(txbeans); listModel.getList().add(txbeans);
ListModel.Beans dlqbeans = new ListModel.Beans(); ListModel.Beans dlqbeans = new ListModel.Beans();
dlqbeans.setName("断路器局放"); dlqbeans.setName("断路器局放");
Data_Dlq_Jbfd data_dlq_jbfd1 = data_dlq_jbfdDao.selectMaxId(); Data_Dlq_Jbfd data_dlq_jbfd1 = data_dlq_jbfdDao.selectMaxId();
@ -1539,7 +1532,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
listModel.getList().add(dlqbeans); listModel.getList().add(dlqbeans);
ListModel.Beans sf6beans = new ListModel.Beans(); ListModel.Beans sf6beans = new ListModel.Beans();
sf6beans.setName("SF6气体压力"); sf6beans.setName("SF6气体压力");
Data_SF6_Qtyl data_sf6_qtyl1 = data_sf6_qtylDao.selectMaxId(); Data_SF6_Qtyl data_sf6_qtyl1 = data_sf6_qtylDao.selectMaxId();
@ -1593,6 +1585,188 @@ public class XydlI2ServiceImpl implements XydlI2Service {
serviceBody.setCode(ServiceStatus.SUCCESS); serviceBody.setCode(ServiceStatus.SUCCESS);
serviceBody.setData(listModel); serviceBody.setData(listModel);
return serviceBody; return serviceBody;
}
/**
*
*/
@Override
public void statics() {
// Date updateTime = new Date();
// DateTime uploadTime = DateUtil.beginOfDay(updateTime);
//
// Data_Byq_Jbfd data_byq_jbfd = data_byq_jbfdDao.selectMaxId();
// BigInteger jbfdid = data_byq_jbfd.getMaxid();
// if (jbfdid!=null) {
// Upload_Statics jbfdrecord = new Upload_Statics();
// jbfdrecord.setCheckType(Constant.BYQJBFDID);
// jbfdrecord.setFirstValue(jbfdid);
// jbfdrecord.setUploadTime(uploadTime);
// jbfdrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(jbfdrecord);
// }
//
// Data_Cnj data_cnj = data_cnjDao.selectMaxId();
// BigInteger cnjId = data_cnj.getMaxid();
// if (cnjId != null) {
// Upload_Statics cnjrecord = new Upload_Statics();
// cnjrecord.setCheckType(Constant.CNJID);
// cnjrecord.setFirstValue(cnjId);
// cnjrecord.setUploadTime(uploadTime);
// cnjrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(cnjrecord);
// }
//
//
// Data_Dcyw data_dcyw = data_dcywDao.selectMaxId();
// BigInteger dcywId = data_dcyw.getId();
// if (dcywId != null) {
// Upload_Statics dcywrecord = new Upload_Statics();
// dcywrecord.setCheckType(Constant.DCYWID);
// dcywrecord.setFirstValue(dcywId);
// dcywrecord.setUploadTime(uploadTime);
// dcywrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(dcywrecord);
// }
//
// Data_Dlq_Jbfd data_dlq_jbfd = data_dlq_jbfdDao.selectMaxId();
// BigInteger dlq_jbfdId = data_dlq_jbfd.getId();
// if (dlq_jbfdId!=null) {
// Upload_Statics dlq_jbfdrecord = new Upload_Statics();
// dlq_jbfdrecord.setCheckType(Constant.DLQJBFDID);
// dlq_jbfdrecord.setFirstValue(dlq_jbfdId);
// dlq_jbfdrecord.setUploadTime(uploadTime);
// dlq_jbfdrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(dlq_jbfdrecord);
// }
//
//
// Data_Dr_Jyjc data_dr_jyjc = data_dr_jyjcDao.selectMaxId();
// BigInteger dr_jyjcId = data_dr_jyjc.getId();
// if (dr_jyjcId !=null) {
// Upload_Statics dr_jyjcrecord = new Upload_Statics();
// dr_jyjcrecord.setCheckType(Constant.DRJYJCID);
// dr_jyjcrecord.setFirstValue(dr_jyjcId);
// dr_jyjcrecord.setUploadTime(uploadTime);
// dr_jyjcrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(dr_jyjcrecord);
// }
//
// Data_Fhdlbx data_fhdlbx = data_fhdlbxDao.selectMaxId();
// BigInteger fhdlbxId = data_fhdlbx.getId();
// if (fhdlbxId!=null) {
// Upload_Statics fhdlbxIdrecord = new Upload_Statics();
// fhdlbxIdrecord.setCheckType(Constant.FHDLBXID);
// fhdlbxIdrecord.setFirstValue(fhdlbxId);
// fhdlbxIdrecord.setUploadTime(uploadTime);
// fhdlbxIdrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(fhdlbxIdrecord);
// }
//
// Data_Fhzxq data_fhzxq = data_fhzxqDao.selectMaxId();
// BigInteger fhzxqId = data_fhzxq.getId();
// if (fhzxqId!=null) {
// Upload_Statics fhzxqrecord = new Upload_Statics();
// fhzxqrecord.setCheckType(Constant.FHZXQID);
// fhzxqrecord.setFirstValue(fhzxqId);
// fhzxqrecord.setUploadTime(uploadTime);
// fhzxqrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(fhzxqrecord);
// }
//
//
// Data_Jsyhw_Jyjc data_jsyhw_jyjc = data_jsyhw_jyjcDao.selectMaxId();
// BigInteger jsyhw_jyjcId = data_jsyhw_jyjc.getId();
// if (jsyhw_jyjcId !=null) {
// Upload_Statics jsyhw_jyjcrecord = new Upload_Statics();
// jsyhw_jyjcrecord.setCheckType(Constant.JSYHWJYJCID);
// jsyhw_jyjcrecord.setFirstValue(jsyhw_jyjcId);
// jsyhw_jyjcrecord.setUploadTime(uploadTime);
// jsyhw_jyjcrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(jsyhw_jyjcrecord);
// }
//
// Data_SF6_Qtsf data_sf6_qtsf = data_sf6_qtsfDao.selectMaxId();
// BigInteger sf6_qtsfId = data_sf6_qtsf.getId();
// if (sf6_qtsfId != null) {
// Upload_Statics sf6_qtsfrecord = new Upload_Statics();
// sf6_qtsfrecord.setCheckType(Constant.SF6QTSFID);
// sf6_qtsfrecord.setFirstValue(sf6_qtsfId);
// sf6_qtsfrecord.setUploadTime(uploadTime);
// sf6_qtsfrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(sf6_qtsfrecord);
// }
//
// Data_SF6_Qtyl data_sf6_qtyl = data_sf6_qtylDao.selectMaxId();
// BigInteger sf6_qtylId = data_sf6_qtyl.getId();
// if (sf6_qtylId !=null) {
// Upload_Statics sf6_qtylIdrecord = new Upload_Statics();
// sf6_qtylIdrecord.setCheckType(Constant.SF6QTYLID);
// sf6_qtylIdrecord.setFirstValue(sf6_qtylId);
// sf6_qtylIdrecord.setUploadTime(uploadTime);
// sf6_qtylIdrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(sf6_qtylIdrecord);
// }
//
// Data_Tx data_tx = data_txDao.selectMaxId();
// BigInteger txId = data_tx.getId();
// if (txId != null) {
// Upload_Statics txrecord = new Upload_Statics();
// txrecord.setCheckType(Constant.TXID);
// txrecord.setFirstValue(txId);
// txrecord.setUploadTime(uploadTime);
// txrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(txrecord);
// }
//
//
// Data_Ws data_ws = data_wsDao.selectMaxId();
// BigInteger wsId = data_ws.getId();
// if (wsId!=null) {
// Upload_Statics wsrecord = new Upload_Statics();
// wsrecord.setCheckType(Constant.WSID);
// wsrecord.setFirstValue(wsId);
// wsrecord.setUploadTime(uploadTime);
// wsrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(wsrecord);
// }
//
//
// Data_Ysp data_ysp = data_yspDao.selectMaxId();
// BigInteger yspId = data_ysp.getId();
// if (yspId!=null) {
// Upload_Statics ysprecord = new Upload_Statics();
// ysprecord.setCheckType(Constant.YSPID);
// ysprecord.setFirstValue(yspId);
// ysprecord.setUploadTime(uploadTime);
// ysprecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(ysprecord);
// }
//
//
// Data_Microclimate data_microclimate = data_microclimateDao.selectMaxId();
// BigInteger microclimateId = data_microclimate.getId();
// if (microclimateId !=null) {
// Upload_Statics microclimaterecord = new Upload_Statics();
// microclimaterecord.setCheckType(Constant.MICROCLIMATEID);
// microclimaterecord.setFirstValue(microclimateId);
// microclimaterecord.setUploadTime(uploadTime);
// microclimaterecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(microclimaterecord);
// }
//
//
// Data_YxlDto data_yxlDto = data_yxDao.selectMaxId();
// BigInteger yxId = data_yxlDto.getId();
// if (yxId!=null) {
// Upload_Statics yxrecord = new Upload_Statics();
// yxrecord.setCheckType(Constant.YXID);
// yxrecord.setFirstValue(yxId);
// yxrecord.setUploadTime(uploadTime);
// yxrecord.setUpdateTime(updateTime);
// upload_staticsDao.insertSelective(yxrecord);
//
// }
} }

@ -66,11 +66,16 @@ public class ScheduledTask {
webservcies.uploadjsyhwjyjcData(); webservcies.uploadjsyhwjyjcData();
} }
@Scheduled(cron = "0 0 13 * * ?") @Scheduled(cron = "0 0 13 * * ?")
public void clear() { public void clear() {
log.info("clear" ); log.info("clear" );
xydlI2Service.clear_history(); xydlI2Service.clear_history();
} }
// @Scheduled(cron = "0 0 * * * ?")
// public void statics() {
// log.info("开始统计" );
// xydlI2Service.statics();
// }
} }

@ -68,7 +68,21 @@ spring:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 8094 port: 8095
servlet:
# 应用的访问路径
context-path: /xymanager
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
max-swallow-size: -1 # tomcat默认大小2M超过2M的文件不会被捕获需要调整此处大小为100MB或者-1即可
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 日志配置 # 日志配置
logging: logging:

@ -17,7 +17,7 @@
<!-- 数据库链接URL、用户名、密码 --> <!-- 数据库链接URL、用户名、密码 -->
<!-- driverClass="com.mysql.jdbc.Driver"--> <!-- driverClass="com.mysql.jdbc.Driver"-->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/cacdb?userUnicode=true&amp;characterEncoding=utf8" connectionURL="jdbc:mysql://127.0.0.1:3306/iec104?userUnicode=true&amp;characterEncoding=utf8"
userId="root" userId="root"
password="123456"> password="123456">
</jdbcConnection> </jdbcConnection>
@ -181,11 +181,18 @@
<!-- </table>--> <!-- </table>-->
<table tableName="data_yx" <!-- <table tableName="data_yx"-->
domainObjectName="Data_Yx" <!-- domainObjectName="Data_Yx"-->
mapperName="Data_YxDao" <!-- mapperName="Data_YxDao"-->
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" <!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
enableSelectByExample="false" selectByExampleQueryId="false"> <!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="upload_statics"
domainObjectName="Upload_Statics"
mapperName="Upload_StaticsDao"
>
<!-- <property name="useActualColumnNames" value="false"/>--> <!-- <property name="useActualColumnNames" value="false"/>-->
</table> </table>

@ -36,4 +36,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_byq_jbfd where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_byq_jbfd where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_byq_jbfd
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -30,4 +30,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_cnj where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_cnj where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_cnj
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -30,4 +30,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dcyw where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dcyw where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_dcyw
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -37,4 +37,10 @@
<select id="selectNowId" resultMap="BaseResultMap"> <select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dlq_jbfd where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dlq_jbfd where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_dlq_jbfd
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -36,5 +36,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dr_jyjc where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_dr_jyjc where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_dr_jyjc
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -32,4 +32,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_fhdlbx where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_fhdlbx where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_fhdlbx
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -35,5 +35,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_jsyhw_jyjc where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_jsyhw_jyjc where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_jsyhw_jyjc
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -38,4 +38,10 @@
<select id="selectNowId" resultMap="BaseResultMap"> <select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_microclimate where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_microclimate where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_microclimate
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -31,4 +31,10 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_sf6_qtsf where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_sf6_qtsf where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_sf6_qtsf
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -48,4 +48,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_sf6_qtyl where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_sf6_qtyl where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_sf6_qtyl
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -30,4 +30,11 @@
from data_tx from data_tx
where id <![CDATA[>]]> #{maxid} limit 10000 where id <![CDATA[>]]> #{maxid} limit 10000
</select> </select>
<delete id="deleteData" >
delete
from data_tx
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -30,4 +30,9 @@
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_ws where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_ws where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_ws
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -44,4 +44,9 @@
data_ysp t1 where t1.id <![CDATA[>]]> #{maxid} limit 10000 data_ysp t1 where t1.id <![CDATA[>]]> #{maxid} limit 10000
</select> </select>
<delete id="deleteData" >
delete
from data_ysp
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>

@ -0,0 +1,388 @@
<?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.i2.dao.Upload_StaticsDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Upload_Statics">
<id column="check_type" jdbcType="VARCHAR" property="checkType" />
<result column="id" jdbcType="INTEGER" property="id" />
<result column="first_value" jdbcType="BIGINT" property="firstValue" />
<result column="upload_time" jdbcType="DATE" property="uploadTime" />
<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">
check_type, id, first_value, upload_time, update_time
</sql>
<select id="selectByExample" parameterType="com.shxy.i2.entity.Upload_StaticsExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from upload_statics
<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.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from upload_statics
where check_type = #{checkType,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from upload_statics
where check_type = #{checkType,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.shxy.i2.entity.Upload_StaticsExample">
delete from upload_statics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.shxy.i2.entity.Upload_Statics">
insert into upload_statics (check_type, id, first_value,
upload_time, update_time)
values (#{checkType,jdbcType=VARCHAR}, #{id,jdbcType=INTEGER}, #{firstValue,jdbcType=BIGINT},
#{uploadTime,jdbcType=DATE}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.i2.entity.Upload_Statics">
insert into upload_statics
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkType != null">
check_type,
</if>
<if test="id != null">
id,
</if>
<if test="firstValue != null">
first_value,
</if>
<if test="uploadTime != null">
upload_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkType != null">
#{checkType,jdbcType=VARCHAR},
</if>
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="firstValue != null">
#{firstValue,jdbcType=BIGINT},
</if>
<if test="uploadTime != null">
#{uploadTime,jdbcType=DATE},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.shxy.i2.entity.Upload_StaticsExample" resultType="java.lang.Long">
select count(*) from upload_statics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update upload_statics
<set>
<if test="record.checkType != null">
check_type = #{record.checkType,jdbcType=VARCHAR},
</if>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.firstValue != null">
first_value = #{record.firstValue,jdbcType=BIGINT},
</if>
<if test="record.uploadTime != null">
upload_time = #{record.uploadTime,jdbcType=DATE},
</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 upload_statics
set check_type = #{record.checkType,jdbcType=VARCHAR},
id = #{record.id,jdbcType=INTEGER},
first_value = #{record.firstValue,jdbcType=BIGINT},
upload_time = #{record.uploadTime,jdbcType=DATE},
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.i2.entity.Upload_Statics">
update upload_statics
<set>
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="firstValue != null">
first_value = #{firstValue,jdbcType=BIGINT},
</if>
<if test="uploadTime != null">
upload_time = #{uploadTime,jdbcType=DATE},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where check_type = #{checkType,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Upload_Statics">
update upload_statics
set id = #{id,jdbcType=INTEGER},
first_value = #{firstValue,jdbcType=BIGINT},
upload_time = #{uploadTime,jdbcType=DATE},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where check_type = #{checkType,jdbcType=VARCHAR}
</update>
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Upload_Statics">
<id column="check_type" jdbcType="VARCHAR" property="checkType" />
<result column="value" jdbcType="BIGINT" property="value" />
<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">
check_type, value, update_time
</sql>
<select id="selectByExample" parameterType="com.shxy.i2.entity.Upload_StaticsExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from upload_statics
<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.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from upload_statics
where check_type = #{checkType,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from upload_statics
where check_type = #{checkType,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.shxy.i2.entity.Upload_StaticsExample">
delete from upload_statics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.shxy.i2.entity.Upload_Statics">
insert into upload_statics (check_type, value, update_time
)
values (#{checkType,jdbcType=VARCHAR}, #{value,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.shxy.i2.entity.Upload_Statics">
insert into upload_statics
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkType != null">
check_type,
</if>
<if test="value != null">
value,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkType != null">
#{checkType,jdbcType=VARCHAR},
</if>
<if test="value != null">
#{value,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.shxy.i2.entity.Upload_StaticsExample" resultType="java.lang.Long">
select count(*) from upload_statics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update upload_statics
<set>
<if test="record.checkType != null">
check_type = #{record.checkType,jdbcType=VARCHAR},
</if>
<if test="record.value != null">
value = #{record.value,jdbcType=BIGINT},
</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 upload_statics
set check_type = #{record.checkType,jdbcType=VARCHAR},
value = #{record.value,jdbcType=BIGINT},
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.i2.entity.Upload_Statics">
update upload_statics
<set>
<if test="value != null">
value = #{value,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where check_type = #{checkType,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Upload_Statics">
update upload_statics
set value = #{value,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where check_type = #{checkType,jdbcType=VARCHAR}
</update>
</mapper>

@ -30,4 +30,10 @@
<select id="selectNowId" resultMap="BaseResultMap"> <select id="selectNowId" resultMap="BaseResultMap">
SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_fhzxq where acquisitionTime >= #{date} SELECT MAX( id ) AS maxid,MIN( id ) AS minid FROM data_fhzxq where acquisitionTime >= #{date}
</select> </select>
<delete id="deleteData" >
delete
from data_fhzxq
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper> </mapper>
Loading…
Cancel
Save