feat: 调整河南覆冰拉力数据

dev
huangfeng 11 months ago
parent 8a3fa8eac9
commit e129cf3e70

@ -10,6 +10,7 @@ import com.shxy.xymanager_common.zhiping.*;
import com.shxy.xymanager_common.entity.LeadPulls;
import com.shxy.xymanager_common.entity.Weathers;
import com.shxy.xymanager_common.util.DateUtil;
import com.shxy.xymanager_service.service.HenanService;
import com.shxy.xymanager_service.service.LeadPullsService;
import com.shxy.xymanager_service.service.WeatherService;
import io.swagger.annotations.Api;
@ -38,6 +39,8 @@ public class ZhipingController extends BaseController {
WeatherService weatherService;
@Autowired
TokenUtil tokenUtil;
@Resource
HenanService henanService;
@GetMapping("query")
@ApiOperation("查询")
@ -227,11 +230,10 @@ public class ZhipingController extends BaseController {
Date start = DateUtil.parse(startTime);
Date end = DateUtil.parse(endTime);
List<PulliceModel> list = new ArrayList<>();
PageInfo<LeadPulls> page = leadPullsService.list(null, null, null,
start.getTime() / 1000, end.getTime() / 1000, 1, 10000);
if (!CollectionUtils.isEmpty(page.getList())) {
for (LeadPulls pull : page.getList()) {
List<PulliceModel> result = new ArrayList<>();
List<LeadPulls> list = henanService.queryPullIces(start, end);
if (!CollectionUtils.isEmpty(list)) {
for (LeadPulls pull : list) {
PulliceModel item = new PulliceModel();
item.setCollTime(DateUtil.format(pull.getUpdateDate()));
item.setPull(String.valueOf(pull.getMaxpullPull()));
@ -241,10 +243,12 @@ public class ZhipingController extends BaseController {
item.setHumidity("0");
item.setWindSpeed("0");
item.setWAngle("0");
item.setEquipId(pull.getCmdid());
item.setPointId(pull.getCmdid() + "_" + pull.getPhase());
item.calculate();
list.add(item);
result.add(item);
}
}
return SdqjResult.success(list);
return SdqjResult.success(result);
}
}

@ -0,0 +1,178 @@
package com.shxy.xymanager_common.entity;
public class TerminalPoint {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column terminal_point.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column terminal_point.term_id
*
* @mbg.generated
*/
private Integer termId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column terminal_point.point
*
* @mbg.generated
*/
private String point;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column terminal_point.func_code
*
* @mbg.generated
*/
private String funcCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column terminal_point.ccll
*
* @mbg.generated
*/
private Integer ccll;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column terminal_point.id
*
* @return the value of terminal_point.id
*
* @mbg.generated
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column terminal_point.id
*
* @param id the value for terminal_point.id
*
* @mbg.generated
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column terminal_point.term_id
*
* @return the value of terminal_point.term_id
*
* @mbg.generated
*/
public Integer getTermId() {
return termId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column terminal_point.term_id
*
* @param termId the value for terminal_point.term_id
*
* @mbg.generated
*/
public void setTermId(Integer termId) {
this.termId = termId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column terminal_point.point
*
* @return the value of terminal_point.point
*
* @mbg.generated
*/
public String getPoint() {
return point;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column terminal_point.point
*
* @param point the value for terminal_point.point
*
* @mbg.generated
*/
public void setPoint(String point) {
this.point = point;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column terminal_point.func_code
*
* @return the value of terminal_point.func_code
*
* @mbg.generated
*/
public String getFuncCode() {
return funcCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column terminal_point.func_code
*
* @param funcCode the value for terminal_point.func_code
*
* @mbg.generated
*/
public void setFuncCode(String funcCode) {
this.funcCode = funcCode;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column terminal_point.ccll
*
* @return the value of terminal_point.ccll
*
* @mbg.generated
*/
public Integer getCcll() {
return ccll;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column terminal_point.ccll
*
* @param ccll the value for terminal_point.ccll
*
* @mbg.generated
*/
public void setCcll(Integer ccll) {
this.ccll = ccll;
}
private String cmdid;
public String getCmdid() {
return cmdid;
}
public void setCmdid(String cmdid) {
this.cmdid = cmdid;
}
}

@ -0,0 +1,621 @@
package com.shxy.xymanager_common.entity;
import java.util.ArrayList;
import java.util.List;
public class TerminalPointExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table terminal_point
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table terminal_point
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table terminal_point
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public TerminalPointExample() {
oredCriteria = new ArrayList<>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table terminal_point
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTermIdIsNull() {
addCriterion("term_id is null");
return (Criteria) this;
}
public Criteria andTermIdIsNotNull() {
addCriterion("term_id is not null");
return (Criteria) this;
}
public Criteria andTermIdEqualTo(Integer value) {
addCriterion("term_id =", value, "termId");
return (Criteria) this;
}
public Criteria andTermIdNotEqualTo(Integer value) {
addCriterion("term_id <>", value, "termId");
return (Criteria) this;
}
public Criteria andTermIdGreaterThan(Integer value) {
addCriterion("term_id >", value, "termId");
return (Criteria) this;
}
public Criteria andTermIdGreaterThanOrEqualTo(Integer value) {
addCriterion("term_id >=", value, "termId");
return (Criteria) this;
}
public Criteria andTermIdLessThan(Integer value) {
addCriterion("term_id <", value, "termId");
return (Criteria) this;
}
public Criteria andTermIdLessThanOrEqualTo(Integer value) {
addCriterion("term_id <=", value, "termId");
return (Criteria) this;
}
public Criteria andTermIdIn(List<Integer> values) {
addCriterion("term_id in", values, "termId");
return (Criteria) this;
}
public Criteria andTermIdNotIn(List<Integer> values) {
addCriterion("term_id not in", values, "termId");
return (Criteria) this;
}
public Criteria andTermIdBetween(Integer value1, Integer value2) {
addCriterion("term_id between", value1, value2, "termId");
return (Criteria) this;
}
public Criteria andTermIdNotBetween(Integer value1, Integer value2) {
addCriterion("term_id not between", value1, value2, "termId");
return (Criteria) this;
}
public Criteria andPointIsNull() {
addCriterion("point is null");
return (Criteria) this;
}
public Criteria andPointIsNotNull() {
addCriterion("point is not null");
return (Criteria) this;
}
public Criteria andPointEqualTo(String value) {
addCriterion("point =", value, "point");
return (Criteria) this;
}
public Criteria andPointNotEqualTo(String value) {
addCriterion("point <>", value, "point");
return (Criteria) this;
}
public Criteria andPointGreaterThan(String value) {
addCriterion("point >", value, "point");
return (Criteria) this;
}
public Criteria andPointGreaterThanOrEqualTo(String value) {
addCriterion("point >=", value, "point");
return (Criteria) this;
}
public Criteria andPointLessThan(String value) {
addCriterion("point <", value, "point");
return (Criteria) this;
}
public Criteria andPointLessThanOrEqualTo(String value) {
addCriterion("point <=", value, "point");
return (Criteria) this;
}
public Criteria andPointLike(String value) {
addCriterion("point like", value, "point");
return (Criteria) this;
}
public Criteria andPointNotLike(String value) {
addCriterion("point not like", value, "point");
return (Criteria) this;
}
public Criteria andPointIn(List<String> values) {
addCriterion("point in", values, "point");
return (Criteria) this;
}
public Criteria andPointNotIn(List<String> values) {
addCriterion("point not in", values, "point");
return (Criteria) this;
}
public Criteria andPointBetween(String value1, String value2) {
addCriterion("point between", value1, value2, "point");
return (Criteria) this;
}
public Criteria andPointNotBetween(String value1, String value2) {
addCriterion("point not between", value1, value2, "point");
return (Criteria) this;
}
public Criteria andFuncCodeIsNull() {
addCriterion("func_code is null");
return (Criteria) this;
}
public Criteria andFuncCodeIsNotNull() {
addCriterion("func_code is not null");
return (Criteria) this;
}
public Criteria andFuncCodeEqualTo(String value) {
addCriterion("func_code =", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeNotEqualTo(String value) {
addCriterion("func_code <>", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeGreaterThan(String value) {
addCriterion("func_code >", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeGreaterThanOrEqualTo(String value) {
addCriterion("func_code >=", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeLessThan(String value) {
addCriterion("func_code <", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeLessThanOrEqualTo(String value) {
addCriterion("func_code <=", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeLike(String value) {
addCriterion("func_code like", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeNotLike(String value) {
addCriterion("func_code not like", value, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeIn(List<String> values) {
addCriterion("func_code in", values, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeNotIn(List<String> values) {
addCriterion("func_code not in", values, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeBetween(String value1, String value2) {
addCriterion("func_code between", value1, value2, "funcCode");
return (Criteria) this;
}
public Criteria andFuncCodeNotBetween(String value1, String value2) {
addCriterion("func_code not between", value1, value2, "funcCode");
return (Criteria) this;
}
public Criteria andCcllIsNull() {
addCriterion("ccll is null");
return (Criteria) this;
}
public Criteria andCcllIsNotNull() {
addCriterion("ccll is not null");
return (Criteria) this;
}
public Criteria andCcllEqualTo(Integer value) {
addCriterion("ccll =", value, "ccll");
return (Criteria) this;
}
public Criteria andCcllNotEqualTo(Integer value) {
addCriterion("ccll <>", value, "ccll");
return (Criteria) this;
}
public Criteria andCcllGreaterThan(Integer value) {
addCriterion("ccll >", value, "ccll");
return (Criteria) this;
}
public Criteria andCcllGreaterThanOrEqualTo(Integer value) {
addCriterion("ccll >=", value, "ccll");
return (Criteria) this;
}
public Criteria andCcllLessThan(Integer value) {
addCriterion("ccll <", value, "ccll");
return (Criteria) this;
}
public Criteria andCcllLessThanOrEqualTo(Integer value) {
addCriterion("ccll <=", value, "ccll");
return (Criteria) this;
}
public Criteria andCcllIn(List<Integer> values) {
addCriterion("ccll in", values, "ccll");
return (Criteria) this;
}
public Criteria andCcllNotIn(List<Integer> values) {
addCriterion("ccll not in", values, "ccll");
return (Criteria) this;
}
public Criteria andCcllBetween(Integer value1, Integer value2) {
addCriterion("ccll between", value1, value2, "ccll");
return (Criteria) this;
}
public Criteria andCcllNotBetween(Integer value1, Integer value2) {
addCriterion("ccll not between", value1, value2, "ccll");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table terminal_point
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table terminal_point
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,97 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalPoint;
import com.shxy.xymanager_common.entity.TerminalPointExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TerminalPointMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
long countByExample(TerminalPointExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int deleteByExample(TerminalPointExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int insert(TerminalPoint row);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int insertSelective(TerminalPoint row);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
List<TerminalPoint> selectByExample(TerminalPointExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
TerminalPoint selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("row") TerminalPoint row, @Param("example") TerminalPointExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int updateByExample(@Param("row") TerminalPoint row, @Param("example") TerminalPointExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(TerminalPoint row);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table terminal_point
*
* @mbg.generated
*/
int updateByPrimaryKey(TerminalPoint row);
}

@ -0,0 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalPointMapper">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalPoint">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="term_id" jdbcType="INTEGER" property="termId" />
<result column="point" jdbcType="VARCHAR" property="point" />
<result column="func_code" jdbcType="VARCHAR" property="funcCode" />
<result column="ccll" jdbcType="INTEGER" property="ccll" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<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">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<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">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, term_id, point, func_code, ccll
</sql>
<select id="selectByExample" parameterType="com.shxy.xymanager_common.entity.TerminalPointExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from terminal_point
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from terminal_point
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from terminal_point
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.shxy.xymanager_common.entity.TerminalPointExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from terminal_point
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalPoint">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into terminal_point (term_id, point, func_code,
ccll)
values (#{termId,jdbcType=INTEGER}, #{point,jdbcType=VARCHAR}, #{funcCode,jdbcType=VARCHAR},
#{ccll,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalPoint">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into terminal_point
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="termId != null">
term_id,
</if>
<if test="point != null">
point,
</if>
<if test="funcCode != null">
func_code,
</if>
<if test="ccll != null">
ccll,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="point != null">
#{point,jdbcType=VARCHAR},
</if>
<if test="funcCode != null">
#{funcCode,jdbcType=VARCHAR},
</if>
<if test="ccll != null">
#{ccll,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.shxy.xymanager_common.entity.TerminalPointExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from terminal_point
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update terminal_point
<set>
<if test="row.id != null">
id = #{row.id,jdbcType=INTEGER},
</if>
<if test="row.termId != null">
term_id = #{row.termId,jdbcType=INTEGER},
</if>
<if test="row.point != null">
point = #{row.point,jdbcType=VARCHAR},
</if>
<if test="row.funcCode != null">
func_code = #{row.funcCode,jdbcType=VARCHAR},
</if>
<if test="row.ccll != null">
ccll = #{row.ccll,jdbcType=INTEGER},
</if>
</set>
<if test="example != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update terminal_point
set id = #{row.id,jdbcType=INTEGER},
term_id = #{row.termId,jdbcType=INTEGER},
point = #{row.point,jdbcType=VARCHAR},
func_code = #{row.funcCode,jdbcType=VARCHAR},
ccll = #{row.ccll,jdbcType=INTEGER}
<if test="example != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalPoint">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update terminal_point
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="point != null">
point = #{point,jdbcType=VARCHAR},
</if>
<if test="funcCode != null">
func_code = #{funcCode,jdbcType=VARCHAR},
</if>
<if test="ccll != null">
ccll = #{ccll,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalPoint">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update terminal_point
set term_id = #{termId,jdbcType=INTEGER},
point = #{point,jdbcType=VARCHAR},
func_code = #{funcCode,jdbcType=VARCHAR},
ccll = #{ccll,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -0,0 +1,97 @@
package com.shxy.xymanager_service.impl;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_dao.dao.TerminalPointMapper;
import com.shxy.xymanager_service.service.HenanService;
import com.shxy.xymanager_service.service.LeadPullsService;
import com.shxy.xymanager_service.service.NewCacheService;
import com.shxy.xymanager_service.service.WeatherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@Service
@Slf4j
public class HenanServiceImpl implements HenanService {
@Resource
LeadPullsService leadPullsService;
@Resource
WeatherService weatherService;
@Resource
TerminalPointMapper terminalPointMapper;
@Resource
NewCacheService newCacheService;
@Override
public List<Weathers> queryMicromes(Date start, Date end) {
return null;
}
@Override
public List<LeadPulls> queryPullIces(Date start, Date end) {
List<TerminalPoint> pointList = this.getPointList();
List<Integer> idList = new ArrayList<>();
for (TerminalPoint point : pointList) {
if (!idList.contains(point.getTermId())) {
idList.add(point.getTermId());
}
}
List<LeadPulls> result = new ArrayList<>();
HashMap<String, LeadPulls> map = new HashMap<>();
PageInfo<LeadPulls> page = leadPullsService.list(null, null, idList,
start.getTime() / 1000, end.getTime() / 1000, 1, 10000);
for (LeadPulls item : page.getList()) {
String key = this.getKey(pointList, item);
if (key != null) {
if (map.containsKey(key)) {
LeadPulls old = map.get(key);
old.setMaxpullPull(old.getMaxpullPull() + item.getMaxpullPull());
old.setMaxpullWind(old.getMaxpullWind() + item.getMaxpullWind());
old.setMaxpullTilt(old.getMaxpullTilt() + item.getMaxpullTilt());
} else {
map.put(key, item);
result.add(item);
}
}
}
return result;
}
private List<TerminalPoint> getPointList() {
TerminalPointExample example = new TerminalPointExample();
TerminalPointExample.Criteria criteria = example.createCriteria();
example.setOrderByClause("term_id asc, point asc");
List<TerminalPoint> list = terminalPointMapper.selectByExample(example);
for (TerminalPoint point : list) {
Terminals term = newCacheService.getTerminal(point.getTermId());
if (term != null) {
point.setCmdid(term.getCmdid());
}
}
return list;
}
private String getKey(List<TerminalPoint> pointList, LeadPulls item) {
for (TerminalPoint point : pointList) {
if (item.getTermId().equals(point.getTermId()) &&
point.getFuncCode().contains(String.valueOf(item.getFuncCode()))) {
String key = item.getUpdateTime() + "-" + item.getTermId() + "-" + point.getPoint();
item.setPhase(point.getPoint());
item.setCmdid(point.getCmdid());
return key;
}
}
return null;
}
}

@ -0,0 +1,15 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.entity.LeadPulls;
import com.shxy.xymanager_common.entity.Weathers;
import java.util.Date;
import java.util.List;
public interface HenanService {
List<Weathers> queryMicromes(Date start, Date end);
List<LeadPulls> queryPullIces(Date start, Date end);
}
Loading…
Cancel
Save