I2代码优化

master
liuguijing 1 year ago
parent a6f8dda81b
commit 8ed582cf61

@ -87,6 +87,14 @@
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>

@ -4,11 +4,9 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.XML;
import com.shxy.i2.bean.SendDataBean;
import com.shxy.i2.constant.CommonStatus;
import com.shxy.i2.constant.Constant;
import com.shxy.i2.dao.*;
import com.shxy.i2.dto.Data_YxlDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.cxf.endpoint.Client;
import org.springframework.beans.factory.annotation.Autowired;
@ -129,46 +127,6 @@ public class AsyncMethod {
}
}
// @Async(value = "asyncServiceExecutor")
// public void sendJBFDData(Client client, ArrayList<SendDataBean> idlist, 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: " + idlist.toString());
// if (CollectionUtil.isNotEmpty(idlist)) {
// if (StrUtil.equals(type, Constant.BYQ_JBFD)) {
// data_byq_jbfdDao.updateDataList(CommonStatus.UPLOAD.value(), idlist, new Date());
// } else if (StrUtil.equals(type, Constant.DLQJBFD)) {
// data_dlq_jbfdDao.updateDataList(CommonStatus.UPLOAD.value(), idlist, new Date());
// } else if (StrUtil.equals(type, Constant.YSP)) {
// data_yspDao.updateDataList(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);
@ -196,8 +154,6 @@ public class AsyncMethod {
} else if (StrUtil.equals(type, Constant.YSP)) {
data_yspDao.updateDataList2(CommonStatus.UPLOAD.value(), maxid, list1, new Date());
}
}
} else {
log.info("上传失败");
@ -209,32 +165,63 @@ public class AsyncMethod {
}
@Async(value = "asyncServiceExecutor")
public void sendYxData(Client client, BigInteger maxid, String xml) throws Exception {
Object[] objects = client.invoke("uploadCACData", xml);
public void sendData2(Client client, 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("上传成功");
// 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("上传成功");
// } else {
// log.info("上传失败");
// }
// }
// }
// }
// }
}
@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("上传失败");
}
}
}
}
}
// } else {
// log.info("上传失败");
// }
// }
// }
// }
// }
}
public void updateRecordId(BigInteger maxid,String type) {
if (maxid != null && maxid.longValue() > 0) {
upload_checkDao.updateByPrimaryKey(type, maxid, new Date());
}
}
}

@ -0,0 +1,449 @@
package com.shxy.i2.Tool;
import cn.hutool.core.text.StrFormatter;
import org.springframework.util.AntPathMatcher;
import java.util.*;
/**
*
*
* @author
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils {
/**
*
*/
private static final String NULLSTR = "";
/**
* 线
*/
private static final char SEPARATOR = '_';
/**
*
*
* @param value defaultValue value
* @return value
*/
public static <T> T nvl(T value, T defaultValue) {
return value != null ? value : defaultValue;
}
/**
* * Collection ListSetQueue
*
* @param coll Collection
* @return true false
*/
public static boolean isEmpty(Collection<?> coll) {
return isNull(coll) || coll.isEmpty();
}
/**
* * CollectionListSetQueue
*
* @param coll Collection
* @return true false
*/
public static boolean isNotEmpty(Collection<?> coll) {
return !isEmpty(coll);
}
/**
* *
*
* @param objects
* * @return true false
*/
public static boolean isEmpty(Object[] objects) {
return isNull(objects) || (objects.length == 0);
}
/**
* *
*
* @param objects
* @return true false
*/
public static boolean isNotEmpty(Object[] objects) {
return !isEmpty(objects);
}
/**
* * Map
*
* @param map Map
* @return true false
*/
public static boolean isEmpty(Map<?, ?> map) {
return isNull(map) || map.isEmpty();
}
/**
* * Map
*
* @param map Map
* @return true false
*/
public static boolean isNotEmpty(Map<?, ?> map) {
return !isEmpty(map);
}
/**
* *
*
* @param str String
* @return true false
*/
public static boolean isEmpty(String str) {
return isNull(str) || NULLSTR.equals(str.trim());
}
/**
* *
*
* @param str String
* @return true false
*/
public static boolean isNotEmpty(String str) {
return !isEmpty(str);
}
/**
* *
*
* @param object Object
* @return true false
*/
public static boolean isNull(Object object) {
return object == null;
}
/**
* *
*
* @param object Object
* @return true false
*/
public static boolean isNotNull(Object object) {
return !isNull(object);
}
/**
* * Java
*
* @param object
* @return true false
*/
public static boolean isArray(Object object) {
return isNotNull(object) && object.getClass().isArray();
}
/**
*
*/
public static String trim(String str) {
return (str == null ? "" : str.trim());
}
/**
*
*
* @param str
* @param start
* @return
*/
public static String substring(final String str, int start) {
if (str == null) {
return NULLSTR;
}
if (start < 0) {
start = str.length() + start;
}
if (start < 0) {
start = 0;
}
if (start > str.length()) {
return NULLSTR;
}
return str.substring(start);
}
/**
*
*
* @param str
* @param start
* @param end
* @return
*/
public static String substring(final String str, int start, int end) {
if (str == null) {
return NULLSTR;
}
if (end < 0) {
end = str.length() + end;
}
if (start < 0) {
start = str.length() + start;
}
if (end > str.length()) {
end = str.length();
}
if (start > end) {
return NULLSTR;
}
if (start < 0) {
start = 0;
}
if (end < 0) {
end = 0;
}
return str.substring(start, end);
}
/**
* , {} <br>
* {} <br>
* {} 使 \\ { {} \ 使 \\\\ <br>
* <br>
* 使format("this is {} for {}", "a", "b") -> this is a for b<br>
* {} format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
* \ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
*
* @param template {}
* @param params
* @return
*/
public static String format(String template, Object... params) {
if (isEmpty(params) || isEmpty(template)) {
return template;
}
return StrFormatter.format(template, params);
}
/**
* set
*
* @param str
* @param sep
* @return set
*/
public static final Set<String> str2Set(String str, String sep) {
return new HashSet<String>(str2List(str, sep, true, false));
}
/**
* list
*
* @param str
* @param sep
* @param filterBlank
* @param trim
* @return list
*/
public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) {
List<String> list = new ArrayList<String>();
if (StringUtils.isEmpty(str)) {
return list;
}
// 过滤空白字符串
if (StringUtils.isBlank(str)) {
return list;
}
String[] split = str.split(sep);
for (String string : split) {
if (StringUtils.isBlank(string)) {
continue;
}
if (trim) {
string = string.trim();
}
list.add(string);
}
return list;
}
/**
*
*
* @param cs
* @param searchCharSequences
* @return
*/
public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) {
if (isEmpty(cs) || isEmpty(searchCharSequences)) {
return false;
}
for (CharSequence testStr : searchCharSequences) {
if (containsIgnoreCase(cs, testStr)) {
return true;
}
}
return false;
}
/**
* 线
*/
public static String toUnderScoreCase(String str) {
if (str == null) {
return null;
}
StringBuilder sb = new StringBuilder();
// 前置字符是否大写
boolean preCharIsUpperCase = true;
// 当前字符是否大写
boolean curreCharIsUpperCase = true;
// 下一字符是否大写
boolean nexteCharIsUpperCase = true;
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (i > 0) {
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
} else {
preCharIsUpperCase = false;
}
curreCharIsUpperCase = Character.isUpperCase(c);
if (i < (str.length() - 1)) {
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
}
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
sb.append(SEPARATOR);
} else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
sb.append(SEPARATOR);
}
sb.append(Character.toLowerCase(c));
}
return sb.toString();
}
/**
*
*
* @param str
* @param strs
* @return true
*/
public static boolean inStringIgnoreCase(String str, String... strs) {
if (str != null && strs != null) {
for (String s : strs) {
if (str.equalsIgnoreCase(trim(s))) {
return true;
}
}
}
return false;
}
/**
* 线线 HELLO_WORLD->HelloWorld
*
* @param name 线
* @return
*/
public static String convertToCamelCase(String name) {
StringBuilder result = new StringBuilder();
// 快速检查
if (name == null || name.isEmpty()) {
// 没必要转换
return "";
} else if (!name.contains("_")) {
// 不含下划线,仅将首字母大写
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
// 用下划线将原始字符串分割
String[] camels = name.split("_");
for (String camel : camels) {
// 跳过原始字符串中开头、结尾的下换线或双重下划线
if (camel.isEmpty()) {
continue;
}
// 首字母大写
result.append(camel.substring(0, 1).toUpperCase());
result.append(camel.substring(1).toLowerCase());
}
return result.toString();
}
/**
* user_name->userName
*/
public static String toCamelCase(String s) {
if (s == null) {
return null;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == SEPARATOR) {
upperCase = true;
} else if (upperCase) {
sb.append(Character.toUpperCase(c));
upperCase = false;
} else {
sb.append(c);
}
}
return sb.toString();
}
/**
*
*
* @param str
* @param strs
* @return
*/
public static boolean matches(String str, List<String> strs) {
if (isEmpty(str) || isEmpty(strs)) {
return false;
}
for (String pattern : strs) {
if (isMatch(pattern, str)) {
return true;
}
}
return false;
}
/**
* url:
* ? ;
* * ;
* ** ;
*
* @param pattern
* @param url url
* @return
*/
public static boolean isMatch(String pattern, String url) {
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, url);
}
@SuppressWarnings("unchecked")
public static <T> T cast(Object obj) {
return (T) obj;
}
}

@ -0,0 +1,62 @@
package com.shxy.i2.Tool.sql;
import cn.hutool.core.exceptions.UtilException;
import com.shxy.i2.Tool.StringUtils;
/**
* sql
*
* @author ruoyi
*/
public class SqlUtils extends cn.hutool.db.sql.SqlUtil
{
/**
* sql
*/
public static String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare ";
/**
* 线
*/
public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+";
/**
*
*/
public static String escapeOrderBySql(String value)
{
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
{
throw new UtilException("参数不符合规范,不能进行查询");
}
return value;
}
/**
* order by
*/
public static boolean isValidOrderBySql(String value)
{
return value.matches(SQL_PATTERN);
}
/**
* SQL
*/
public static void filterKeyword(String value)
{
if (StringUtils.isEmpty(value))
{
return;
}
String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|");
for (String sqlKeyword : sqlKeywords)
{
if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1)
{
throw new UtilException("参数存在SQL注入风险");
}
}
}
}

@ -5,6 +5,20 @@ public class Constant {
public static String YXID = "yxid";
public static String YSPID = "yspid";
public static String BYQJBFDID = "byqjbfdid";
public static String DLQJBFDID = "dlqjbfdid";
public static String CNJID = "cnjid";
public static String DCYWID = "dcywid";
public static String DRJYJCID = "drjyjcid";
public static String FHDLBXID = "fhdlbxid";
public static String FHZXQID = "fhzxqid";
public static String JSYHWJYJCID = "jsyhwjyjcid";
public static String SF6QTSFID = "sf6qtsfid";
public static String SF6QTYLID = "sf6qtylid";
public static String TXID = "txid";
public static String WSID = "wsid";
public static String MICROCLIMATEID = "microclimateid";
public static String BYQ_JBFD = "021001";
public static String YSP = "021002";

@ -11,6 +11,8 @@ import java.util.List;
public interface Data_Byq_JbfdDao {
List<Data_Byq_Jbfd> selectUploadById(@Param("maxid") BigInteger maxid);
List<Data_Byq_Jbfd> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
@ -21,6 +23,6 @@ public interface Data_Byq_JbfdDao {
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);
}

@ -1,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Cnj;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_CnjDao {
List<Data_Cnj> selectUploadById(@Param("maxid") BigInteger maxid);
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);
@ -17,4 +18,5 @@ public interface Data_CnjDao {
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int deleteData(@Param("time") Date time);
}

@ -1,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Dcyw;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_DcywDao {
List<Data_Dcyw> selectUploadById(@Param("maxid") BigInteger maxid);
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);
@ -17,4 +18,5 @@ public interface Data_DcywDao {
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int deleteData(@Param("time") Date time);
}

@ -1,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.bean.SendDataBean;
import com.shxy.i2.entity.Data_Dlq_Jbfd;
import org.apache.ibatis.annotations.Param;
@ -14,6 +13,8 @@ public interface Data_Dlq_JbfdDao {
List<Data_Dlq_Jbfd> selectUpload(@Param("isupload") Integer isupload);
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);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);

@ -1,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Dr_Jyjc;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_Dr_JyjcDao {
List<Data_Dr_Jyjc> selectUploadById(@Param("maxid") BigInteger maxid);
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,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Fhdlbx;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_FhdlbxDao {
List<Data_Fhdlbx> selectUploadById(@Param("maxid") BigInteger maxid);
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,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Fhzxq;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_FhzxqDao {
List<Data_Fhzxq> selectUploadById(@Param("maxid") BigInteger maxid);
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,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Jsyhw_Jyjc;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_Jsyhw_JyjcDao {
List<Data_Jsyhw_Jyjc> selectUploadById(@Param("maxid") BigInteger maxid);
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,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Microclimate;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_MicroclimateDao {
List<Data_Microclimate> selectUploadById(@Param("maxid") BigInteger maxid);
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,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_SF6_Qtsf;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_SF6_QtsfDao {
List<Data_SF6_Qtsf> selectUploadById(@Param("maxid") BigInteger maxid);
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,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_SF6_Qtyl;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_SF6_QtylDao {
List<Data_SF6_Qtyl> selectUploadById(@Param("maxid") BigInteger maxid);
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,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Tx;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_TxDao {
List<Data_Tx> selectUploadById(@Param("maxid") BigInteger maxid);
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);

@ -1,6 +1,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.entity.Data_Ws;
import org.apache.ibatis.annotations.Param;
@ -10,6 +9,8 @@ import java.util.List;
public interface Data_WsDao {
List<Data_Ws> selectUploadById(@Param("maxid") BigInteger maxid);
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,5 @@
package com.shxy.i2.dao;
import cn.hutool.core.date.DateTime;
import com.shxy.i2.bean.SendDataBean;
import com.shxy.i2.entity.Data_Ysp;
import org.apache.ibatis.annotations.Param;
@ -12,6 +11,8 @@ import java.util.List;
public interface Data_YspDao {
List<Data_Ysp> selectUploadById(@Param("maxid") BigInteger maxid);
List<Data_Ysp> 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,7 +1,6 @@
package com.shxy.i2.dao;
import com.shxy.i2.dto.Data_YxlDto;
import com.shxy.i2.entity.Data_Yx;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
@ -12,7 +11,5 @@ public interface Data_YxDao {
List<Data_YxlDto> selectByPrimaryKey(@Param("maxid") BigInteger maxid);
int updateByPrimaryKey(Data_Yx record);
int deleteData(@Param("time") Date time);
}

@ -8,6 +8,9 @@ public interface Webservcies {
void uploadyspData();
void uploadjfjcData();
void uploadyxData();
// void test(String str);
void uploaddcywData();
void uploadjsyhwjyjcData();
}

@ -11,6 +11,7 @@ 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;
@ -31,28 +32,39 @@ public class WebServiceImpl implements Webservcies {
@Autowired
private Niec_SensorsDao niec_sensorsDao;
private static String address = "http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl";
@Value("${webservice.address}")
public String address;
@Value("${webservice.connecttime}")
public Integer connecttime;
@Value("${webservice.receivetime}")
public Integer receivetime;
/**
* cac
*/
@Override
public void uploadData() {
log.info("实时数据定时任务启动");
// 动态客户端
JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
log.info("实时数据 publicsecurity webService url : {}", address);
//根据WebServices接口地址创建client
Client client = clientFactory.createClient(address);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setAllowChunking(false);
// 连接服务器超时时间 60秒
policy.setConnectionTimeout(60000);
// 等待服务器响应超时时间 60秒
policy.setReceiveTimeout(30000);
conduit.setClient(policy);
// log.info("实时数据定时任务启动");
// // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
@ -60,65 +72,37 @@ public class WebServiceImpl implements Webservcies {
equipMap.put(item.getId(), item);
}
xydlI2Service.upload_sf6_qtyl(client, equipMap);
xydlI2Service.upload_dcyw(client, equipMap);
xydlI2Service.upload_fhdlbx(client, equipMap);
xydlI2Service.upload_fhzxq(client, equipMap);
xydlI2Service.upload_sf6_qtsf(client, equipMap);
xydlI2Service.upload_tx(client, equipMap);
xydlI2Service.upload_ws(client, equipMap);
xydlI2Service.upload_dr_jyjc(client, equipMap);
xydlI2Service.upload_jsyhw_jyjc(client, equipMap);
xydlI2Service.upload_microclimate(client, equipMap);
xydlI2Service.upload_cnj(client, equipMap);
xydlI2Service.upload_yx(client);
log.info("实时数据定时任务结束");
}
// /**
// * 上传cac数据
// */
// @Override
// public void uploadYxData() {
// log.info("实时数据遥信定时任务启动");
//// 动态客户端
//放到配置文件
@Override
public void uploadyspData() {
// log.info("油色谱数据定时任务启动");
// // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address);
// log.info("油色谱数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(60000);
// policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(30000);
// policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy);
// log.info("开始执行定时遥信任务-查询数据库");
// xydlI2Service.upload_yx(client);
//
// log.info("实时数据定时遥信任务结束");
//
// }
@Override
public void uploadyspData() {
log.info("油色谱数据定时任务启动");
// 动态客户端
JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
log.info("油色谱数据 publicsecurity webService url : {}", address);
//根据WebServices接口地址创建client
Client client = clientFactory.createClient(address);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setAllowChunking(false);
// 连接服务器超时时间 60秒
policy.setConnectionTimeout(60000);
// 等待服务器响应超时时间 60秒
policy.setReceiveTimeout(60000);
conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
@ -131,21 +115,21 @@ public class WebServiceImpl implements Webservcies {
@Override
public void uploadjfjcData() {
log.info("局放监测数据定时任务启动");
// 动态客户端
JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
log.info("局放监测数据 publicsecurity webService url : {}", address);
//根据WebServices接口地址创建client
Client client = clientFactory.createClient(address);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setAllowChunking(false);
// 连接服务器超时时间 60秒
policy.setConnectionTimeout(60000);
// 等待服务器响应超时时间 60秒
policy.setReceiveTimeout(60000);
conduit.setClient(policy);
// log.info("局放监测数据定时任务启动");
// // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("局放监测数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy);
Client client = null;
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
for (Niec_Sensors item : niec_sensors) {
@ -156,4 +140,85 @@ public class WebServiceImpl implements Webservcies {
log.info("局放监测数据定时任务结束");
}
@Override
public void uploadyxData() {
// log.info("实时数据定时任务启动");
// // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item);
}
xydlI2Service.upload_yx(client);
log.info("实时数据定时任务结束");
}
@Override
public void uploaddcywData() {
// log.info("实时数据定时任务启动");
// // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item);
}
xydlI2Service.upload_dcyw(client, equipMap);
log.info("实时数据定时任务结束");
}
@Override
public void uploadjsyhwjyjcData() {
// log.info("实时数据定时任务启动");
// // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
for (Niec_Sensors item : niec_sensors) {
equipMap.put(item.getId(), item);
}
xydlI2Service.upload_jsyhw_jyjc(client, equipMap);
log.info("实时数据定时任务结束");
}
}

@ -20,54 +20,62 @@ import org.springframework.stereotype.Component;
@EnableAsync
public class ScheduledTask {
@Autowired
Webservcies webservcies;
@Autowired
XydlI2Service xydlI2Service;
@Async(value = "asyncServiceExecutor")
private int i1 = 0;
private int i2 = 0;
private int i3 = 0;
private int i4 = 0;
private int i5 = 0;
private int i6 = 0;
private int i7 = 0;
private int i8 = 0;
private int i9 = 0;
@Scheduled(fixedDelay = 60 * 60 * 1000)
public void cacyspupload() {
log.error("cacyspupload执行" + (i1++) );
webservcies.uploadyspData();
}
@Async(value = "asyncServiceExecutor")
@Scheduled(fixedDelay = 10 * 60 * 1000)
@Scheduled(fixedDelay = 1 * 60 * 1000)
public void cacjfjcupload() {
log.error("cacjfjcupload执行" + (i2++) );
webservcies.uploadjfjcData();
}
// @Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(fixedDelay = 5 * 30 * 1000)
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacupload() {
log.error("cacupload执行" + (i3++) );
webservcies.uploadData();
}
@Scheduled(cron = "0 0 13 * * ?")
public void clear() {
xydlI2Service.clear_history();
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacyxupload() {
log.error("cacyxupload执行" + (i4++) );
webservcies.uploadyxData();
}
// @Scheduled(cron = "0 0/1 * * * ?")
// @Scheduled(fixedDelay = 5 * 30 * 1000)
// public void cacyxupload() {
// webservcies.uploadYxData();
// String str = "aaaa";
// webservcies.test(str);
// }
//
// @Scheduled(cron = "0 * * * * ?")
// @Async(value = "asyncServiceExecutor")
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacdcywupload() {
log.error("cacdcywupload执行" + (i5++) );
webservcies.uploaddcywData();
}
@Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacjsyhwjyjcupload() {
log.error("cacjsyhwjyjcupload执行" + (i6++) );
webservcies.uploadjsyhwjyjcData();
}
// @Async(value = "asyncServiceExecutor")
// @Scheduled(fixedDelay = 10 * 60 * 1000)
// public void cacjfjcupload() {
// webservcies.uploadjfjcData();
// @Scheduled(cron = "0 0 13 * * ?")
// public void clear() {
// xydlI2Service.clear_history();
// }
}

@ -6,31 +6,21 @@ spring:
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource
task:
scheduling:
pool:
size: 8
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8094
servlet:
# 应用的访问路径
context-path: /api
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:
config: classpath:log4j2.xml
level:
com.shxy: trace
com.shxy: info
org.springframework: warn
# MyBatis配置
@ -40,4 +30,12 @@ mybatis:
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapper-locations: classpath*:mappers/**/*Dao.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
configLocation: classpath:mybatis/mybatis-config.xml
# webservice
webservice:
# 超高压中心地址
address: http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl
connecttime: 30
receivetime: 30
sendlimit: 100

@ -16,14 +16,17 @@
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, dischargeCapacity, dischargePosition, pulseCount, isupload, dischargeWaveform,
create_time, update_time
</sql>
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->
<!-- from data_byq_jbfd-->
<!-- where isupload is null or isupload = #{isupload}-->
<select id="selectUploadById" resultMap="BaseResultMap">
SELECT
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}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
SELECT
t1.id, t1.eqmid, t1.acquisitionTime, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount, t1.isupload,
t1.dischargeWaveform,

@ -13,6 +13,14 @@
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, chargeTime, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_cnj
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -13,6 +13,14 @@
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, oilTemperature, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_dcyw
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
@ -63,4 +71,5 @@
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
</mapper>

@ -14,16 +14,22 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="dischargeWaveform" jdbcType="LONGVARBINARY" property="dischargewaveform"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, phase, dischargeCapacity, dischargePosition, pulseCount, dischargeWaveform,
isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->
<!-- from data_dlq_jbfd-->
<!-- where isupload is null or isupload = #{isupload}-->
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
SELECT
t1.id, t1.eqmid, t1.acquisitionTime,t1.phase, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount,
t1.isupload,t1.dischargeWaveform,t1.create_time, t1.update_time
FROM
data_dlq_jbfd t1
where t1.id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
SELECT
t1.id, t1.eqmid, t1.acquisitionTime,t1.phase, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount,
t1.isupload,

@ -19,6 +19,14 @@
id, eqmid, acquisitionTime, capacitance, lossFactor, unbalanceCurrent, unbalanceVoltage,
totalCurrent, systemVoltage, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_dr_jyjc
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -13,13 +13,22 @@
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, action, isupload, loadWaveform, create_time, update_time
</sql>
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_fhdlbx
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_fhdlbx
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Fhdlbx">
update data_fhdlbx
<set>

@ -19,6 +19,13 @@
lastActionTime, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_jsyhw_jyjc
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -22,6 +22,13 @@
wddir, precipitationIntensity, radiationIntensity, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_microclimate
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -15,6 +15,13 @@
id, eqmid, acquisitionTime, temperature, moisture, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_sf6_qtsf
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -32,6 +32,13 @@
id, eqmid, acquisitionTime, temperature, absolutePressure, density, pressure20C,
isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_sf6_qtyl
where id <![CDATA[>]]> #{maxid} limit 1000
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -13,6 +13,13 @@
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, totalCoreCurrent, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_tx
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -13,6 +13,13 @@
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, moisture, isupload, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_ws
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

@ -23,6 +23,16 @@
id, eqmid, acquisitionTime, H2, CH4, C2H6, C2H4, C2H2, CO, CO2, O2, N2, TotalHydrocarbon,
isupload, create_time, update_time
</sql>
<!--//每组只查最大的-->
<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}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->

@ -26,7 +26,7 @@
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 1000
</select>
<delete id="deleteData" >

@ -14,12 +14,21 @@
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, action, isupload,coilWaveform, create_time, update_time
</sql>
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_fhzxq
where id <![CDATA[>]]> #{maxid}
</select>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_fhzxq
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Fhzxq">
update data_fhzxq
<set>

@ -1,13 +1,16 @@
//package com.shxy.i2;
//
//import cn.hutool.core.util.XmlUtil;
//import cn.hutool.json.JSONObject;
//import cn.hutool.json.XML;
//
//import java.util.Map;
//
//public class test {
// public static void main(String[] args){
package com.shxy.i2;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.XmlUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.XML;
import java.util.Date;
import java.util.Map;
public class test {
public static void main(String[] args){
// JSONObject jsonObject = XML.toJSONObject("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
// "<response>\n" +
// "<result code=\"0\" />\n" +
@ -27,5 +30,8 @@
// JSONObject result = (JSONObject) response.get("result");
// Integer code = (Integer) result.get("code");
// System.out.println(jsonObject.toString());
// }
//}
DateTime dateTime = DateUtil.offsetDay(new Date(), -7);
System.out.println(dateTime);
}
}

Loading…
Cancel
Save