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> {
* @param date the date
* @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);
/**
......@@ -57,7 +57,7 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> {
* @param year the year
* @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);
/**
......
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 {
private String proNm;
private String bldCoordinate;
private Float bldArea;
private BigDecimal bldArea;
private BigDecimal waterMoney;
private BigDecimal elecMoney;
private BigDecimal gasMoney;
......
......@@ -42,7 +42,8 @@ public class MainteDistributedServiceImpl implements MainteDistributedService {
.add(energyDistributed.getWaterMoney())
.add(energyDistributed.getElecMoney())
.add(energyDistributed.getGasMoney())
.divide(new BigDecimal(energyDistributed.getBldArea()), 2, RoundingMode.HALF_UP)
.divide(energyDistributed.getBldArea())
.setScale(1)
);
vo.setValue(value);
//放入结果集
......
......@@ -48,18 +48,29 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
List<EnergyCountMVo> countDailyPrice(EnergyCountMVo energyCountMVo);
/**
* 耗能拆分统计
* 耗能拆分统计 水统计
* @param energyCountMVo
* @return
*/
@Select("<script>select e.DEV_NUM," +
"<if test=\"type == 1\">sum(e.WATER)</if>" +
"<if test=\"type == 2\">sum(e.ELEC)</if>" +
"<if test=\"type == 3\">sum(e.GAS)</if>" +
" 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>")
@Select("<script>select if(sum(e.WATER) is null, 0, sum(e.WATER)) ENERGY from energy_count_m e " +
"where e.`DAY`=#{day} and e.MON=#{mon} and e.`YEAR`=#{year} and e.PRO_ID=#{proId}</script>")
@ResultMap("resultMapVo")
List<EnergyCountMVo> countEnergySplitWater(EnergyCountMVo energyCountMVo);
/**
* 耗能拆分统计 电、气统计
* @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")
List<EnergyCountMVo> countEnergySplit(EnergyCountMVo energyCountMVo);
List<EnergyCountMVo> countEnergySplitElecGas(EnergyCountMVo energyCountMVo);
/**
* 运行费用排名
......
......@@ -28,7 +28,7 @@ public class BusProject implements Serializable {
private String bldTpId;
private Float bldArea;
private BigDecimal bldArea;
private String bldLocal;
......@@ -38,6 +38,24 @@ public class BusProject implements Serializable {
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;
@Table(name = "bus_project_area_stat")
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.water = water;
this.elec = elec;
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.year = year;
this.water = water;
......@@ -42,11 +42,11 @@ public class BusProjectAreaStat implements Serializable {
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 {
@Id
private Integer id;
private String devNum;
private String metNum;
private String proId;
private Float water;
private BigDecimal water;
private Float elec;
private BigDecimal elec;
private Float gas;
private BigDecimal gas;
private String hour;
......
......@@ -30,7 +30,7 @@ public class EnergyEmissionPlan implements Serializable {
private Integer day;
private Float emission;
private BigDecimal emission;
}
......
......@@ -49,7 +49,7 @@ public class EnergyEmissionReal implements Serializable {
private Integer day;
private Float emission;
private BigDecimal emission;
}
......
......@@ -30,7 +30,7 @@ public class EnergyEmissionTotal implements Serializable {
private String proId;
private Float emission;
private BigDecimal emission;
private Integer year;
......
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.vo.EnergyCountMVo;
import org.rcisoft.business.overview.vo.EnergyPriceVo;
import org.rcisoft.core.model.PersistModel;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
......@@ -90,7 +90,7 @@ public interface OverViewService {
* @param proId
* @return
*/
Map<String, Object> getEmission(String proId);
Map<String, BigDecimal> getEmission(String proId);
/**
* 查询累计减排
......@@ -105,7 +105,7 @@ public interface OverViewService {
* @param year
* @return
*/
List<Float> statEmissionMonth(String proId, int year);
List<BigDecimal> statEmissionMonth(String proId, int year);
/**
* 日 碳排放
......@@ -114,7 +114,7 @@ public interface OverViewService {
* @param month
* @return
*/
List<Float> statEmissionDay(String proId, int year, int month);
List<BigDecimal> statEmissionDay(String proId, int year, int month);
/**
* 统计昨天排放量,更新累计排放量
......
......@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
/**
......@@ -57,9 +58,15 @@ public class OverViewServiceImpl implements OverViewService {
if(time != 0) now = this.getBeforeDay(now, time);
Map<String, String> result = new HashMap<String, String>();
result.put("year", String.valueOf(now.get(Calendar.YEAR)));
result.put("month", String.valueOf(now.get(Calendar.MONTH) + 1));
result.put("day", String.valueOf(now.get(Calendar.DAY_OF_MONTH)));
result.put("hour", String.valueOf(now.get(Calendar.HOUR_OF_DAY)));
String month = String.valueOf(now.get(Calendar.MONTH) + 1);
if (month.length() == 1) month = "0" + month;
result.put("month", month);
String day = String.valueOf(now.get(Calendar.DAY_OF_MONTH));
if (day.length() == 1) day = "0" + day;
result.put("day", day);
String hour = String.valueOf(now.get(Calendar.HOUR_OF_DAY));
if (hour.length() == 1) hour = "0" + hour;
result.put("hour", hour);
return result;
}
......@@ -77,8 +84,12 @@ public class OverViewServiceImpl implements OverViewService {
}
Map<String, String> result = new HashMap<String, String>();
result.put("year", String.valueOf(calendar.get(Calendar.YEAR)));
result.put("month", String.valueOf(calendar.get(Calendar.MONTH) + 1));
result.put("day", String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
String _month = String.valueOf(calendar.get(Calendar.MONTH) + 1);
if (_month.length() == 1) _month = "0" + _month;
result.put("month", _month);
String _day = String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
if (_day.length() == 1) _day = "0" + _day;
result.put("day", _day);
return result;
}
......@@ -168,8 +179,9 @@ public class OverViewServiceImpl implements OverViewService {
}
//小时:24,日:其他,月:12
private List<Float> getEnergyResult(List<EnergyCountMVo> list, int num){
List<Float> resultList = new ArrayList<Float>();
private List<BigDecimal> getEnergyResult(List<EnergyCountMVo> list, int num){
BigDecimal zero = new BigDecimal(0);
List<BigDecimal> resultList = new ArrayList<>();
if(list != null && list.size() > 0){
int size = list.size();
int j = 1;
......@@ -188,18 +200,18 @@ public class OverViewServiceImpl implements OverViewService {
break;
}
while (temp > j++){
resultList.add(0f);
resultList.add(zero);
}
resultList.add(e.getEnergy());
if(i == size - 1){
while (temp++ < num){
resultList.add(0f);
resultList.add(zero);
}
}
}
}else{
for (int i = 0; i < num; i++) {
resultList.add(0f);
resultList.add(zero);
}
}
return resultList;
......@@ -244,8 +256,9 @@ public class OverViewServiceImpl implements OverViewService {
}
//日:其他,月:12
private List<Float> getEmissionResult(List<EnergyEmissionReal> list, int num) {
List<Float> resultList = new ArrayList<Float>();
private List<BigDecimal> getEmissionResult(List<EnergyEmissionReal> list, int num) {
BigDecimal zero = new BigDecimal(0);
List<BigDecimal> resultList = new ArrayList<BigDecimal>();
if(list != null && list.size() > 0){
int size = list.size();
int j = 1;
......@@ -261,18 +274,18 @@ public class OverViewServiceImpl implements OverViewService {
break;
}
while (temp > j++){
resultList.add(0f);
resultList.add(zero);
}
resultList.add(e.getEmission());
if(i == size - 1){
while (temp++ < num){
resultList.add(0f);
resultList.add(zero);
}
}
}
}else{
for (int i = 0; i < num; i++) {
resultList.add(0f);
resultList.add(zero);
}
}
return resultList;
......@@ -280,7 +293,6 @@ public class OverViewServiceImpl implements OverViewService {
@Override
public EnergyPriceVo getPrice(String proId) {
Map<String, Object> map = new HashMap<String, Object>();
int i = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
EnergyPrice e = new EnergyPrice();
e.setProId(proId);
......@@ -322,6 +334,7 @@ public class OverViewServiceImpl implements OverViewService {
@Override
public List<EnergyCountMVo> countEnergySplit(String proId, Integer type, Integer date) {
List<EnergyCountMVo> list = null;
Map<String, String> cal = this.getTime(date);
EnergyCountMVo e = new EnergyCountMVo();
e.setProId(proId);
......@@ -329,7 +342,25 @@ public class OverViewServiceImpl implements OverViewService {
e.setYear(cal.get("year"));
e.setMon(cal.get("month"));
e.setDay(cal.get("day"));
return energyCountMRepository.countEnergySplit(e);
if (type == 1) {//水单独统计
list = energyCountMRepository.countEnergySplitWater(e);
if (list.size() > 0) {
EnergyCountMVo m = list.get(0);
m.setName("水能耗");
m.setPercent("100%");
}
} else {//电气统计
list = energyCountMRepository.countEnergySplitElecGas(e);
BigDecimal total = new BigDecimal(0);
for (int i = 0; i < list.size(); i++) {
total = total.add(list.get(i).getEnergy());
}
for (int i = 0; i < list.size(); i++) {
EnergyCountMVo energyCountMVo = list.get(i);
energyCountMVo.setPercent(energyCountMVo.getEnergy().divide(total).multiply(new BigDecimal(100)).setScale(1) + "%");
}
}
return list;
}
@Override
......@@ -371,6 +402,7 @@ public class OverViewServiceImpl implements OverViewService {
@Override
public Map<String, Object> getUnitArea(String proId) {
BigDecimal zero = new BigDecimal(0);
String thisY = getTime(0).get("year");
int i = Integer.parseInt(thisY);
String lastY = String.valueOf(i - 1);
......@@ -389,10 +421,10 @@ public class OverViewServiceImpl implements OverViewService {
//返回结果
Map<String, Object> result = new HashMap<String, Object>();
if(beforeBus == null) {
beforeBus = new BusProjectAreaStat(beforeY, 0f, 0f, 0f);
beforeBus = new BusProjectAreaStat(beforeY, zero, zero, zero);
}
if(lastBus == null) {
lastBus = new BusProjectAreaStat(beforeY, 0f, 0f, 0f);
lastBus = new BusProjectAreaStat(beforeY, zero, zero, zero);
}
if(thisBus == null) {
thisBus = lastBus;
......@@ -419,7 +451,7 @@ public class OverViewServiceImpl implements OverViewService {
//查找现在的数据
List<EnergyCountMVo> nowCompare = energyCountMRepository.getEnergyCompare(e);
//现在数据最后返回的对象
List<Float> nowReturn = this.getEnergyResult(nowCompare, dateCount);
List<BigDecimal> nowReturn = this.getEnergyResult(nowCompare, dateCount);
//查找需要比较的数据
Map<String, String> time = null;
//同比,环比,确定时间
......@@ -437,11 +469,11 @@ public class OverViewServiceImpl implements OverViewService {
result.put("cYear", c_year);
result.put("cMonth", c_month);
List<EnergyCountMVo> lastCompare = energyCountMRepository.getEnergyCompare(e);
List<Float> lastReturn = this.getEnergyResult(lastCompare, dateCount);
List<BigDecimal> lastReturn = this.getEnergyResult(lastCompare, dateCount);
//差值
List<Float> diffReturn = new ArrayList<Float>();
List<BigDecimal> diffReturn = new ArrayList<BigDecimal>();
for (int i = 0; i < nowReturn.size(); i++) {
diffReturn.add(nowReturn.get(i) - lastReturn.get(i));
diffReturn.add(nowReturn.get(i).subtract(lastReturn.get(i)));
}
//数据值
result.put("nData", nowReturn);
......@@ -471,7 +503,7 @@ public class OverViewServiceImpl implements OverViewService {
String proId = busProjectIterator.next().getProId();
//查询该项目的水电气面积
// BusProjectAreaVo busProjectAreaVo = busProjectAreaRepository.classifyProjectArea(proId);
Float area = busProjectIterator.next().getBldArea();
BigDecimal area = busProjectIterator.next().getBldArea();
//3.查询对应项目的能源统计(按月份统计)
EnergyCountM e = new EnergyCountM();
e.setProId(proId);
......@@ -479,21 +511,23 @@ public class OverViewServiceImpl implements OverViewService {
List<EnergyCountM> energyList = energyCountMRepository.getEnergyMonth(e);
//4.算出水电气的统计
if(energyList != null){
BigDecimal month = new BigDecimal(12);
int size = energyList.size();
if(size > 0){
BigDecimal listSize = new BigDecimal(size);
//得到全年总和
Float waterSum = 0f, elecSum = 0f, gasSum = 0f;
BigDecimal waterSum = new BigDecimal(0), elecSum = new BigDecimal(0), gasSum = new BigDecimal(0);
Iterator<EnergyCountM> it = energyList.iterator();
while (it.hasNext()) {
EnergyCountM energyCountM = it.next();
waterSum += energyCountM.getWater();
elecSum += energyCountM.getElec();
gasSum += energyCountM.getGas();
waterSum = waterSum.add(energyCountM.getWater());
elecSum = elecSum.add(energyCountM.getElec());
gasSum = gasSum.add(energyCountM.getGas());
}
//算出年度平均值
waterSum = waterSum * 12 / size / area;
elecSum = elecSum * 12 / size / area;
gasSum = gasSum * 12 / size / area;
waterSum = waterSum.multiply(month).divide(listSize).divide(area).setScale(1);
elecSum = elecSum.multiply(month).divide(listSize).divide(area).setScale(1);
gasSum = gasSum.multiply(month).divide(listSize).divide(area).setScale(1);
//需要新增或更新的对象
resultList.add(new BusProjectAreaStat(proId, yearS, waterSum, elecSum, gasSum));
}
......@@ -517,8 +551,9 @@ public class OverViewServiceImpl implements OverViewService {
}
@Override
public Map<String, Object> getEmission(String proId) {
Map<String, Object> result = new HashMap<String, Object>();
public Map<String, BigDecimal> getEmission(String proId) {
BigDecimal zero = new BigDecimal(0);
Map<String, BigDecimal> result = new HashMap<>();
Calendar calendar = this.getBeforeDay(Calendar.getInstance(), -1);
//昨天时间
Integer year = calendar.get(Calendar.YEAR), month = calendar.get(Calendar.MONTH) + 1, day = calendar.get(Calendar.DAY_OF_MONTH);
......@@ -528,44 +563,44 @@ public class OverViewServiceImpl implements OverViewService {
EnergyEmissionReal e_now = new EnergyEmissionReal(proId, year);
EnergyEmissionReal year_now = energyEmissionRealRepository.statEnergyEmissionReal(e_now);
if(year_now != null) result.put("year_now", year_now.getEmission());
else result.put("year_now", 0f);
else result.put("year_now", zero);
//当月
e_now.setMon(month);
EnergyEmissionReal month_now = energyEmissionRealRepository.statEnergyEmissionReal(e_now);
if(month_now != null) result.put("month_now", month_now.getEmission());
else result.put("month_now", 0f);
else result.put("month_now", zero);
//当日
e_now.setDay(day);
EnergyEmissionReal day_now = energyEmissionRealRepository.queryEnergyEmissionReal(e_now);
if(day_now != null) result.put("day_now", day_now.getEmission());
else result.put("day_now", 0f);
else result.put("day_now", zero);
//同比年
EnergyEmissionReal e_same = new EnergyEmissionReal(proId, year - 1);
EnergyEmissionReal year_same = energyEmissionRealRepository.statEnergyEmissionReal(e_same);
if(year_same != null) result.put("year_same", (Float) result.get("year_now") - year_same.getEmission());
else result.put("year_same", (Float) result.get("year_now") - 0);
if(year_same != null) result.put("year_same", result.get("year_now").subtract(year_same.getEmission()));
else result.put("year_same", result.get("year_now").subtract(zero));
//同比月
e_same.setMon(month);
EnergyEmissionReal month_same = energyEmissionRealRepository.statEnergyEmissionReal(e_same);
if(month_same != null) result.put("month_same", (Float) result.get("month_now") - month_same.getEmission());
else result.put("month_same", (Float) result.get("month_now") - 0);
if(month_same != null) result.put("month_same", result.get("month_now").subtract(month_same.getEmission()));
else result.put("month_same", result.get("month_now").subtract(zero));
//同比日
e_same.setDay(day);
EnergyEmissionReal day_same = energyEmissionRealRepository.queryEnergyEmissionReal(e_same);
if(day_same != null) result.put("day_same", (Float) result.get("day_now") - day_same.getEmission());
else result.put("day_same", (Float) result.get("day_now") - 0);
if(day_same != null) result.put("day_same", result.get("day_now").subtract(day_same.getEmission()));
else result.put("day_same", result.get("day_now").subtract(zero));
//环比月
Map<String, String> ring_time = this.getTime(null, month.toString(), null, 0, -1, 0);
EnergyEmissionReal e_ring = new EnergyEmissionReal(proId, Integer.parseInt(ring_time.get("year")), Integer.parseInt(ring_time.get("month")), Integer.parseInt(ring_time.get("day")));
EnergyEmissionReal month_ring = energyEmissionRealRepository.statEnergyEmissionReal(e_ring);
if(month_ring != null) result.put("month_ring", (Float) result.get("month_now") - month_ring.getEmission());
else result.put("month_ring", (Float) result.get("month_now") - 0);
if(month_ring != null) result.put("month_ring", result.get("month_now").subtract(month_ring.getEmission()));
else result.put("month_ring", result.get("month_now").subtract(zero));
//环比日
ring_time = this.getTime(null, null, day.toString(), 0, 0, -1);
e_ring = new EnergyEmissionReal(proId, Integer.parseInt(ring_time.get("year")), Integer.parseInt(ring_time.get("month")), Integer.parseInt(ring_time.get("day")));
EnergyEmissionReal day_ring = energyEmissionRealRepository.queryEnergyEmissionReal(e_ring);
if(day_ring != null) result.put("day_ring", (Float) result.get("day_now") - day_ring.getEmission());
else result.put("day_ring", (Float) result.get("day_now") - 0);
if(day_ring != null) result.put("day_ring", result.get("day_now").subtract(day_ring.getEmission()));
else result.put("day_ring", result.get("day_now").subtract(zero));
return result;
}
......@@ -577,20 +612,21 @@ public class OverViewServiceImpl implements OverViewService {
}
@Override
public List<Float> statEmissionMonth(String proId, int year) {
public List<BigDecimal> statEmissionMonth(String proId, int year) {
EnergyEmissionReal e = new EnergyEmissionReal(proId, year);
List<EnergyEmissionReal> list = energyEmissionRealRepository.statEmissionMonth(e);
return this.getEmissionResult(list, 12);
}
@Override
public List<Float> statEmissionDay(String proId, int year, int month) {
public List<BigDecimal> statEmissionDay(String proId, int year, int month) {
return this.getEmissionResult(energyEmissionRealRepository.statEmissionDay(new EnergyEmissionReal(proId, year, month)), this.getCurrentMonthDateCount(year, month));
}
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public PersistModel statEmission() {
BigDecimal zero = new BigDecimal(0);
int result = 0;
Calendar calendar = this.getBeforeDay(Calendar.getInstance(), -1);
//昨天时间
......@@ -605,8 +641,8 @@ public class OverViewServiceImpl implements OverViewService {
EnergyCountM energyCountM = energyCountMRepository.countEnergyDay(new EnergyCountM(proId, day.toString(), month.toString(), year.toString()));
if(energyCountM != null){
//得到碳排放量
Float water = energyCountM.getWater(), elec = energyCountM.getElec(), gas = energyCountM.getGas();
float total = (float) (Math.floor(((water == null ? 0f : water * 0.91f) + (elec == null ? 0f : elec * 0.785f) + (gas == null ? 0f : gas * 0.19f)) * 100) / 100);
BigDecimal water = energyCountM.getWater(), elec = energyCountM.getElec(), gas = energyCountM.getGas();
BigDecimal total = (water == null ? zero : water.multiply(new BigDecimal(0.91))).add(elec == null ? zero : elec.multiply(new BigDecimal(0.785))).add(gas == null ? zero : gas.multiply(new BigDecimal(0.19f)));
//保存每天的实际碳排放量
EnergyEmissionReal e = new EnergyEmissionReal(null, proId, year, month, day, total);
int i = energyEmissionRealRepository.insert(e);
......@@ -614,8 +650,8 @@ public class OverViewServiceImpl implements OverViewService {
EnergyEmissionTotal t = energyEmissionTotalRepository.selectOne(new EnergyEmissionTotal(null, proId, null, year));
if(t != null){
EnergyEmissionPlan p = energyEmissionPlanRepository.selectOne(new EnergyEmissionPlan(null, proId, month, day, null));
Float pEmission = p == null ? 0f : p.getEmission();
t.setEmission(pEmission - total + t.getEmission());
BigDecimal pEmission = p == null ? zero : p.getEmission();
t.setEmission(pEmission.subtract(total).add(t.getEmission()));
Example example = new Example(BusProjectAreaStat.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id", t.getId());
......
......@@ -32,8 +32,15 @@ public class EnergyCountMVo extends EnergyCountM {
//费用
private BigDecimal money;
//能耗
private Float energy;
private BigDecimal energy;
//日期,今日昨日
private Integer date;
//------------能耗拆分返回值---------------
private String name;
private BigDecimal value;
private String percent;
}
......@@ -11,6 +11,6 @@ import java.math.BigDecimal;
@Data
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 @@
<resultMap id="EnergyDistributed" type="org.rcisoft.business.mainte.distributed.entity.EnergyDistributed">
<result column="PRO_NM" jdbcType="VARCHAR" property="proNm"/>
<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="ELEC_MONEY" jdbcType="DECIMAL" property="elecMoney"/>
<result column="GAS_MONEY" jdbcType="DECIMAL" property="gasMoney"/>
......
......@@ -4,17 +4,17 @@
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.BusProjectArea">
<id column="ID" jdbcType="VARCHAR" property="id"/>
<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="INDUSTRY_STD" jdbcType="FLOAT" property="industryStd"/>
<result column="SUGGEST_STD" jdbcType="FLOAT" property="suggestStd"/>
<result column="COUNTRY_STD" jdbcType="FLOAT" property="countryStd"/>
<result column="INDUSTRY_STD" jdbcType="DECIMAL" property="industryStd"/>
<result column="SUGGEST_STD" jdbcType="DECIMAL" property="suggestStd"/>
<result column="COUNTRY_STD" jdbcType="DECIMAL" property="countryStd"/>
</resultMap>
<!--<resultMap id="vo" type="org.rcisoft.business.overview.vo.BusProjectAreaVo">-->
<!--<result column="WATER_AREA" jdbcType="FLOAT" property="waterArea"/>-->
<!--<result column="ELEC_AREA" jdbcType="FLOAT" property="elecArea"/>-->
<!--<result column="GAS_AREA" jdbcType="FLOAT" property="gasArea"/>-->
<!--<result column="WATER_AREA" jdbcType="DECIMAL" property="waterArea"/>-->
<!--<result column="ELEC_AREA" jdbcType="DECIMAL" property="elecArea"/>-->
<!--<result column="GAS_AREA" jdbcType="DECIMAL" property="gasArea"/>-->
<!--</resultMap>-->
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
......@@ -5,9 +5,9 @@
<id column="ID" jdbcType="INTEGER" property="id"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="YEAR" jdbcType="VARCHAR" property="year"/>
<result column="WATER" jdbcType="FLOAT" property="water"/>
<result column="ELEC" jdbcType="FLOAT" property="elec"/>
<result column="GAS" jdbcType="FLOAT" property="gas"/>
<result column="WATER" jdbcType="DECIMAL" property="water"/>
<result column="ELEC" jdbcType="DECIMAL" property="elec"/>
<result column="GAS" jdbcType="DECIMAL" property="gas"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
......@@ -2,14 +2,23 @@
<!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">
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.BusProject">
<id column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="PRO_NM" jdbcType="VARCHAR" property="proNm"/>
<result column="BLD_TP_ID" jdbcType="VARCHAR" property="bldTpId"/>
<result column="BLD_AREA" jdbcType="FLOAT" property="bldArea"/>
<result column="BLD_LOCAL" jdbcType="VARCHAR" property="bldLocal"/>
<result column="BLD_COORDINATE" jdbcType="VARCHAR" property="bldCoordinate"/>
<result column="OWN_ID" jdbcType="VARCHAR" property="ownId"/>
<result column="TEAM_ID" jdbcType="VARCHAR" property="teamId"/>
<id column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="PRO_NM" jdbcType="VARCHAR" property="proNm"/>
<result column="BLD_TP_ID" jdbcType="VARCHAR" property="bldTpId"/>
<result column="BLD_AREA" jdbcType="DECIMAL" property="bldArea"/>
<result column="BLD_LOCAL" jdbcType="VARCHAR" property="bldLocal"/>
<result column="BLD_COORDINATE" jdbcType="VARCHAR" property="bldCoordinate"/>
<result column="OWN_ID" jdbcType="VARCHAR" property="ownId"/>
<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>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
......@@ -3,11 +3,11 @@
<mapper namespace="org.rcisoft.business.overview.dao.EnergyCountMRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.EnergyCountM">
<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="WATER" jdbcType="FLOAT" property="water"/>
<result column="ELEC" jdbcType="FLOAT" property="elec"/>
<result column="GAS" jdbcType="FLOAT" property="gas"/>
<result column="WATER" jdbcType="DECIMAL" property="water"/>
<result column="ELEC" jdbcType="DECIMAL" property="elec"/>
<result column="GAS" jdbcType="DECIMAL" property="gas"/>
<result column="HOUR" jdbcType="VARCHAR" property="hour"/>
<result column="DAY" jdbcType="VARCHAR" property="day"/>
<result column="MON" jdbcType="VARCHAR" property="mon"/>
......@@ -19,10 +19,13 @@
</resultMap>
<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="DAY" jdbcType="VARCHAR" property="day"/>
<result column="MON" jdbcType="VARCHAR" property="mon"/>
<result column="MONEY" jdbcType="DECIMAL" property="money"/>
<result column="ENERGY" jdbcType="DECIMAL" property="energy"/>
<result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="VALUE" jdbcType="DECIMAL" property="value"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
......@@ -6,7 +6,7 @@
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="MON" jdbcType="INTEGER" property="mon"/>
<result column="DAY" jdbcType="INTEGER" property="day"/>
<result column="EMISSION" jdbcType="FLOAT" property="emission"/>
<result column="EMISSION" jdbcType="DECIMAL" property="emission"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
......@@ -7,7 +7,7 @@
<result column="YEAR" jdbcType="INTEGER" property="year"/>
<result column="MON" jdbcType="INTEGER" property="mon"/>
<result column="DAY" jdbcType="INTEGER" property="day"/>
<result column="EMISSION" jdbcType="FLOAT" property="emission"/>
<result column="EMISSION" jdbcType="DECIMAL" property="emission"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
......@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="org.rcisoft.business.overview.entity.EnergyEmissionTotal">
<id column="ID" jdbcType="INTEGER" property="id"/>
<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"/>
</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