Browse Source

Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml
develop
zhousq 11 months ago
parent
commit
6d0eefd506
  1. 12
      lzbi-admin/src/main/resources/application-dev.yml
  2. 50
      lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java
  3. 1
      lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java
  4. 2
      lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java
  5. 32
      lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsDTO.java
  6. 36
      lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsDTO.java
  7. 14
      lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java
  8. 28
      lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureReq.java
  9. 204
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java
  10. 18
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanTargetMonthService.java
  11. 22
      lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java
  12. 6
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java
  13. 10
      lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java
  14. 19
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java
  15. 1
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java
  16. 8
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDaySubService.java
  17. 1
      lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java
  18. 93
      lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java
  19. 15
      lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseTargetModelController.java
  20. 58
      lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTarget.java
  21. 23
      lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java
  22. 38
      lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java
  23. 34
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml
  24. 159
      lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftDayMapper.xml
  25. 47
      lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

12
lzbi-admin/src/main/resources/application-dev.yml

@ -108,4 +108,14 @@ logging:
org.springframework: warn
# 指标模板
target-model:
user: TM00051
user: TM000YH # 用户
boiler: TM000GL # 锅炉
electricityConsumes: TM000DH #电耗
waterConsumes: TM000SH # 水耗
coalConsumes: TM000MH # 煤耗
calorific: TM000FRL # 发热量
heatSupplied: TM000GRL # 供热量
acreage: MJ01 # 面积
outputOfPlant: TM000FDL # 发电量
provideWaterAverageTemperature: TM000GSJW # 供水均温
answerWaterAverageTemperature: TM000HSJW # 回水均温

50
lzbi-common/src/main/java/com/lzbi/common/config/TargetModelConfig.java

@ -16,4 +16,54 @@ public class TargetModelConfig {
* 用户
*/
private String user;
/**
* 锅炉
*/
private String boiler;
/**
* 电耗
*/
private String electricityConsumes;
/**
* 水耗
*/
private String waterConsumes;
/**
* 煤耗
*/
private String coalConsumes;
/**
* 发热量
*/
private String calorific;
/**
* 供热量
*/
private String heatSupplied;
/**
* 面积
*/
private String acreage;
/**
* 发电量
*/
private String outputOfPlant;
/**
* 供水均温
*/
private String provideWaterAverageTemperature;
/**
* 回水均温
*/
private String answerWaterAverageTemperature;
}

1
lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseAssetInfo.java

@ -13,7 +13,6 @@ import lombok.experimental.Accessors;
* @date 2023-11-27
*/
@Data
//@TableName("dc_base_work_special")
@Accessors(chain = true)
public class DcBaseAssetInfo extends BaseModuleEntity {
private static final long serialVersionUID = 1L;

2
lzbi-module/src/main/java/com/lzbi/bi/domain/CalorificValueVO.java

@ -24,5 +24,5 @@ public class CalorificValueVO {
/**
* 百分比
*/
private double percentage;
private int percentage;
}

32
lzbi-module/src/main/java/com/lzbi/bi/domain/ConsumesStatisticsDTO.java

@ -0,0 +1,32 @@
package com.lzbi.bi.domain;
import lombok.Data;
@Data
public class ConsumesStatisticsDTO {
/**
* 公司id
*/
private Long companyId;
/**
*
*/
private String year;
/**
*
*/
private String month;
/**
* 电耗指标模板
*/
private String electricityConsumes;
/**
* 水耗指标模板
*/
private String waterConsumes;
/**
* 煤耗指标模板
*/
private String coalConsumes;
}

36
lzbi-module/src/main/java/com/lzbi/bi/domain/CorporateStatisticsDTO.java

@ -0,0 +1,36 @@
package com.lzbi.bi.domain;
import lombok.Data;
@Data
public class CorporateStatisticsDTO {
/**
* 公司id
*/
private Long companyId;
/**
*
*/
private String year;
/**
*
*/
private String month;
/**
* 面积
*/
private String acreage;
/**
* 发电量
*/
private String outputOfPlant;
/**
* 发热量
*/
private String calorificValue;
/**
* 供热量
*/
private String heatSupplied;
}

14
lzbi-module/src/main/java/com/lzbi/bi/domain/HeatSuppliedVO.java

@ -1,6 +1,8 @@
package com.lzbi.bi.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;
@ -11,7 +13,17 @@ import java.util.List;
@Data
public class HeatSuppliedVO {
private List<String> labelArr;
private List<Label> labelArr;
private List<BigDecimal> valueArr;
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class Label {
private String name;
private BigDecimal max;
}
}

28
lzbi-module/src/main/java/com/lzbi/bi/domain/ProvideAnswerWaterAverageTemperatureReq.java

@ -0,0 +1,28 @@
package com.lzbi.bi.domain;
import lombok.Data;
@Data
public class ProvideAnswerWaterAverageTemperatureReq {
/**
* 公司id
*/
private Long companyId;
/**
*
*/
private String year;
/**
*
*/
private String month;
/**
* 供水均温
*/
private String provideWaterAverageTemperature;
/**
* 回水均温
*/
private String answerWaterAverageTemperature;
}

204
lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiDataScreenNewService.java

@ -4,7 +4,9 @@ import com.lzbi.bi.domain.*;
import com.lzbi.common.config.TargetModelConfig;
import com.lzbi.common.utils.bean.BeanUtils;
import com.lzbi.draft.domain.DcBusiTargetDraftDay;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper;
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,6 +17,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -31,19 +34,20 @@ public class DcBusiDataScreenNewService {
@Resource
private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper;
@Resource
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper;
public List<UserIOverViewVO> getUserOverview(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<UserIOverViewVO> list = new ArrayList<>();
// list.add(new UserIOverViewVO("热源1", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000)));
// list.add(new UserIOverViewVO("热源2", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000)));
// list.add(new UserIOverViewVO("热源3", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000)));
// list.add(new UserIOverViewVO("热源4", BigDecimal.valueOf(10000), BigDecimal.valueOf(8000)));
DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-");
if (yearMonthDayArr.length > 1) {
params.setCountYear(yearMonthDayArr[0]);
params.setCountMonth(yearMonthDayArr[1]);
params.setTargetCode(targetModelConfig.getUser());
}
params.setTargetModelCode(targetModelConfig.getUser());
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params);
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) {
Map<Object, List<DcBusiTargetDraftDay>> map;
@ -52,7 +56,6 @@ public class DcBusiDataScreenNewService {
} else {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
}
Class<DcBusiTargetDraftDay> dcBusiTargetDraftMonthClass = DcBusiTargetDraftDay.class;
map.forEach((key, value) -> {
UserIOverViewVO userIOverViewVO = new UserIOverViewVO();
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
@ -76,11 +79,17 @@ public class DcBusiDataScreenNewService {
public ProvideAnswerWaterAverageTemperatureVO getProvideAnswerWaterAverageTemperature(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
ProvideAnswerWaterAverageTemperatureVO provideAnswerWaterAverageTemperatureVO = new ProvideAnswerWaterAverageTemperatureVO();
ProvideAnswerWaterAverageTemperatureReq params = new ProvideAnswerWaterAverageTemperatureReq();
params.setCompanyId(dcBusDataScreenNewReq.getCompanyId());
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-");
dcBusDataScreenNewReq.setYear(yearMonthDayArr[0]);
dcBusDataScreenNewReq.setMonth(yearMonthDayArr[1]);
List<ProvideAnswerWaterAverageTemperatureDTO> provideAnswerWaterAverageTemperatureDTOS = dcBusiTargetDraftDayMapper.selectProvideAnswerWaterAverageTemperatureList(dcBusDataScreenNewReq);
if (yearMonthDayArr.length > 1) {
params.setYear(yearMonthDayArr[0]);
params.setMonth(yearMonthDayArr[1]);
}
params.setProvideWaterAverageTemperature(targetModelConfig.getProvideWaterAverageTemperature());
params.setAnswerWaterAverageTemperature(targetModelConfig.getAnswerWaterAverageTemperature());
List<ProvideAnswerWaterAverageTemperatureDTO> provideAnswerWaterAverageTemperatureDTOS = dcBusiTargetDraftDayMapper.selectProvideAnswerWaterAverageTemperatureList(params);
if (CollectionUtils.isNotEmpty(provideAnswerWaterAverageTemperatureDTOS)) {
List<String> xArr = new ArrayList<>();
List<BigDecimal> yArr1 = new ArrayList<>();
@ -99,56 +108,169 @@ public class DcBusiDataScreenNewService {
public List<BoilerStatisticsVO> getBoilerStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<BoilerStatisticsVO> list = new ArrayList<>();
list.add(new BoilerStatisticsVO("热源1", BigDecimal.valueOf(248776)));
list.add(new BoilerStatisticsVO("热源2", BigDecimal.valueOf(248776)));
list.add(new BoilerStatisticsVO("热源3", BigDecimal.valueOf(248776)));
// list.add(new BoilerStatisticsVO("热源1", BigDecimal.valueOf(248776)));
// list.add(new BoilerStatisticsVO("热源2", BigDecimal.valueOf(248776)));
// list.add(new BoilerStatisticsVO("热源3", BigDecimal.valueOf(248776)));
DcBusiTargetDraftMonth params = new DcBusiTargetDraftMonth();
BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-");
if (yearMonthDayArr.length > 1) {
params.setCountYear(yearMonthDayArr[0]);
params.setCountMonth(yearMonthDayArr[1]);
}
params.setTargetModelCode(targetModelConfig.getBoiler());
List<DcBusiTargetDraftMonth> dcBusiTargetDraftMonths = dcBusiTargetDraftMonthMapper.selectDcBusiTargetDraftMonthList(params);
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftMonths)) {
Map<Object, List<DcBusiTargetDraftMonth>> map;
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
map = dcBusiTargetDraftMonths.stream().collect(Collectors.groupingBy(DcBusiTargetDraftMonth::getOrgId));
} else {
map = dcBusiTargetDraftMonths.stream().collect(Collectors.groupingBy(DcBusiTargetDraftMonth::getAssetCode));
}
map.forEach((key, value) -> {
BoilerStatisticsVO boilerStatisticsVO = new BoilerStatisticsVO();
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
boilerStatisticsVO.setLabel(value.get(0).getOrgName());
} else {
boilerStatisticsVO.setLabel(value.get(0).getAssetName());
}
BigDecimal sum = new BigDecimal(0);
for (int i = 0, len = value.size(); i < len; i++) {
sum = sum.add(value.get(i).getValOriginal());
}
boilerStatisticsVO.setValue(sum);
list.add(boilerStatisticsVO);
});
}
return list;
}
public List<ConsumesStatisticsVO> getConsumesStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<ConsumesStatisticsVO> list = new ArrayList<>();
list.add(new ConsumesStatisticsVO("热源1", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) ));
list.add(new ConsumesStatisticsVO("热源2", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) ));
list.add(new ConsumesStatisticsVO("热源3", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) ));
list.add(new ConsumesStatisticsVO("热源4", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) ));
list.add(new ConsumesStatisticsVO("热源5", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) ));
return list;
ConsumesStatisticsDTO consumesStatisticsDTO = new ConsumesStatisticsDTO();
consumesStatisticsDTO.setCompanyId(dcBusDataScreenNewReq.getCompanyId());
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-");
if (yearMonthDayArr.length > 1) {
consumesStatisticsDTO.setYear(yearMonthDayArr[0]);
consumesStatisticsDTO.setMonth(yearMonthDayArr[1]);
}
consumesStatisticsDTO.setElectricityConsumes(targetModelConfig.getElectricityConsumes());
consumesStatisticsDTO.setWaterConsumes(targetModelConfig.getWaterConsumes());
consumesStatisticsDTO.setCoalConsumes(targetModelConfig.getCoalConsumes());
return dcBusiTargetDraftDayMapper.getConsumesStatistics(consumesStatisticsDTO);
}
public List<CalorificValueVO> getCalorificValue(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<CalorificValueVO> list = new ArrayList<>();
list.add(new CalorificValueVO("热源1", BigDecimal.valueOf(7897), 17));
list.add(new CalorificValueVO("热源2", BigDecimal.valueOf(9766), 21));
list.add(new CalorificValueVO("热源3", BigDecimal.valueOf(5571), 12));
list.add(new CalorificValueVO("热源4", BigDecimal.valueOf(7897), 17));
list.add(new CalorificValueVO("热源5", BigDecimal.valueOf(9766), 21));
list.add(new CalorificValueVO("热源6", BigDecimal.valueOf(5571), 12));
DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-");
if (yearMonthDayArr.length > 1) {
params.setCountYear(yearMonthDayArr[0]);
params.setCountMonth(yearMonthDayArr[1]);
}
params.setTargetModelCode(targetModelConfig.getCalorific());
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params);
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) {
Map<Object, List<DcBusiTargetDraftDay>> map;
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId));
} else {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
}
AtomicReference<BigDecimal> total = new AtomicReference<>(new BigDecimal(0));
map.forEach((key, value) -> {
CalorificValueVO calorificValueVO = new CalorificValueVO();
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
calorificValueVO.setLabel(value.get(0).getOrgName());
} else {
calorificValueVO.setLabel(value.get(0).getAssetName());
}
BigDecimal sum = new BigDecimal(0);
for (int i = 0, len = value.size(); i < len; i++) {
sum = sum.add(value.get(i).getValAccumulative());
total.set(total.get().add(value.get(i).getValAccumulative()));
}
calorificValueVO.setValue(sum);
list.add(calorificValueVO);
});
BigDecimal percentageSum = BigDecimal.valueOf(100);
for (int i = 0, len = list.size(); i < len; i++) {
CalorificValueVO item = list.get(i);
BigDecimal percentage = item.getValue().divide(total.get(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100));
if (i < len - 1) {
percentageSum = percentageSum.subtract(percentage);
item.setPercentage(percentage.intValue());
} else {
item.setPercentage(percentageSum.intValue());
}
}
}
return list;
}
public HeatSuppliedVO getHeatSupplied(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
HeatSuppliedVO heatSuppliedVO = new HeatSuppliedVO();
List<String> labelArr = new ArrayList<>();
DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-");
if (yearMonthDayArr.length > 1) {
params.setCountYear(yearMonthDayArr[0]);
params.setCountMonth(yearMonthDayArr[1]);
}
params.setTargetModelCode(targetModelConfig.getHeatSupplied());
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params);
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) {
Map<Object, List<DcBusiTargetDraftDay>> map;
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getOrgId));
} else {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
}
List<HeatSuppliedVO.Label> labelArray = new ArrayList<>();
List<BigDecimal> valueArr = new ArrayList<>();
labelArr.add("热源1");
labelArr.add("热源2");
labelArr.add("热源3");
labelArr.add("热源4");
labelArr.add("热源5");
labelArr.add("热源6");
valueArr.add(BigDecimal.valueOf(300));
valueArr.add(BigDecimal.valueOf(500));
valueArr.add(BigDecimal.valueOf(300));
valueArr.add(BigDecimal.valueOf(100));
valueArr.add(BigDecimal.valueOf(500));
valueArr.add(BigDecimal.valueOf(100));
heatSuppliedVO.setLabelArr(labelArr);
final BigDecimal[] max = {new BigDecimal(0)};
map.forEach((key, value) -> {
HeatSuppliedVO.Label label = new HeatSuppliedVO.Label();
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
label.setName(value.get(0).getOrgName());
} else {
label.setName(value.get(0).getAssetName());
}
BigDecimal sum = new BigDecimal(0);
for (int i = 0, len = value.size(); i < len; i++) {
sum = sum.add(value.get(i).getValAccumulative());
}
valueArr.add(sum);
if (max[0].compareTo(sum) < 0) {
max[0] = sum;
}
labelArray.add(label);
});
labelArray.stream().forEach(label -> label.setMax(max[0]));
heatSuppliedVO.setLabelArr(labelArray);
heatSuppliedVO.setValueArr(valueArr);
}
return heatSuppliedVO;
}
public CorporateStatisticsVO getCorporateStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
CorporateStatisticsVO corporateStatisticsVO = new CorporateStatisticsVO();
return new CorporateStatisticsVO(BigDecimal.valueOf(3820), BigDecimal.valueOf(3820), BigDecimal.valueOf(3820), BigDecimal.valueOf(3820));
CorporateStatisticsDTO corporateStatisticsDTO = new CorporateStatisticsDTO();
corporateStatisticsDTO.setCompanyId(dcBusDataScreenNewReq.getCompanyId());
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-");
if (yearMonthDayArr.length > 1) {
corporateStatisticsDTO.setYear(yearMonthDayArr[0]);
corporateStatisticsDTO.setMonth(yearMonthDayArr[1]);
}
corporateStatisticsDTO.setAcreage(targetModelConfig.getAcreage());
corporateStatisticsDTO.setOutputOfPlant(targetModelConfig.getOutputOfPlant());
corporateStatisticsDTO.setCalorificValue(targetModelConfig.getCalorific());
corporateStatisticsDTO.setHeatSupplied(targetModelConfig.getHeatSupplied());
CorporateStatisticsVO corporateStatisticsVO = dcBusiTargetDraftDayMapper.getCorporateStatistics(corporateStatisticsDTO);
return corporateStatisticsVO;
}
}

18
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanTargetMonthService.java

@ -9,7 +9,7 @@ import com.lzbi.common.utils.DateUtils;
import com.lzbi.special.domain.DcBaseWorkSpecial;
import com.lzbi.special.mapper.DcBaseWorkSpecialMapper;
import com.lzbi.system.service.impl.SysDeptServiceImpl;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -94,10 +94,10 @@ public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMo
if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) {
dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName());
}
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTargetDao.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTargetDao.getTargetNameAlias());
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTarget.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTarget.getTargetNameAlias());
}
dcBusiPlanTargetMonth.setCreatedTime(DateUtils.getNowDate());
@ -133,10 +133,10 @@ public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMo
if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) {
dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName());
}
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTargetDao.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTargetDao.getTargetNameAlias());
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTarget.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTarget.getTargetNameAlias());
}
dcBusiPlanTargetMonth.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiPlanTargetMonth(dcBusiPlanTargetMonth);

22
lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java

@ -11,7 +11,7 @@ import com.lzbi.common.core.domain.entity.SysDept;
import com.lzbi.special.domain.DcBaseWorkSpecial;
import com.lzbi.special.service.DcBaseWorkSpecialService;
import com.lzbi.system.service.impl.SysDeptServiceImpl;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.service.DcBaseAssetTargetService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -114,22 +114,22 @@ public class SelectOptionsControl extends BaseController {
@PostMapping("/assetTaget/list")
public AjaxResult getAssetTargetSelectList(@RequestBody AssetQueryParams assetQueryParams)
{
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTargetDao.setTargetField(assetQueryParams.getFieldCode());
dcBaseAssetTargetDao.setColumnType("T");
DcBaseAssetTarget dcBaseAssetTarget=new DcBaseAssetTarget();
dcBaseAssetTarget.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTarget.setTargetField(assetQueryParams.getFieldCode());
dcBaseAssetTarget.setColumnType("T");
//dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao));
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget));
}
@PostMapping("/assetParam/list")
public AjaxResult getAssetParamSelectList(@RequestBody AssetQueryParams assetQueryParams)
{
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTargetDao.setTargetField(assetQueryParams.getFieldCode());
dcBaseAssetTargetDao.setColumnType("P");
DcBaseAssetTarget dcBaseAssetTarget=new DcBaseAssetTarget();
dcBaseAssetTarget.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTarget.setTargetField(assetQueryParams.getFieldCode());
dcBaseAssetTarget.setColumnType("P");
//dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao));
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget));
}
//
//获取IOT参数列表

6
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java

@ -77,6 +77,10 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity
@Excel(name = "月")
private String countMonth;
/** 累计值 */
@Excel(name = "累计值")
private BigDecimal valAccumulative;
/** 和值 */
@Excel(name = "和值")
private BigDecimal valSum;
@ -229,4 +233,6 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity
@Excel(name = "31日")
private BigDecimal valP31;
private String targetModelCode;
}

10
lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java

@ -71,6 +71,14 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity
@Excel(name = "年月日【yyyy-mm-dd】")
private String countDate;
/** 年 */
@Excel(name = "年")
private String countYear;
/** 月 */
@Excel(name = "月")
private String countMonth;
/** 原值 */
@Excel(name = "原值")
private BigDecimal valOriginal;
@ -87,4 +95,6 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity
@Excel(name = "计划值")
private String valPlan;
private String targetModelCode;
}

19
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDayMapper.java

@ -2,8 +2,7 @@ package com.lzbi.draft.mapper;
import java.util.List;
import com.lzbi.bi.domain.DcBusDataScreenNewReq;
import com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO;
import com.lzbi.bi.domain.*;
import com.lzbi.draft.domain.DcBusiTargetDraftDay;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO;
@ -35,7 +34,21 @@ public interface DcBusiTargetDraftDayMapper extends BaseMapper<DcBusiTargetDraft
*/
public List<DcBusiTargetDraftDay> selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay);
List<ProvideAnswerWaterAverageTemperatureDTO> selectProvideAnswerWaterAverageTemperatureList(DcBusDataScreenNewReq dcBusDataScreenNewReq);
/**
* 获取公司统计
* @param corporateStatisticsDTO
* @return
*/
CorporateStatisticsVO getCorporateStatistics(CorporateStatisticsDTO corporateStatisticsDTO);
/**
* 获取能耗统计列表
* @param consumesStatisticsDTO
* @return
*/
List<ConsumesStatisticsVO> getConsumesStatistics(ConsumesStatisticsDTO consumesStatisticsDTO);
List<ProvideAnswerWaterAverageTemperatureDTO> selectProvideAnswerWaterAverageTemperatureList(ProvideAnswerWaterAverageTemperatureReq provideAnswerWaterAverageTemperatureReq);
/**
* 新增指标数据底稿()

1
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftMonthMapper.java

@ -4,6 +4,7 @@ import java.util.List;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* 指标数据底稿()Mapper接口

8
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDaySubService.java

@ -4,7 +4,7 @@ import java.util.List;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao;
import com.lzbi.draft.mapper.DcBusiTargetAdjustDaySubMapper;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
@ -59,9 +59,9 @@ public class DcBusiTargetAdjustDaySubService extends ServiceImpl<DcBusiTargetAdj
@Transactional(rollbackFor = Exception.class)
public int insertDcBusiTargetAdjustDaySubDao(DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao, String assetCode)
{
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiTargetAdjustDaySubDao.getTargetCode(), assetCode);
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) {
dcBusiTargetAdjustDaySubDao.setTargetName(dcBaseAssetTargetDao.getTargetName());
DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(dcBusiTargetAdjustDaySubDao.getTargetCode(), assetCode);
if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiTargetAdjustDaySubDao.setTargetName(dcBaseAssetTarget.getTargetName());
}
dcBusiTargetAdjustDaySubDao.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetAdjustDaySubDao(dcBusiTargetAdjustDaySubDao);

1
lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java

@ -65,7 +65,6 @@ public class BaseModuleEntity implements Serializable, Cloneable {
*/
@ApiModelProperty(name = "删除时间", notes = "")
private Date deleteTime;
@ApiModelProperty("分页")
private Integer pageNum;
@ApiModelProperty("分页大小")

93
lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java

@ -1,8 +1,14 @@
package com.lzbi.targetFolder.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -17,7 +23,6 @@ import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.service.DcBaseAssetTargetService;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
@ -40,10 +45,10 @@ public class DcBaseAssetTargetController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('target:target:list')")
@GetMapping("/list")
public TableDataInfo list(DcBaseAssetTargetDao dcBaseAssetTargetDao)
public TableDataInfo list(DcBaseAssetTarget dcBaseAssetTarget)
{
startPage();
List<DcBaseAssetTargetDao> list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao);
List<DcBaseAssetTarget> list = dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget);
return getDataTable(list);
}
@ -53,10 +58,10 @@ public class DcBaseAssetTargetController extends BaseController
@PreAuthorize("@ss.hasPermi('target:target:export')")
@Log(title = "资产指标配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcBaseAssetTargetDao dcBaseAssetTargetDao)
public void export(HttpServletResponse response, DcBaseAssetTarget dcBaseAssetTarget)
{
List<DcBaseAssetTargetDao> list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao);
ExcelUtil<DcBaseAssetTargetDao> util = new ExcelUtil<DcBaseAssetTargetDao>(DcBaseAssetTargetDao.class);
List<DcBaseAssetTarget> list = dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget);
ExcelUtil<DcBaseAssetTarget> util = new ExcelUtil<DcBaseAssetTarget>(DcBaseAssetTarget.class);
util.exportExcel(response, list, "资产指标配置数据");
}
@ -67,7 +72,7 @@ public class DcBaseAssetTargetController extends BaseController
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoById(id));
return success(dcBaseAssetTargetService.selectDcBaseAssetTargetById(id));
}
/**
@ -76,9 +81,9 @@ public class DcBaseAssetTargetController extends BaseController
@PreAuthorize("@ss.hasPermi('target:target:add')")
@Log(title = "资产指标配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBaseAssetTargetDao dcBaseAssetTargetDao)
public AjaxResult add(@RequestBody DcBaseAssetTarget dcBaseAssetTarget)
{
return toAjax(dcBaseAssetTargetService.insertDcBaseAssetTargetDao(dcBaseAssetTargetDao));
return toAjax(dcBaseAssetTargetService.insertDcBaseAssetTarget(dcBaseAssetTarget));
}
/**
@ -87,9 +92,9 @@ public class DcBaseAssetTargetController extends BaseController
@PreAuthorize("@ss.hasPermi('target:target:edit')")
@Log(title = "资产指标配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBaseAssetTargetDao dcBaseAssetTargetDao)
public AjaxResult edit(@RequestBody DcBaseAssetTarget dcBaseAssetTarget)
{
return toAjax(dcBaseAssetTargetService.updateDcBaseAssetTargetDao(dcBaseAssetTargetDao));
return toAjax(dcBaseAssetTargetService.updateDcBaseAssetTarget(dcBaseAssetTarget));
}
/**
@ -100,7 +105,7 @@ public class DcBaseAssetTargetController extends BaseController
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBaseAssetTargetService.deleteDcBaseAssetTargetDaoByIds(ids));
return toAjax(dcBaseAssetTargetService.deleteDcBaseAssetTargetByIds(ids));
}
@ -109,11 +114,71 @@ public class DcBaseAssetTargetController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('target:target:list')")
@GetMapping("/listNoPage")
public AjaxResult listNoPage(DcBaseAssetTargetDao dcBaseAssetTargetDao)
public AjaxResult listNoPage(DcBaseAssetTarget dcBaseAssetTarget)
{
List<DcBaseAssetTargetDao> list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao);
List<DcBaseAssetTarget> list = dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget);
return AjaxResult.success(list);
}
/**
* 新增资产信息
*/
@PreAuthorize("@ss.hasPermi('lzbi:assetInfo:add')")
@Log(title = "资产信息", businessType = BusinessType.INSERT)
@PostMapping("/addBatch")
public AjaxResult addBatch(@RequestBody JSONArray jsonArray)
{
if (jsonArray == null) {
throw new IllegalArgumentException("未能接收任何参数!");
}
List<DcBaseAssetTarget> beanList = new ArrayList<>();
try {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject beanObject = jsonArray.getJSONObject(i);
// 移除ID属性
beanObject.remove("id");
DcBaseAssetTarget dcBaseAssetTarget = JSON.toJavaObject(beanObject, DcBaseAssetTarget.class);
dcBaseAssetTarget.setCreatedTime(DateUtils.getNowDate());
dcBaseAssetTarget.setDeptId(getDeptId());
dcBaseAssetTarget.setUserId(getUserId());
dcBaseAssetTarget.setCreatedBy(String.valueOf(getUserId()));
dcBaseAssetTarget.setCreatedTime(DateUtils.getNowDate());
beanList.add(dcBaseAssetTarget);
}
} catch (Exception e) {
throw new IllegalArgumentException("解析list对象异常!");
}
return toAjax(dcBaseAssetTargetService.saveBatch(beanList));
}
/**
* 修改资产信息
*/
@PreAuthorize("@ss.hasPermi('lzbi:assetInfo:edit')")
@Log(title = "资产信息", businessType = BusinessType.UPDATE)
@PutMapping("/editBatch")
public AjaxResult editBatch(@RequestBody JSONArray jsonArray)
{
if (jsonArray == null) {
throw new IllegalArgumentException("未能接收任何参数!");
}
List<DcBaseAssetTarget> beanList = new ArrayList<>();
try {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject beanObject = jsonArray.getJSONObject(i);
DcBaseAssetTarget dcBaseAssetTarget = JSON.toJavaObject(beanObject, DcBaseAssetTarget.class);
dcBaseAssetTarget.setUpdatedBy(String.valueOf(getUserId()));
dcBaseAssetTarget.setUpdatedTime(DateUtils.getNowDate());
beanList.add(dcBaseAssetTarget);
}
} catch (Exception e) {
throw new IllegalArgumentException("解析list对象异常!");
}
return toAjax(dcBaseAssetTargetService.updateBatchById(beanList));
}
}

15
lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseTargetModelController.java

@ -197,6 +197,21 @@ public class DcBaseTargetModelController extends BaseController
}
/**
* 查询指标模版配置列表
*/
@ApiOperation("查询指标模版配置列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBaseTargetModel", value = "", dataType = "DcBaseTargetModel", dataTypeClass = DcBaseTargetModel.class),
})
@PreAuthorize("@ss.hasPermi('target:targetModel:list')")
@GetMapping("/listNoPage")
public AjaxResult listNoPage(DcBaseTargetModel DcBaseTargetModel)
{
List< DcBaseTargetModel> list = dcBaseTargetModelService.selectDcBaseTargetModelList(DcBaseTargetModel);
return AjaxResult.success(list);
}
}

58
lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java → lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTarget.java

@ -2,32 +2,29 @@ package com.lzbi.targetFolder.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import lombok.Data;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
import lombok.experimental.Accessors;
/**
* 资产指标配置对象 dc_base_asset_target
*
* @author Lu.JL
* @date 2023-11-30
* @date 2023-12-14
*/
@Data
@Accessors(chain = true)
public class DcBaseAssetTargetDao extends BaseModuleEntity
@Data
@Accessors(chain = true)
public class DcBaseAssetTarget extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
/** 主键 */
private Long id;
/** 资产ID */
@Excel(name = "资产ID")
/** 统计单元编码 */
@Excel(name = "统计单元编码")
private String assetCode;
/** 统计单元ID */
@Excel(name = "统计单元ID")
private Long assetId;
/** 指标模型编码 */
@ -38,6 +35,7 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity
@Excel(name = "指标名称")
private String targetName;
/** 指标别名 */
@Excel(name = "指标别名")
private String targetNameAlias;
@ -73,32 +71,20 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity
@Excel(name = "是否积算")
private String flagCompute;
/** 排序 */
@Excel(name = "排序")
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String sort;
/** 统计单元编码 */
@Excel(name = "统计单元编码")
private String assetCode;
//add by zhousq 2023-12-12
@ApiModelProperty("所属专业名称")
/** 所属专业名称 */
@Excel(name = "所属专业名称")
private String targetFieldName;
@ApiModelProperty("单位")
private String fieldUnit;
@ApiModelProperty("字段类型")
private String columnType;
private String value;
private String label;
public String getValue() {
return this.targetCode;
}
public String getLabel() {
return this.targetCode;
}
/** T指标P参数 */
@Excel(name = "T指标P参数")
private String columnType;
/** 单位 */
@Excel(name = "单位")
private String fieldUnit;
}

23
lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java

@ -1,7 +1,8 @@
package com.lzbi.targetFolder.mapper;
import java.util.List;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -14,7 +15,7 @@ import org.apache.ibatis.annotations.Param;
*/
@Mapper
public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao>
public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTarget>
{
/**
* 查询资产指标配置
@ -22,7 +23,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param id 资产指标配置主键
* @return 资产指标配置
*/
public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoById(Long id);
public DcBaseAssetTarget selectDcBaseAssetTargetById(Long id);
/**
* 查询资产指标配置
*
@ -30,24 +31,24 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param assetCode 统计单元编码
* @return 资产指标配置
*/
public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(@Param("targetCode") String targetCode, @Param("assetCode") String assetCode);
public DcBaseAssetTarget selectDcBaseAssetTargetByTargetCodeAndAssetCode(@Param("targetCode") String targetCode, @Param("assetCode") String assetCode);
/**
* 查询资产指标配置列表
*
* @param dcBaseAssetTargetDao 资产指标配置
* @param dcBaseAssetTarget 资产指标配置
* @return 资产指标配置集合
*/
public List<DcBaseAssetTargetDao> selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao dcBaseAssetTargetDao);
public List<DcBaseAssetTarget> selectDcBaseAssetTargetList(DcBaseAssetTarget dcBaseAssetTarget);
/**
* 新增资产指标配置
*
* @param dcBaseAssetTargetDao 资产指标配置
* @param dcBaseAssetTarget 资产指标配置
* @return 结果
*/
public int insertDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao);
public int insertDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget);
/**
* 修改资产指标配置
@ -55,7 +56,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param dcBaseAssetTarget 资产指标配置
* @return 结果
*/
public int updateDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao);
public int updateDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget);
/**
* 删除资产指标配置
@ -63,7 +64,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param id 资产指标配置主键
* @return 结果
*/
public int deleteDcBaseAssetTargetDaoById(Long id);
public int deleteDcBaseAssetTargetById(Long id);
/**
* 批量删除资产指标配置
@ -71,5 +72,5 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBaseAssetTargetDaoByIds(Long[] ids);
public int deleteDcBaseAssetTargetByIds(Long[] ids);
}

38
lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java

@ -3,9 +3,9 @@ package com.lzbi.targetFolder.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -16,7 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
* @date 2023-11-30
*/
@Service
public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMapper, DcBaseAssetTargetDao> implements IService<DcBaseAssetTargetDao>
public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMapper, DcBaseAssetTarget> implements IService<DcBaseAssetTarget>
{
@Autowired
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
@ -27,46 +27,46 @@ public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMappe
* @param id 资产指标配置主键
* @return 资产指标配置
*/
public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoById(Long id)
public DcBaseAssetTarget selectDcBaseAssetTargetById(Long id)
{
return dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoById(id);
return dcBaseAssetTargetMapper.selectDcBaseAssetTargetById(id);
}
/**
* 查询资产指标配置列表
*
* @param dcBaseAssetTargetDao 资产指标配置
* @param dcBaseAssetTarget 资产指标配置
* @return 资产指标配置
*/
public List<DcBaseAssetTargetDao> selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao dcBaseAssetTargetDao)
public List<DcBaseAssetTarget> selectDcBaseAssetTargetList(DcBaseAssetTarget dcBaseAssetTarget)
{
return dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao);
return dcBaseAssetTargetMapper.selectDcBaseAssetTargetList(dcBaseAssetTarget);
}
/**
* 新增资产指标配置
*
* @param dcBaseAssetTargetDao 资产指标配置
* @param dcBaseAssetTarget 资产指标配置
* @return 结果
*/
public int insertDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao)
public int insertDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget)
{
dcBaseAssetTargetDao.setCreatedTime(DateUtils.getNowDate());
return dcBaseAssetTargetMapper.insertDcBaseAssetTargetDao(dcBaseAssetTargetDao);
dcBaseAssetTarget.setCreatedTime(DateUtils.getNowDate());
return dcBaseAssetTargetMapper.insertDcBaseAssetTarget(dcBaseAssetTarget);
}
/**
* 修改资产指标配置
*
* @param dcBaseAssetTargetDao 资产指标配置
* @param dcBaseAssetTarget 资产指标配置
* @return 结果
*/
public int updateDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao)
public int updateDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget)
{
dcBaseAssetTargetDao.setUpdatedTime(DateUtils.getNowDate());
return dcBaseAssetTargetMapper.updateDcBaseAssetTargetDao(dcBaseAssetTargetDao);
dcBaseAssetTarget.setUpdatedTime(DateUtils.getNowDate());
return dcBaseAssetTargetMapper.updateDcBaseAssetTarget(dcBaseAssetTarget);
}
/**
@ -76,9 +76,9 @@ public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMappe
* @return 结果
*/
public int deleteDcBaseAssetTargetDaoByIds(Long[] ids)
public int deleteDcBaseAssetTargetByIds(Long[] ids)
{
return dcBaseAssetTargetMapper.deleteDcBaseAssetTargetDaoByIds(ids);
return dcBaseAssetTargetMapper.deleteDcBaseAssetTargetByIds(ids);
}
/**
@ -88,8 +88,8 @@ public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMappe
* @return 结果
*/
public int deleteDcBaseAssetTargetDaoById(Long id)
public int deleteDcBaseAssetTargetById(Long id)
{
return dcBaseAssetTargetMapper.deleteDcBaseAssetTargetDaoById(id);
return dcBaseAssetTargetMapper.deleteDcBaseAssetTargetById(id);
}
}

34
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftMonthMapper.xml

@ -19,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="targetCode" column="target_code" />
<result property="targetUint" column="target_uint" />
<result property="countDate" column="count_date" />
<result property="countYear" column="count_year" />
<result property="countMonth" column="count_month" />
<result property="valOriginal" column="val_original" />
<result property="valAdjust" column="val_adjust" />
<result property="valResult" column="val_result" />
@ -33,19 +35,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDcBusiTargetDraftMonthVo">
select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_date, val_original, val_adjust, val_result, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_target_draft_day
select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_date, count_year, count_month val_original, val_adjust, val_result, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_target_draft_month
</sql>
<select id="selectDcBusiTargetDraftMonthList" parameterType="DcBusiTargetDraftMonth" resultMap="DcBusiTargetDraftMonthResult">
<include refid="selectDcBusiTargetDraftMonthVo"/>
select t.id, t.company_name, t.company_id, t.org_id, t.org_name, t.asset_code, t.asset_name, t.field_code, t.field_name, t.target_name_alias, t.target_name, t.target_code, t.target_uint, t.count_date, t.count_year, t.count_month, t.val_original, t.val_adjust, t.val_result
from dc_busi_target_draft_month t
<if test="targetModelCode != null and targetModelCode != ''">
inner join dc_base_asset_target t1 on t.target_code = t1.target_code and t.asset_code = t1.asset_code and t1.target_model_code = #{targetModelCode}
</if>
<where>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if>
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="countDate != null and countDate != ''"> and count_date = #{countDate}</if>
<if test="companyId != null "> and t.company_id = #{companyId}</if>
<if test="orgId != null "> and t.org_id = #{orgId}</if>
<if test="assetCode != null and assetCode != ''"> and t.asset_code = #{assetCode}</if>
<if test="fieldCode != null and fieldCode != ''"> and t.field_code = #{fieldCode}</if>
<if test="targetName != null and targetName != ''"> and t.target_name like concat('%', #{targetName}, '%')</if>
<if test="targetCode != null and targetCode != ''"> and t.target_code = #{targetCode}</if>
<if test="countDate != null and countDate != ''"> and t.count_date = #{countDate}</if>
<if test="countYear != null and countYear != ''"> and t.count_year = #{countYear}</if>
<if test="countMonth != null and countMonth != ''"> and t.count_month = #{countMonth}</if>
</where>
</select>
@ -55,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_target_draft_day
insert into dc_busi_target_draft_month
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyName != null">company_name,</if>
<if test="companyId != null">company_id,</if>
@ -111,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth">
update dc_busi_target_draft_day
update dc_busi_target_draft_month
<trim prefix="SET" suffixOverrides=",">
<if test="companyName != null">company_name = #{companyName},</if>
<if test="companyId != null">company_id = #{companyId},</if>
@ -142,11 +150,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteDcBusiTargetDraftMonthById" parameterType="Long">
delete from dc_busi_target_draft_day where id = #{id}
delete from dc_busi_target_draft_month where id = #{id}
</delete>
<delete id="deleteDcBusiTargetDraftMonthByIds" parameterType="String">
delete from dc_busi_target_draft_day where id in
delete from dc_busi_target_draft_month where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

159
lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftMonthMapper.xml → lzbi-module/src/main/resources/mapper/draft/DcBusiTargetDraftDayMapper.xml

@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="countYear" column="count_year" />
<result property="countMonth" column="count_month" />
<result property="valSum" column="val_sum" />
<result property="valAccumulative" column="val_accumulative" />
<result property="valAvgAll" column="val_avg_all" />
<result property="valAvgNull" column="val_avg_null" />
<result property="valPlan" column="val_plan" />
@ -66,11 +67,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDcBusiTargetDraftDayVo">
select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_year, count_month, val_sum, val_avg_all, val_avg_null, val_plan, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, val_p1, val_p2, val_p3, val_p4, val_p5, val_p6, val_p7, val_p8, val_p9, val_p10, val_p11, val_p12, val_p13, val_p14, val_p15, val_p16, val_p17, val_p18, val_p19, val_p20, val_p21, val_p22, val_p23, val_p24, val_p25, val_p26, val_p27, val_p28, val_p29, val_p30, val_p31 from dc_busi_target_draft_day
select id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_code, field_name, target_name_alias, target_name, target_code, target_uint, count_year, count_month, val_accumulative, val_sum, val_avg_all, val_avg_null, val_plan, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, val_p1, val_p2, val_p3, val_p4, val_p5, val_p6, val_p7, val_p8, val_p9, val_p10, val_p11, val_p12, val_p13, val_p14, val_p15, val_p16, val_p17, val_p18, val_p19, val_p20, val_p21, val_p22, val_p23, val_p24, val_p25, val_p26, val_p27, val_p28, val_p29, val_p30, val_p31 from dc_busi_target_draft_day
</sql>
<select id="selectDcBusiTargetDraftDayList" parameterType="DcBusiTargetDraftDay" resultMap="DcBusiTargetDraftDayResult">
<include refid="selectDcBusiTargetDraftDayVo"/>
select t.id, t.company_name, t.company_id, t.org_id, t.org_name, t.asset_code, t.asset_name, t.field_code, t.field_name, t.target_name_alias, t.target_name, t.target_code, t.target_uint, t.count_year, t.count_month, t.val_accumulative, t.val_sum, t.val_avg_all, t.val_avg_null, t.val_plan, t.tenant_id, t.revision, t.created_by, t.created_time, t.updated_by, t.updated_time, t.delete_by, t.delete_time, t.val_p1, t.val_p2, t.val_p3, t.val_p4, t.val_p5, t.val_p6, t.val_p7, t.val_p8, t.val_p9, t.val_p10, t.val_p11, t.val_p12, t.val_p13, t.val_p14, t.val_p15, t.val_p16, t.val_p17, t.val_p18, t.val_p19, t.val_p20, t.val_p21, t.val_p22, t.val_p23, t.val_p24, t.val_p25, t.val_p26, t.val_p27, t.val_p28, t.val_p29, t.val_p30, t.val_p31
from dc_busi_target_draft_day t
<if test="targetModelCode != null and targetModelCode != ''">
inner join dc_base_asset_target t1 on t.target_code = t1.target_code and t.asset_code = t1.asset_code and t1.target_model_code = #{targetModelCode}
</if>
<where>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if>
@ -84,93 +89,130 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="getCorporateStatistics" parameterType="com.lzbi.bi.domain.CorporateStatisticsDTO" resultType="com.lzbi.bi.domain.CorporateStatisticsVO">
SELECT
(
SELECT
SUM( t1.val_accumulative )
FROM
dc_busi_target_draft_day t1
INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code
AND t1.asset_code = t2.asset_code
AND t2.target_model_code = 'MJ01'
WHERE
t1.company_id = t.company_id
) AS "acreage",
(
SELECT
SUM( t1.val_accumulative )
FROM
dc_busi_target_draft_day t1
INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code
AND t1.asset_code = t2.asset_code
AND t2.target_model_code = 'TM000FDL'
WHERE
t1.company_id = t.company_id
) AS "outputOfPlant",
(
SELECT
SUM( t1.val_accumulative )
FROM
dc_busi_target_draft_day t1
INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code
AND t1.asset_code = t2.asset_code
AND t2.target_model_code = 'TM000FRL'
WHERE
t1.company_id = t.company_id
) AS "calorificValue",
(
SELECT
SUM( t1.val_accumulative )
FROM
dc_busi_target_draft_day t1
INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code
AND t1.asset_code = t2.asset_code
AND t2.target_model_code = 'TM000GRL'
WHERE
t1.company_id = t.company_id
) AS "heatSupplied"
FROM
dc_busi_target_draft_day t
WHERE
t.company_id = #{companyId}
AND t.count_year = #{year}
AND t.count_month = #{month}
GROUP BY
t.company_id
</select>
<select id="getConsumesStatistics"
parameterType="com.lzbi.bi.domain.ConsumesStatisticsDTO"
resultType="com.lzbi.bi.domain.ConsumesStatisticsVO">
SELECT
t.org_name AS "label",
(SELECT SUM(t1.val_accumulative) FROM dc_busi_target_draft_day t1 INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code AND t1.asset_code = t2.asset_code AND t2.target_model_code = #{electricityConsumes} WHERE t1.org_id = t.org_id) as "water",
(SELECT SUM(t1.val_accumulative) FROM dc_busi_target_draft_day t1 INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code AND t1.asset_code = t2.asset_code AND t2.target_model_code = #{waterConsumes} WHERE t1.org_id = t.org_id) as "electricity",
(SELECT SUM(t1.val_accumulative) FROM dc_busi_target_draft_day t1 INNER JOIN dc_base_asset_target t2 ON t1.target_code = t2.target_code AND t1.asset_code = t2.asset_code AND t2.target_model_code = #{coalConsumes} WHERE t1.org_id = t.org_id) as "coal"
FROM
dc_busi_target_draft_day t
WHERE
t.company_id = #{companyId}
AND
t.count_year = #{year}
AND
t.count_month = #{month}
GROUP BY
t.org_id, t.org_name
</select>
<select id="selectProvideAnswerWaterAverageTemperatureList"
parameterType="com.lzbi.bi.domain.DcBusDataScreenNewReq"
parameterType="com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureReq"
resultType="com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO">
SELECT
<choose>
<when test="orgId != null">
t1.asset_name AS "title",
</when>
<otherwise>
t1.org_name AS "title",
</otherwise>
</choose>
t1.provideWaterAverageTemperature,
t2.answerWaterAverageTemperature
FROM
(
SELECT
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
<choose>
<when test="day != null and day != ''">
,AVG( t.${day} ) AS "provideWaterAverageTemperature"
</when>
<otherwise>
,AVG( t.val_avg_null ) AS "provideWaterAverageTemperature"
</otherwise>
</choose>
FROM
`dc_busi_target_draft_day` t
INNER JOIN
dc_base_asset_target t1
on t.target_code = t1.target_code
and t.asset_code = t1.asset_code
and t1.target_model_code = #{provideWaterAverageTemperature}
WHERE
t.target_code = 'TM00039'
AND t.count_year = #{year}
t.count_year = #{year}
AND t.count_month = #{month}
AND t.company_id = #{companyId}
GROUP BY
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
) t1
LEFT JOIN (
SELECT
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
<choose>
<when test="day != null and day != ''">
,AVG( t.${day} ) AS "answerWaterAverageTemperature"
</when>
<otherwise>
,AVG( t.val_avg_null ) AS "answerWaterAverageTemperature"
</otherwise>
</choose>
FROM
`dc_busi_target_draft_day` t
INNER JOIN
dc_base_asset_target t1
on t.target_code = t1.target_code
and t.asset_code = t1.asset_code
and t1.target_model_code = #{answerWaterAverageTemperature}
WHERE
t.target_code = 'TM00040'
AND t.count_year = #{year}
t.count_year = #{year}
AND t.count_month = #{month}
AND t.company_id = #{companyId}
GROUP BY
t.company_id,
t.company_name,
t.org_id,
t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
) t2 ON t1.company_id = t2.company_id
AND t1.org_id = t2.org_id
<if test="orgId != null">
AND t1.asset_code = t2.asset_code
</if>
) t2 ON t1.org_id = t2.org_id
</select>
<select id="selectDcBusiTargetDraftDayById" parameterType="Long" resultMap="DcBusiTargetDraftDayResult">
@ -230,6 +272,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="targetUint != null">target_uint,</if>
<if test="countYear != null">count_year,</if>
<if test="countMonth != null">count_month,</if>
<if test="valAccumulative != null">val_accumulative,</if>
<if test="valSum != null">val_sum,</if>
<if test="valAvgAll != null">val_avg_all,</if>
<if test="valAvgNull != null">val_avg_null,</if>
@ -289,6 +332,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="targetUint != null">#{targetUint},</if>
<if test="countYear != null">#{countYear},</if>
<if test="countMonth != null">#{countMonth},</if>
<if test="valAccumulative != null">#{valAccumulative},</if>
<if test="valSum != null">#{valSum},</if>
<if test="valAvgAll != null">#{valAvgAll},</if>
<if test="valAvgNull != null">#{valAvgNull},</if>
@ -352,6 +396,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="targetUint != null">target_uint = #{targetUint},</if>
<if test="countYear != null">count_year = #{countYear},</if>
<if test="countMonth != null">count_month = #{countMonth},</if>
<if test="valAccumulative != null">val_accumulative = #{valAccumulative},</if>
<if test="valSum != null">val_sum = #{valSum},</if>
<if test="valAvgAll != null">val_avg_all = #{valAvgAll},</if>
<if test="valAvgNull != null">val_avg_null = #{valAvgNull},</if>

47
lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

@ -4,12 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper">
<resultMap type="com.lzbi.targetFolder.domain.DcBaseAssetTargetDao" id="DcBaseAssetTargetResult">
<resultMap type="com.lzbi.targetFolder.domain.DcBaseAssetTarget" id="DcBaseAssetTargetResult">
<result property="id" column="id" />
<result property="assetId" column="asset_id" />
<result property="assetCode" column="asset_code" />
<result property="assetId" column="asset_id" />
<result property="targetModelCode" column="target_model_code" />
<result property="targetName" column="target_name" />
<result property="targetNameAlias" column="target_name_alias" />
<result property="targetCode" column="target_code" />
<result property="targetField" column="target_field" />
<result property="limitUp" column="limit_up" />
@ -18,7 +19,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="flagAvg" column="flag_avg" />
<result property="flagSum" column="flag_sum" />
<result property="flagCompute" column="flag_compute" />
<result property="sort" column="sort" />
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
@ -27,19 +27,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="sort" column="sort" />
<result property="targetFieldName" column="target_field_name" />
<result property="fieldUnit" column="field_unit" />
<result property="columnType" column="column_type" />
<result property="fieldUnit" column="field_unit" />
</resultMap>
<sql id="selectDcBaseAssetTargetVo">
select id, asset_id,asset_code, target_model_code, target_name, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, sort, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time,target_field_name
value_type,
field_unit
from dc_base_asset_target
select id, asset_code, asset_id, target_model_code, target_name, target_name_alias, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, sort, target_field_name, column_type, field_unit from dc_base_asset_target
</sql>
<select id="selectDcBaseAssetTargetDaoList" parameterType="DcBaseAssetTargetDao" resultMap="DcBaseAssetTargetResult">
<select id="selectDcBaseAssetTargetList" parameterType="DcBaseAssetTarget" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/>
<where>
<if test="assetId != null "> and asset_id = #{assetId}</if>
@ -53,17 +51,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectDcBaseAssetTargetDaoById" parameterType="Long" resultMap="DcBaseAssetTargetResult">
<select id="selectDcBaseAssetTargetById" parameterType="Long" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/>
where id = #{id}
</select>
<insert id="insertDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao" useGeneratedKeys="true" keyProperty="id">
<insert id="insertDcBaseAssetTarget" parameterType="DcBaseAssetTarget" useGeneratedKeys="true" keyProperty="id">
insert into dc_base_asset_target
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="assetCode != null">asset_code,</if>
<if test="assetId != null">asset_id,</if>
<if test="targetModelCode != null">target_model_code,</if>
<if test="targetName != null">target_name,</if>
<if test="targetNameAlias != null">target_name_alias,</if>
<if test="targetCode != null">target_code,</if>
<if test="targetField != null">target_field,</if>
<if test="limitUp != null">limit_up,</if>
@ -72,7 +72,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="flagAvg != null">flag_avg,</if>
<if test="flagSum != null">flag_sum,</if>
<if test="flagCompute != null">flag_compute,</if>
<if test="sort != null">sort,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
@ -81,11 +80,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="sort != null">sort,</if>
<if test="targetFieldName != null">target_field_name,</if>
<if test="columnType != null">column_type,</if>
<if test="fieldUnit != null">field_unit,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="assetCode != null">#{assetCode},</if>
<if test="assetId != null">#{assetId},</if>
<if test="targetModelCode != null">#{targetModelCode},</if>
<if test="targetName != null">#{targetName},</if>
<if test="targetNameAlias != null">#{targetNameAlias},</if>
<if test="targetCode != null">#{targetCode},</if>
<if test="targetField != null">#{targetField},</if>
<if test="limitUp != null">#{limitUp},</if>
@ -94,7 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="flagAvg != null">#{flagAvg},</if>
<if test="flagSum != null">#{flagSum},</if>
<if test="flagCompute != null">#{flagCompute},</if>
<if test="sort != null">#{sort},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
@ -103,15 +107,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="sort != null">#{sort},</if>
<if test="targetFieldName != null">#{targetFieldName},</if>
<if test="columnType != null">#{columnType},</if>
<if test="fieldUnit != null">#{fieldUnit},</if>
</trim>
</insert>
<update id="updateDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao">
<update id="updateDcBaseAssetTarget" parameterType="DcBaseAssetTarget">
update dc_base_asset_target
<trim prefix="SET" suffixOverrides=",">
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetId != null">asset_id = #{assetId},</if>
<if test="targetModelCode != null">target_model_code = #{targetModelCode},</if>
<if test="targetName != null">target_name = #{targetName},</if>
<if test="targetNameAlias != null">target_name_alias = #{targetNameAlias},</if>
<if test="targetCode != null">target_code = #{targetCode},</if>
<if test="targetField != null">target_field = #{targetField},</if>
<if test="limitUp != null">limit_up = #{limitUp},</if>
@ -120,7 +130,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="flagAvg != null">flag_avg = #{flagAvg},</if>
<if test="flagSum != null">flag_sum = #{flagSum},</if>
<if test="flagCompute != null">flag_compute = #{flagCompute},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
@ -129,15 +138,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="targetFieldName != null">target_field_name = #{targetFieldName},</if>
<if test="columnType != null">column_type = #{columnType},</if>
<if test="fieldUnit != null">field_unit = #{fieldUnit},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBaseAssetTargetDaoById" parameterType="Long">
<delete id="deleteDcBaseAssetTargetById" parameterType="Long">
delete from dc_base_asset_target where id = #{id}
</delete>
<delete id="deleteDcBaseAssetTargetDaoByIds" parameterType="String">
<delete id="deleteDcBaseAssetTargetByIds" parameterType="String">
delete from dc_base_asset_target where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}

Loading…
Cancel
Save