Commit c432f24a authored by 王夏晖's avatar 王夏晖

Merge branch 'develop' of http://103.249.252.28:90/wangxiahui/zhny into develop

parents 797971fe eabc0f97
...@@ -47,7 +47,7 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> { ...@@ -47,7 +47,7 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> {
* @param date the date * @param date the date
* @return the list * @return the list
*/ */
@Select("SELECT ds.*,d.DEV_NM,tp.DEV_TP_NM FROM bus_dev_service ds INNER JOIN bus_device d on d.DEV_NUM = ds.DEV_NUM INNER JOIN bus_device_tp tp ON tp.DEV_TP_ID=d.DEV_TP_ID WHERE DATE_FORMAT(SER_TM,'%Y-%m-%d') = #{date}") @Select("SELECT ds.*,d.DEV_NM,tp.DEV_TP_NM FROM bus_dev_service ds INNER JOIN bus_device d on d.DEV_ID = ds.DEV_ID INNER JOIN bus_device_tp tp ON tp.DEV_TP_ID=d.DEV_TP_ID WHERE DATE_FORMAT(SER_TM,'%Y-%m-%d') = #{date}")
List<Map<String,Object>> listBusDevServiceByDate(@Param("date") String date); List<Map<String,Object>> listBusDevServiceByDate(@Param("date") String date);
/** /**
...@@ -57,7 +57,7 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> { ...@@ -57,7 +57,7 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> {
* @param year the year * @param year the year
* @return the list * @return the list
*/ */
@Select("SELECT ds.*,d.DEV_NM,tp.DEV_TP_NM FROM bus_dev_service ds INNER JOIN bus_device d on d.DEV_NUM = ds.DEV_NUM INNER JOIN bus_device_tp tp ON tp.DEV_TP_ID=d.DEV_TP_ID WHERE DATE_FORMAT(SER_TM,'%Y') = #{year}") @Select("SELECT ds.*,d.DEV_NM,tp.DEV_TP_NM FROM bus_dev_service ds INNER JOIN bus_device d on d.DEV_ID = ds.DEV_ID INNER JOIN bus_device_tp tp ON tp.DEV_TP_ID=d.DEV_TP_ID WHERE DATE_FORMAT(SER_TM,'%Y') = #{year}")
List<Map<String,Object>> listBusDevServiceByYear(@Param("year") String year); List<Map<String,Object>> listBusDevServiceByYear(@Param("year") String year);
/** /**
......
package org.rcisoft.business.mainte.adaptive.controller;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.mainte.adaptive.service.AdaptiveService;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by JiChao on 2018/4/28.
* 运维--自适应模块
*/
@RestController
@RequestMapping("adaptive")
public class AdaptiveController {
@Autowired
private AdaptiveService adaptiveServiceImpl;
@ApiOperation(value="气候自适应", notes="从0点开始到23点,一共24个数")
@ApiImplicitParams({@ApiImplicitParam(name = "proId", value = "项目主键", required = true, dataType = "字符串"),
@ApiImplicitParam(name = "year", value = "年", required = true, dataType = "字符串或数字"),
@ApiImplicitParam(name = "month", value = "月", required = true, dataType = "字符串或数字"),
@ApiImplicitParam(name = "day", value = "日", required = true, dataType = "字符串或数字")
})
@RequestMapping("/climateAdaptation")
public Result climateAdaptation(@RequestParam String proId, @RequestParam String year, @RequestParam String month, @RequestParam String day) {
return Result.builder(new PersistModel(1), MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_ERROR, adaptiveServiceImpl.climateAdaptation(proId, year, month, day));
}
@ApiOperation(value="建筑负荷自适应", notes="从0点开始到23点,一共24个数")
@ApiImplicitParams({@ApiImplicitParam(name = "proId", value = "项目主键", required = true, dataType = "字符串"),
@ApiImplicitParam(name = "year", value = "年", required = true, dataType = "字符串或数字"),
@ApiImplicitParam(name = "month", value = "月", required = true, dataType = "字符串或数字"),
@ApiImplicitParam(name = "day", value = "日", required = true, dataType = "字符串或数字")
})
@RequestMapping("/buildingAdaptation")
public Result buildingAdaptation(@RequestParam String proId, @RequestParam String year, @RequestParam String month, @RequestParam String day) {
return Result.builder(new PersistModel(1), MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_ERROR, adaptiveServiceImpl.buildingAdaptation(proId, year, month, day));
}
}
package org.rcisoft.business.mainte.adaptive.dao;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.mainte.adaptive.entity.BusParamRefer;
import org.rcisoft.business.mainte.adaptive.entity.TotalSensor;
import org.rcisoft.business.mainte.adaptive.vo.Params;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by JiChao on 2018/4/28.
*/
@Repository
public interface BusParamReferRepository {
/**
* 查询网关参数
* @param params proId:项目id,ownParam:项目固定参数
* @return
*/
@Select("<script>select r.OTHER_PARAM from bus_param_refer r " +
"where r.PRO_ID=#{proId} and r.OWN_PARAM=#{ownParam}</script>")
@ResultMap(value = "BusParamRefer")
BusParamRefer queryOtherParam(Params params);
}
package org.rcisoft.business.mainte.adaptive.dao;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.mainte.adaptive.entity.BusTemperature;
import org.rcisoft.business.mainte.adaptive.entity.TotalSensor;
import org.rcisoft.business.mainte.adaptive.vo.Params;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by JiChao on 2018/4/28.
*/
@Repository
public interface BusTemperatureRepository {
/**
* 根据时间、code查询实际温度
* @param params
* @return
*/
@Select("<script>select t.TM,t.TEMPERATURE from bus_temperature t " +
"where t.CODE=#{code} and date_format(t.TM, '%Y-%c-%e')=#{time}</script>")
@ResultMap(value = "BaseResultMap")
List<BusTemperature> queryBusTemperatureList(Params params);
}
package org.rcisoft.business.mainte.adaptive.dao;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.mainte.adaptive.entity.TotalSensor;
import org.rcisoft.business.mainte.adaptive.vo.Params;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by JiChao on 2018/4/28.
*/
@Repository("TotalSensorRepository2")
public interface TotalSensorRepository {
/**
* 根据项目id、时间(年月日)查询
* @param params
* @return
*/
@Select("<script>select t.TM,t.SENSOR_JSON from total_sensor t " +
"where t.PRO_ID=#{proId} and date_format(t.TM, '%Y-%c-%e')=#{time}</script>")
@ResultMap(value = "TotalSensor")
List<TotalSensor> queryTotalSensorList(Params params);
}
package org.rcisoft.business.mainte.adaptive.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* Created by JiChao on 2018/4/28.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "bus_param_refer")
public class BusParamRefer implements Serializable {
@Id
private String id;
private String ownParam;
private String devNum;
private String otherParam;
private String devType;
private String proId;
private String ownParamNm;
}
package org.rcisoft.business.mainte.adaptive.entity;
import lombok.*;
import org.rcisoft.core.entity.IdNotDataEntity;
import javax.persistence.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* Created with on 2018-4-28 20:49:47.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "bus_temperature")
public class BusTemperature implements Serializable {
@Id
private Integer id;
private Date tm;
private BigDecimal temperature;
private String code;
}
package org.rcisoft.business.mainte.adaptive.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* Created by JiChao on 2018/4/28.
* 传感器表
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "total_sensor")
public class TotalSensor implements Serializable {
@Id
private String id;
private Date tm;
private String sensorJson;
private String proId;
}
package org.rcisoft.business.mainte.adaptive.proenum;
/**
* Created by JiChao on 2018/4/28.
*/
public enum ProEnum {
gswd, //供水温度
hswd, //回水温度
sll; //水流量
}
package org.rcisoft.business.mainte.adaptive.service;
import org.rcisoft.business.mainte.adaptive.vo.BuildingAdaptation;
import org.rcisoft.business.mainte.adaptive.vo.ClimateAdaptation;
/**
* Created by JiChao on 2018/4/28.
*/
public interface AdaptiveService {
/**
* 气候自适应
* @param proId
* @param year
* @param month
* @param day
* @return
*/
ClimateAdaptation climateAdaptation(String proId, String year, String month, String day);
/**
* 建筑负荷自适应
* @param proId
* @param year
* @param month
* @param day
* @return
*/
BuildingAdaptation buildingAdaptation(String proId, String year, String month, String day);
}
package org.rcisoft.business.mainte.adaptive.service.impl;
import com.alibaba.fastjson.JSONObject;
import org.rcisoft.business.mainte.adaptive.dao.BusParamReferRepository;
import org.rcisoft.business.mainte.adaptive.dao.BusTemperatureRepository;
import org.rcisoft.business.mainte.adaptive.dao.TotalSensorRepository;
import org.rcisoft.business.mainte.adaptive.entity.BusParamRefer;
import org.rcisoft.business.mainte.adaptive.entity.BusTemperature;
import org.rcisoft.business.mainte.adaptive.entity.TotalSensor;
import org.rcisoft.business.mainte.adaptive.proenum.ProEnum;
import org.rcisoft.business.mainte.adaptive.service.AdaptiveService;
import org.rcisoft.business.mainte.adaptive.vo.BuildingAdaptation;
import org.rcisoft.business.mainte.adaptive.vo.ClimateAdaptation;
import org.rcisoft.business.mainte.adaptive.vo.Params;
import org.rcisoft.business.overview.dao.BusProjectRepository;
import org.rcisoft.business.overview.entity.BusProject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
/**
* Created by JiChao on 2018/4/28.
*/
@Service
public class AdaptiveServiceImpl implements AdaptiveService {
@Autowired
private TotalSensorRepository totalSensorRepository;
@Autowired
private BusParamReferRepository busParamReferRepository;
@Autowired
private BusProjectRepository busProjectRepository;
@Autowired
private BusTemperatureRepository busTemperatureRepository;
/**
* 根据项目id得到项目的城市code
* @param proId
* @return
*/
private String getCode(String proId) {
BusProject b = new BusProject();
b.setProId(proId);
BusProject busProject = busProjectRepository.selectOne(b);
return busProject.getCode();
}
@Override
public ClimateAdaptation climateAdaptation(String proId, String year, String month, String day) {
Calendar cal = Calendar.getInstance();
//查询实际供水温度
Params params = new Params(proId, year + "-" + month + "-" + day, ProEnum.gswd.toString(), null);
//1.从sensor表查询对应日期的所有记录
List<TotalSensor> totalSensorList = totalSensorRepository.queryTotalSensorList(params);
//2.从bus_param_refer表查询“实际供水温度”对应的code
BusParamRefer busParamRefer = busParamReferRepository.queryOtherParam(params);
String otherParam = busParamRefer.getOtherParam();
//3.取出数据中的整点记录,根据温度的code将数据取出,放入结果中
List<Object> realList = Arrays.asList(new Object[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
//循环
totalSensorList.forEach(totalSensor -> {
cal.setTime(totalSensor.getTm());
//整点数据
if (cal.get(Calendar.MINUTE) == 0) {
//得到小时
int hour = cal.get(Calendar.HOUR_OF_DAY);
//得到json对象
JSONObject json = JSONObject.parseObject(totalSensor.getSensorJson());
//得到供水温度
Object gswd = json.get(otherParam);
realList.set(hour, gswd);
}
});
//查询最优供水温度
//1.根据proId查询项目的城市code
String code = this.getCode(proId);
//2.根据城市code查询对应日期的室外温度
params.setCode(code);
List<BusTemperature> busTemperaturesList = busTemperatureRepository.queryBusTemperatureList(params);
//3.根据公式算出最优供水温度,不需要计算的数值取原来的数据
List<Object> optimumList = Arrays.asList(new Object[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
busTemperaturesList.forEach(busTemperature -> {
cal.setTime(busTemperature.getTm());
int hour = cal.get(Calendar.HOUR_OF_DAY);
//得到时间
BigDecimal temperature = busTemperature.getTemperature();
//计算公式
BigDecimal optimum = new BigDecimal(0);
if (temperature.compareTo(new BigDecimal(35)) > 0) {//大于35度
optimum = new BigDecimal(0.4).multiply(temperature).subtract(new BigDecimal(6));
} else if (temperature.compareTo(new BigDecimal(26)) > 0 && temperature.compareTo(new BigDecimal(35)) < 1) {//大于26度,小于等于35度
optimum = new BigDecimal(94).subtract(new BigDecimal(2).multiply(temperature)).divide(new BigDecimal(3));
} else if (temperature.compareTo(new BigDecimal(0)) < 1) {//小于0度
optimum = new BigDecimal(0).subtract(temperature).add(new BigDecimal(40));
} else {//大于0度,小于等于26度
optimum = temperature;
}
//放入结果集
optimumList.set(hour, optimum);
});
//最后返回结果
return new ClimateAdaptation(realList, optimumList);
}
@Override
public BuildingAdaptation buildingAdaptation(String proId, String year, String month, String day) {
Calendar cal = Calendar.getInstance();
Params params = new Params(proId, year + "-" + month + "-" + day, null, this.getCode(proId));
//查询室外温度
List<BusTemperature> busTemperaturesList = busTemperatureRepository.queryBusTemperatureList(params);
List<Object> temperatureList = Arrays.asList(new Object[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
busTemperaturesList.forEach(busTemperature -> {
cal.setTime(busTemperature.getTm());
int hour = cal.get(Calendar.HOUR_OF_DAY);
BigDecimal temperature = busTemperature.getTemperature();
temperatureList.set(hour, temperature);
});
//查询建筑负荷:供水温度,回水温度,水流量
params.setOwnParam(ProEnum.gswd.toString());
BusParamRefer busParamRefer = busParamReferRepository.queryOtherParam(params);
//供水温度
String gswd_code = busParamRefer == null ? "" : busParamRefer.getOtherParam();
//回水温度
params.setOwnParam(ProEnum.hswd.toString());
busParamRefer = busParamReferRepository.queryOtherParam(params);
String hswd_code = busParamRefer == null ? "" : busParamRefer.getOtherParam();
//水流量
params.setOwnParam(ProEnum.sll.toString());
busParamRefer = busParamReferRepository.queryOtherParam(params);
String sll_code = busParamRefer == null ? "" : busParamRefer.getOtherParam();
//从sensor表查询对应日期的所有记录
List<TotalSensor> totalSensorList = totalSensorRepository.queryTotalSensorList(params);
List<Object> buildingList = Arrays.asList(new Object[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
totalSensorList.forEach(totalSensor -> {
cal.setTime(totalSensor.getTm());
//整点数据
if (cal.get(Calendar.MINUTE) == 0) {
//得到小时
int hour = cal.get(Calendar.HOUR_OF_DAY);
//得到json对象
JSONObject json = JSONObject.parseObject(totalSensor.getSensorJson());
//供水温度
BigDecimal gswd = (BigDecimal) json.get(gswd_code);
//回水温度
BigDecimal hswd = (BigDecimal) json.get(hswd_code);
//水流量
BigDecimal sll = (BigDecimal) json.get(sll_code);
//公式计算
Float building = Math.abs(gswd.subtract(hswd).multiply(sll).multiply(new BigDecimal(4.12)).divide(new BigDecimal(3.6), 1, BigDecimal.ROUND_HALF_UP).floatValue());
buildingList.set(hour, building);
}
});
return new BuildingAdaptation(buildingList, temperatureList);
}
}
package org.rcisoft.business.mainte.adaptive.task;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* Created by JiChao on 2018/4/28.
*/
@Component
public class AdaptiveTask {
/**
* 每天0点5分执行,查询所有项目中存在的城市,未来24小时的温度
*/
@Scheduled(cron = "0 5 0 * * ?")
public void temperature () {
}
}
package org.rcisoft.business.mainte.adaptive.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* Created by JiChao on 2018/5/2.
* 建筑负荷自适应
* 返回值
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class BuildingAdaptation {
private List<Object> building;
private List<Object> temperature;
}
package org.rcisoft.business.mainte.adaptive.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* Created by JiChao on 2018/4/28.
* 气候自适应
* 返回值
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ClimateAdaptation {
//实际
private List<Object> real;
//最优
private List<Object> optimum;
}
package org.rcisoft.business.mainte.adaptive.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Created by JiChao on 2018/4/28.
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Params {
private String proId;
private String time;
private String ownParam;
private String code;
}
...@@ -20,7 +20,7 @@ public class EnergyDistributed implements Serializable { ...@@ -20,7 +20,7 @@ public class EnergyDistributed implements Serializable {
private String proNm; private String proNm;
private String bldCoordinate; private String bldCoordinate;
private Float bldArea; private BigDecimal bldArea;
private BigDecimal waterMoney; private BigDecimal waterMoney;
private BigDecimal elecMoney; private BigDecimal elecMoney;
private BigDecimal gasMoney; private BigDecimal gasMoney;
......
...@@ -42,7 +42,8 @@ public class MainteDistributedServiceImpl implements MainteDistributedService { ...@@ -42,7 +42,8 @@ public class MainteDistributedServiceImpl implements MainteDistributedService {
.add(energyDistributed.getWaterMoney()) .add(energyDistributed.getWaterMoney())
.add(energyDistributed.getElecMoney()) .add(energyDistributed.getElecMoney())
.add(energyDistributed.getGasMoney()) .add(energyDistributed.getGasMoney())
.divide(new BigDecimal(energyDistributed.getBldArea()), 2, RoundingMode.HALF_UP) .divide(energyDistributed.getBldArea())
.setScale(1)
); );
vo.setValue(value); vo.setValue(value);
//放入结果集 //放入结果集
......
...@@ -48,18 +48,29 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -48,18 +48,29 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
List<EnergyCountMVo> countDailyPrice(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> countDailyPrice(EnergyCountMVo energyCountMVo);
/** /**
* 耗能拆分统计 * 耗能拆分统计 水统计
* @param energyCountMVo * @param energyCountMVo
* @return * @return
*/ */
@Select("<script>select e.DEV_NUM," + @Select("<script>select if(sum(e.WATER) is null, 0, sum(e.WATER)) ENERGY from energy_count_m e " +
"<if test=\"type == 1\">sum(e.WATER)</if>" + "where e.`DAY`=#{day} and e.MON=#{mon} and e.`YEAR`=#{year} and e.PRO_ID=#{proId}</script>")
"<if test=\"type == 2\">sum(e.ELEC)</if>" + @ResultMap("resultMapVo")
"<if test=\"type == 3\">sum(e.GAS)</if>" + List<EnergyCountMVo> countEnergySplitWater(EnergyCountMVo energyCountMVo);
" as ENERGY from ENERGY_COUNT_M e" +
" where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon} and e.`DAY`=#{day} group by e.DEV_NUM</script>") /**
* 耗能拆分统计 电、气统计
* @param energyCountMVo
* @return
*/
@Select("<script>select d.DEV_NM `NAME`," +
"<if test=\"type == 2\">sum(e.ELEC) ENERGY </if>" +
"<if test=\"type == 3\">sum(e.GAS) ENERGY </if>" +
"from bus_device d,bus_device_meter dm,energy_count_m e " +
"where d.DEV_NUM=dm.DEV_NUM and dm.MET_NUM=e.MET_NUM and " +
"e.`DAY`=#{day} and e.MON=#{mon} and e.`YEAR`=#{year} and e.PRO_ID=#{proId} " +
"group by d.DEV_NM</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> countEnergySplit(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> countEnergySplitElecGas(EnergyCountMVo energyCountMVo);
/** /**
* 运行费用排名 * 运行费用排名
......
...@@ -28,7 +28,7 @@ public class BusProject implements Serializable { ...@@ -28,7 +28,7 @@ public class BusProject implements Serializable {
private String bldTpId; private String bldTpId;
private Float bldArea; private BigDecimal bldArea;
private String bldLocal; private String bldLocal;
...@@ -38,6 +38,24 @@ public class BusProject implements Serializable { ...@@ -38,6 +38,24 @@ public class BusProject implements Serializable {
private String teamId; private String teamId;
private String jwnum;
private String province;
private String city;
private String code;
private Date createTime;
private String bldZoneId;
private Date bldYear;
private Date deviceYear;
private BigDecimal energyPotential;
} }
...@@ -20,14 +20,14 @@ import java.util.List; ...@@ -20,14 +20,14 @@ import java.util.List;
@Table(name = "bus_project_area_stat") @Table(name = "bus_project_area_stat")
public class BusProjectAreaStat implements Serializable { public class BusProjectAreaStat implements Serializable {
public BusProjectAreaStat(String year, Float water, Float elec, Float gas) { public BusProjectAreaStat(String year, BigDecimal water, BigDecimal elec, BigDecimal gas) {
this.year = year; this.year = year;
this.water = water; this.water = water;
this.elec = elec; this.elec = elec;
this.gas = gas; this.gas = gas;
} }
public BusProjectAreaStat(String proId, String year, Float water, Float elec, Float gas) { public BusProjectAreaStat(String proId, String year, BigDecimal water, BigDecimal elec, BigDecimal gas) {
this.proId = proId; this.proId = proId;
this.year = year; this.year = year;
this.water = water; this.water = water;
...@@ -42,11 +42,11 @@ public class BusProjectAreaStat implements Serializable { ...@@ -42,11 +42,11 @@ public class BusProjectAreaStat implements Serializable {
private String year; private String year;
private Float water; private BigDecimal water;
private Float elec; private BigDecimal elec;
private Float gas; private BigDecimal gas;
} }
......
...@@ -42,15 +42,15 @@ public class EnergyCountM implements Serializable { ...@@ -42,15 +42,15 @@ public class EnergyCountM implements Serializable {
@Id @Id
private Integer id; private Integer id;
private String devNum; private String metNum;
private String proId; private String proId;
private Float water; private BigDecimal water;
private Float elec; private BigDecimal elec;
private Float gas; private BigDecimal gas;
private String hour; private String hour;
......
...@@ -30,7 +30,7 @@ public class EnergyEmissionPlan implements Serializable { ...@@ -30,7 +30,7 @@ public class EnergyEmissionPlan implements Serializable {
private Integer day; private Integer day;
private Float emission; private BigDecimal emission;
} }
......
...@@ -49,7 +49,7 @@ public class EnergyEmissionReal implements Serializable { ...@@ -49,7 +49,7 @@ public class EnergyEmissionReal implements Serializable {
private Integer day; private Integer day;
private Float emission; private BigDecimal emission;
} }
......
...@@ -30,7 +30,7 @@ public class EnergyEmissionTotal implements Serializable { ...@@ -30,7 +30,7 @@ public class EnergyEmissionTotal implements Serializable {
private String proId; private String proId;
private Float emission; private BigDecimal emission;
private Integer year; private Integer year;
......
package org.rcisoft.business.overview.service; package org.rcisoft.business.overview.service;
import org.rcisoft.business.overview.entity.EnergyEmissionReal;
import org.rcisoft.business.overview.entity.EnergyEmissionTotal; import org.rcisoft.business.overview.entity.EnergyEmissionTotal;
import org.rcisoft.business.overview.vo.EnergyCountMVo; import org.rcisoft.business.overview.vo.EnergyCountMVo;
import org.rcisoft.business.overview.vo.EnergyPriceVo; import org.rcisoft.business.overview.vo.EnergyPriceVo;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -90,7 +90,7 @@ public interface OverViewService { ...@@ -90,7 +90,7 @@ public interface OverViewService {
* @param proId * @param proId
* @return * @return
*/ */
Map<String, Object> getEmission(String proId); Map<String, BigDecimal> getEmission(String proId);
/** /**
* 查询累计减排 * 查询累计减排
...@@ -105,7 +105,7 @@ public interface OverViewService { ...@@ -105,7 +105,7 @@ public interface OverViewService {
* @param year * @param year
* @return * @return
*/ */
List<Float> statEmissionMonth(String proId, int year); List<BigDecimal> statEmissionMonth(String proId, int year);
/** /**
* 日 碳排放 * 日 碳排放
...@@ -114,7 +114,7 @@ public interface OverViewService { ...@@ -114,7 +114,7 @@ public interface OverViewService {
* @param month * @param month
* @return * @return
*/ */
List<Float> statEmissionDay(String proId, int year, int month); List<BigDecimal> statEmissionDay(String proId, int year, int month);
/** /**
* 统计昨天排放量,更新累计排放量 * 统计昨天排放量,更新累计排放量
......
...@@ -32,8 +32,15 @@ public class EnergyCountMVo extends EnergyCountM { ...@@ -32,8 +32,15 @@ public class EnergyCountMVo extends EnergyCountM {
//费用 //费用
private BigDecimal money; private BigDecimal money;
//能耗 //能耗
private Float energy; private BigDecimal energy;
//日期,今日昨日 //日期,今日昨日
private Integer date; private Integer date;
//------------能耗拆分返回值---------------
private String name;
private BigDecimal value;
private String percent;
} }
...@@ -11,6 +11,6 @@ import java.math.BigDecimal; ...@@ -11,6 +11,6 @@ import java.math.BigDecimal;
@Data @Data
public class EnergyPriceVo extends EnergyPrice { public class EnergyPriceVo extends EnergyPrice {
BigDecimal water, elec, gas; private BigDecimal water, elec, gas;
} }
<?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="org.rcisoft.business.mainte.adaptive.dao.BusParamReferRepository">
<resultMap id="BusParamRefer" type="org.rcisoft.business.mainte.adaptive.entity.BusParamRefer">
<result column="ID" jdbcType="VARCHAR" property="id"/>
<result column="OWN_PARAM" jdbcType="VARCHAR" property="ownParam"/>
<result column="DEV_NUM" jdbcType="VARCHAR" property="sensorJson"/>
<result column="OTHER_PARAM" jdbcType="VARCHAR" property="otherParam"/>
<result column="DEV_TYPE" jdbcType="VARCHAR" property="devType"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="OWN_PARAM_NM" jdbcType="VARCHAR" property="ownParamNm"/>
</resultMap>
</mapper>
\ No newline at end of file
<?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="org.rcisoft.business.mainte.adaptive.dao.BusTemperatureRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.mainte.adaptive.entity.BusTemperature">
<id column="ID" jdbcType="INTEGER" property="id"/>
<result column="TM" jdbcType="TIMESTAMP" property="tm"/>
<result column="TEMPERATURE" jdbcType="DECIMAL" property="temperature"/>
<result column="CODE" jdbcType="VARCHAR" property="code"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
<?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="org.rcisoft.business.mainte.adaptive.dao.TotalSensorRepository">
<resultMap id="TotalSensor" type="org.rcisoft.business.mainte.adaptive.entity.TotalSensor">
<result column="ID" jdbcType="INTEGER" property="id"/>
<result column="TM" jdbcType="TIMESTAMP" property="tm"/>
<result column="SENSOR_JSON" jdbcType="VARCHAR" property="sensorJson"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
</resultMap>
</mapper>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<resultMap id="EnergyDistributed" type="org.rcisoft.business.mainte.distributed.entity.EnergyDistributed"> <resultMap id="EnergyDistributed" type="org.rcisoft.business.mainte.distributed.entity.EnergyDistributed">
<result column="PRO_NM" jdbcType="VARCHAR" property="proNm"/> <result column="PRO_NM" jdbcType="VARCHAR" property="proNm"/>
<result column="BLD_COORDINATE" jdbcType="VARCHAR" property="bldCoordinate"/> <result column="BLD_COORDINATE" jdbcType="VARCHAR" property="bldCoordinate"/>
<result column="BLD_AREA" jdbcType="FLOAT" property="bldArea"/> <result column="BLD_AREA" jdbcType="DECIMAL" property="bldArea"/>
<result column="WATER_MONEY" jdbcType="DECIMAL" property="waterMoney"/> <result column="WATER_MONEY" jdbcType="DECIMAL" property="waterMoney"/>
<result column="ELEC_MONEY" jdbcType="DECIMAL" property="elecMoney"/> <result column="ELEC_MONEY" jdbcType="DECIMAL" property="elecMoney"/>
<result column="GAS_MONEY" jdbcType="DECIMAL" property="gasMoney"/> <result column="GAS_MONEY" jdbcType="DECIMAL" property="gasMoney"/>
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.BusProjectArea"> <resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.BusProjectArea">
<id column="ID" jdbcType="VARCHAR" property="id"/> <id column="ID" jdbcType="VARCHAR" property="id"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/> <result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<!--<result column="AREA" jdbcType="FLOAT" property="area"/>--> <!--<result column="AREA" jdbcType="DECIMAL" property="area"/>-->
<result column="TYPE" jdbcType="CHAR" property="type"/> <result column="TYPE" jdbcType="CHAR" property="type"/>
<result column="INDUSTRY_STD" jdbcType="FLOAT" property="industryStd"/> <result column="INDUSTRY_STD" jdbcType="DECIMAL" property="industryStd"/>
<result column="SUGGEST_STD" jdbcType="FLOAT" property="suggestStd"/> <result column="SUGGEST_STD" jdbcType="DECIMAL" property="suggestStd"/>
<result column="COUNTRY_STD" jdbcType="FLOAT" property="countryStd"/> <result column="COUNTRY_STD" jdbcType="DECIMAL" property="countryStd"/>
</resultMap> </resultMap>
<!--<resultMap id="vo" type="org.rcisoft.business.overview.vo.BusProjectAreaVo">--> <!--<resultMap id="vo" type="org.rcisoft.business.overview.vo.BusProjectAreaVo">-->
<!--<result column="WATER_AREA" jdbcType="FLOAT" property="waterArea"/>--> <!--<result column="WATER_AREA" jdbcType="DECIMAL" property="waterArea"/>-->
<!--<result column="ELEC_AREA" jdbcType="FLOAT" property="elecArea"/>--> <!--<result column="ELEC_AREA" jdbcType="DECIMAL" property="elecArea"/>-->
<!--<result column="GAS_AREA" jdbcType="FLOAT" property="gasArea"/>--> <!--<result column="GAS_AREA" jdbcType="DECIMAL" property="gasArea"/>-->
<!--</resultMap>--> <!--</resultMap>-->
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<id column="ID" jdbcType="INTEGER" property="id"/> <id column="ID" jdbcType="INTEGER" property="id"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/> <result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="YEAR" jdbcType="VARCHAR" property="year"/> <result column="YEAR" jdbcType="VARCHAR" property="year"/>
<result column="WATER" jdbcType="FLOAT" property="water"/> <result column="WATER" jdbcType="DECIMAL" property="water"/>
<result column="ELEC" jdbcType="FLOAT" property="elec"/> <result column="ELEC" jdbcType="DECIMAL" property="elec"/>
<result column="GAS" jdbcType="FLOAT" property="gas"/> <result column="GAS" jdbcType="DECIMAL" property="gas"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
...@@ -2,14 +2,23 @@ ...@@ -2,14 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.rcisoft.business.overview.dao.BusProjectRepository"> <mapper namespace="org.rcisoft.business.overview.dao.BusProjectRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.BusProject"> <resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.BusProject">
<id column="PRO_ID" jdbcType="VARCHAR" property="proId"/> <id column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="PRO_NM" jdbcType="VARCHAR" property="proNm"/> <result column="PRO_NM" jdbcType="VARCHAR" property="proNm"/>
<result column="BLD_TP_ID" jdbcType="VARCHAR" property="bldTpId"/> <result column="BLD_TP_ID" jdbcType="VARCHAR" property="bldTpId"/>
<result column="BLD_AREA" jdbcType="FLOAT" property="bldArea"/> <result column="BLD_AREA" jdbcType="DECIMAL" property="bldArea"/>
<result column="BLD_LOCAL" jdbcType="VARCHAR" property="bldLocal"/> <result column="BLD_LOCAL" jdbcType="VARCHAR" property="bldLocal"/>
<result column="BLD_COORDINATE" jdbcType="VARCHAR" property="bldCoordinate"/> <result column="BLD_COORDINATE" jdbcType="VARCHAR" property="bldCoordinate"/>
<result column="OWN_ID" jdbcType="VARCHAR" property="ownId"/> <result column="OWN_ID" jdbcType="VARCHAR" property="ownId"/>
<result column="TEAM_ID" jdbcType="VARCHAR" property="teamId"/> <result column="TEAM_ID" jdbcType="VARCHAR" property="teamId"/>
<result column="JWNUM" jdbcType="VARCHAR" property="jwnum"/>
<result column="PROVINCE" jdbcType="VARCHAR" property="province"/>
<result column="CITY" jdbcType="VARCHAR" property="city"/>
<result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
<result column="BLD_ZONE_ID" jdbcType="VARCHAR" property="bldZoneId"/>
<result column="BLD_YEAR" jdbcType="TIMESTAMP" property="bldYear"/>
<result column="DEVICE_YEAR" jdbcType="TIMESTAMP" property="deviceYear"/>
<result column="ENERGY_POTENTIAL" jdbcType="DECIMAL" property="energyPotential"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<mapper namespace="org.rcisoft.business.overview.dao.EnergyCountMRepository"> <mapper namespace="org.rcisoft.business.overview.dao.EnergyCountMRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.EnergyCountM"> <resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.EnergyCountM">
<id column="ID" jdbcType="INTEGER" property="id"/> <id column="ID" jdbcType="INTEGER" property="id"/>
<result column="DEV_NUM" jdbcType="VARCHAR" property="devNum"/> <result column="MET_NUM" jdbcType="VARCHAR" property="metNum"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/> <result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="WATER" jdbcType="FLOAT" property="water"/> <result column="WATER" jdbcType="DECIMAL" property="water"/>
<result column="ELEC" jdbcType="FLOAT" property="elec"/> <result column="ELEC" jdbcType="DECIMAL" property="elec"/>
<result column="GAS" jdbcType="FLOAT" property="gas"/> <result column="GAS" jdbcType="DECIMAL" property="gas"/>
<result column="HOUR" jdbcType="VARCHAR" property="hour"/> <result column="HOUR" jdbcType="VARCHAR" property="hour"/>
<result column="DAY" jdbcType="VARCHAR" property="day"/> <result column="DAY" jdbcType="VARCHAR" property="day"/>
<result column="MON" jdbcType="VARCHAR" property="mon"/> <result column="MON" jdbcType="VARCHAR" property="mon"/>
...@@ -19,10 +19,13 @@ ...@@ -19,10 +19,13 @@
</resultMap> </resultMap>
<resultMap id="resultMapVo" type="org.rcisoft.business.overview.vo.EnergyCountMVo"> <resultMap id="resultMapVo" type="org.rcisoft.business.overview.vo.EnergyCountMVo">
<result column="DEV_ID" jdbcType="VARCHAR" property="devId"/>
<result column="HOUR" jdbcType="VARCHAR" property="hour"/> <result column="HOUR" jdbcType="VARCHAR" property="hour"/>
<result column="DAY" jdbcType="VARCHAR" property="day"/>
<result column="MON" jdbcType="VARCHAR" property="mon"/>
<result column="MONEY" jdbcType="DECIMAL" property="money"/> <result column="MONEY" jdbcType="DECIMAL" property="money"/>
<result column="ENERGY" jdbcType="DECIMAL" property="energy"/> <result column="ENERGY" jdbcType="DECIMAL" property="energy"/>
<result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="VALUE" jdbcType="DECIMAL" property="value"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/> <result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="MON" jdbcType="INTEGER" property="mon"/> <result column="MON" jdbcType="INTEGER" property="mon"/>
<result column="DAY" jdbcType="INTEGER" property="day"/> <result column="DAY" jdbcType="INTEGER" property="day"/>
<result column="EMISSION" jdbcType="FLOAT" property="emission"/> <result column="EMISSION" jdbcType="DECIMAL" property="emission"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<result column="YEAR" jdbcType="INTEGER" property="year"/> <result column="YEAR" jdbcType="INTEGER" property="year"/>
<result column="MON" jdbcType="INTEGER" property="mon"/> <result column="MON" jdbcType="INTEGER" property="mon"/>
<result column="DAY" jdbcType="INTEGER" property="day"/> <result column="DAY" jdbcType="INTEGER" property="day"/>
<result column="EMISSION" jdbcType="FLOAT" property="emission"/> <result column="EMISSION" jdbcType="DECIMAL" property="emission"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.EnergyEmissionTotal"> <resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.EnergyEmissionTotal">
<id column="ID" jdbcType="INTEGER" property="id"/> <id column="ID" jdbcType="INTEGER" property="id"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/> <result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="EMISSION" jdbcType="FLOAT" property="emission"/> <result column="EMISSION" jdbcType="DECIMAL" property="emission"/>
<result column="YEAR" jdbcType="INTEGER" property="year"/> <result column="YEAR" jdbcType="INTEGER" property="year"/>
</resultMap> </resultMap>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment