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 org.springframework: warn
# 指标模板 # 指标模板
target-model: 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 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 * @date 2023-11-27
*/ */
@Data @Data
//@TableName("dc_base_work_special")
@Accessors(chain = true) @Accessors(chain = true)
public class DcBaseAssetInfo extends BaseModuleEntity { public class DcBaseAssetInfo extends BaseModuleEntity {
private static final long serialVersionUID = 1L; 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; package com.lzbi.bi.domain;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
@ -11,7 +13,17 @@ import java.util.List;
@Data @Data
public class HeatSuppliedVO { public class HeatSuppliedVO {
private List<String> labelArr; private List<Label> labelArr;
private List<BigDecimal> valueArr; 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.config.TargetModelConfig;
import com.lzbi.common.utils.bean.BeanUtils; import com.lzbi.common.utils.bean.BeanUtils;
import com.lzbi.draft.domain.DcBusiTargetDraftDay; import com.lzbi.draft.domain.DcBusiTargetDraftDay;
import com.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper; import com.lzbi.draft.mapper.DcBusiTargetDraftDayMapper;
import com.lzbi.draft.mapper.DcBusiTargetDraftMonthMapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -15,6 +17,7 @@ import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -31,19 +34,20 @@ public class DcBusiDataScreenNewService {
@Resource @Resource
private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper; private DcBusiTargetDraftDayMapper dcBusiTargetDraftDayMapper;
@Resource
private DcBusiTargetDraftMonthMapper dcBusiTargetDraftMonthMapper;
public List<UserIOverViewVO> getUserOverview(DcBusDataScreenNewReq dcBusDataScreenNewReq) { public List<UserIOverViewVO> getUserOverview(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<UserIOverViewVO> list = new ArrayList<>(); 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(); DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq); BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-"); String[] yearMonthDayArr = yearMonthDay.split("-");
if (yearMonthDayArr.length > 1) {
params.setCountYear(yearMonthDayArr[0]); params.setCountYear(yearMonthDayArr[0]);
params.setCountMonth(yearMonthDayArr[1]); params.setCountMonth(yearMonthDayArr[1]);
params.setTargetCode(targetModelConfig.getUser()); }
params.setTargetModelCode(targetModelConfig.getUser());
List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params); List<DcBusiTargetDraftDay> dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(params);
if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) { if (CollectionUtils.isNotEmpty(dcBusiTargetDraftDayList)) {
Map<Object, List<DcBusiTargetDraftDay>> map; Map<Object, List<DcBusiTargetDraftDay>> map;
@ -52,7 +56,6 @@ public class DcBusiDataScreenNewService {
} else { } else {
map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode)); map = dcBusiTargetDraftDayList.stream().collect(Collectors.groupingBy(DcBusiTargetDraftDay::getAssetCode));
} }
Class<DcBusiTargetDraftDay> dcBusiTargetDraftMonthClass = DcBusiTargetDraftDay.class;
map.forEach((key, value) -> { map.forEach((key, value) -> {
UserIOverViewVO userIOverViewVO = new UserIOverViewVO(); UserIOverViewVO userIOverViewVO = new UserIOverViewVO();
if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) { if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
@ -76,11 +79,17 @@ public class DcBusiDataScreenNewService {
public ProvideAnswerWaterAverageTemperatureVO getProvideAnswerWaterAverageTemperature(DcBusDataScreenNewReq dcBusDataScreenNewReq) { public ProvideAnswerWaterAverageTemperatureVO getProvideAnswerWaterAverageTemperature(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
ProvideAnswerWaterAverageTemperatureVO provideAnswerWaterAverageTemperatureVO = new ProvideAnswerWaterAverageTemperatureVO(); ProvideAnswerWaterAverageTemperatureVO provideAnswerWaterAverageTemperatureVO = new ProvideAnswerWaterAverageTemperatureVO();
ProvideAnswerWaterAverageTemperatureReq params = new ProvideAnswerWaterAverageTemperatureReq();
params.setCompanyId(dcBusDataScreenNewReq.getCompanyId());
String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay(); String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
String[] yearMonthDayArr = yearMonthDay.split("-"); String[] yearMonthDayArr = yearMonthDay.split("-");
dcBusDataScreenNewReq.setYear(yearMonthDayArr[0]); if (yearMonthDayArr.length > 1) {
dcBusDataScreenNewReq.setMonth(yearMonthDayArr[1]); params.setYear(yearMonthDayArr[0]);
List<ProvideAnswerWaterAverageTemperatureDTO> provideAnswerWaterAverageTemperatureDTOS = dcBusiTargetDraftDayMapper.selectProvideAnswerWaterAverageTemperatureList(dcBusDataScreenNewReq); params.setMonth(yearMonthDayArr[1]);
}
params.setProvideWaterAverageTemperature(targetModelConfig.getProvideWaterAverageTemperature());
params.setAnswerWaterAverageTemperature(targetModelConfig.getAnswerWaterAverageTemperature());
List<ProvideAnswerWaterAverageTemperatureDTO> provideAnswerWaterAverageTemperatureDTOS = dcBusiTargetDraftDayMapper.selectProvideAnswerWaterAverageTemperatureList(params);
if (CollectionUtils.isNotEmpty(provideAnswerWaterAverageTemperatureDTOS)) { if (CollectionUtils.isNotEmpty(provideAnswerWaterAverageTemperatureDTOS)) {
List<String> xArr = new ArrayList<>(); List<String> xArr = new ArrayList<>();
List<BigDecimal> yArr1 = new ArrayList<>(); List<BigDecimal> yArr1 = new ArrayList<>();
@ -99,56 +108,169 @@ public class DcBusiDataScreenNewService {
public List<BoilerStatisticsVO> getBoilerStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { public List<BoilerStatisticsVO> getBoilerStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<BoilerStatisticsVO> list = new ArrayList<>(); List<BoilerStatisticsVO> list = new ArrayList<>();
list.add(new BoilerStatisticsVO("热源1", BigDecimal.valueOf(248776))); // list.add(new BoilerStatisticsVO("热源1", BigDecimal.valueOf(248776)));
list.add(new BoilerStatisticsVO("热源2", BigDecimal.valueOf(248776))); // list.add(new BoilerStatisticsVO("热源2", BigDecimal.valueOf(248776)));
list.add(new BoilerStatisticsVO("热源3", 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; return list;
} }
public List<ConsumesStatisticsVO> getConsumesStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { public List<ConsumesStatisticsVO> getConsumesStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<ConsumesStatisticsVO> list = new ArrayList<>(); ConsumesStatisticsDTO consumesStatisticsDTO = new ConsumesStatisticsDTO();
list.add(new ConsumesStatisticsVO("热源1", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); consumesStatisticsDTO.setCompanyId(dcBusDataScreenNewReq.getCompanyId());
list.add(new ConsumesStatisticsVO("热源2", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
list.add(new ConsumesStatisticsVO("热源3", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); String[] yearMonthDayArr = yearMonthDay.split("-");
list.add(new ConsumesStatisticsVO("热源4", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); if (yearMonthDayArr.length > 1) {
list.add(new ConsumesStatisticsVO("热源5", BigDecimal.valueOf(458.14), BigDecimal.valueOf(1.25), BigDecimal.valueOf(37.57) )); consumesStatisticsDTO.setYear(yearMonthDayArr[0]);
return list; 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) { public List<CalorificValueVO> getCalorificValue(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
List<CalorificValueVO> list = new ArrayList<>(); List<CalorificValueVO> list = new ArrayList<>();
list.add(new CalorificValueVO("热源1", BigDecimal.valueOf(7897), 17)); DcBusiTargetDraftDay params = new DcBusiTargetDraftDay();
list.add(new CalorificValueVO("热源2", BigDecimal.valueOf(9766), 21)); BeanUtils.copyBeanProp(params, dcBusDataScreenNewReq);
list.add(new CalorificValueVO("热源3", BigDecimal.valueOf(5571), 12)); String yearMonthDay = dcBusDataScreenNewReq.getYearMonthDay();
list.add(new CalorificValueVO("热源4", BigDecimal.valueOf(7897), 17)); String[] yearMonthDayArr = yearMonthDay.split("-");
list.add(new CalorificValueVO("热源5", BigDecimal.valueOf(9766), 21)); if (yearMonthDayArr.length > 1) {
list.add(new CalorificValueVO("热源6", BigDecimal.valueOf(5571), 12)); 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; return list;
} }
public HeatSuppliedVO getHeatSupplied(DcBusDataScreenNewReq dcBusDataScreenNewReq) { public HeatSuppliedVO getHeatSupplied(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
HeatSuppliedVO heatSuppliedVO = new HeatSuppliedVO(); 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<>(); List<BigDecimal> valueArr = new ArrayList<>();
labelArr.add("热源1"); final BigDecimal[] max = {new BigDecimal(0)};
labelArr.add("热源2"); map.forEach((key, value) -> {
labelArr.add("热源3"); HeatSuppliedVO.Label label = new HeatSuppliedVO.Label();
labelArr.add("热源4"); if (ObjectUtils.isEmpty(dcBusDataScreenNewReq.getOrgId())) {
labelArr.add("热源5"); label.setName(value.get(0).getOrgName());
labelArr.add("热源6"); } else {
valueArr.add(BigDecimal.valueOf(300)); label.setName(value.get(0).getAssetName());
valueArr.add(BigDecimal.valueOf(500)); }
valueArr.add(BigDecimal.valueOf(300)); BigDecimal sum = new BigDecimal(0);
valueArr.add(BigDecimal.valueOf(100)); for (int i = 0, len = value.size(); i < len; i++) {
valueArr.add(BigDecimal.valueOf(500)); sum = sum.add(value.get(i).getValAccumulative());
valueArr.add(BigDecimal.valueOf(100)); }
heatSuppliedVO.setLabelArr(labelArr); 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); heatSuppliedVO.setValueArr(valueArr);
}
return heatSuppliedVO; return heatSuppliedVO;
} }
public CorporateStatisticsVO getCorporateStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) { public CorporateStatisticsVO getCorporateStatistics(DcBusDataScreenNewReq dcBusDataScreenNewReq) {
CorporateStatisticsVO corporateStatisticsVO = new CorporateStatisticsVO(); CorporateStatisticsDTO corporateStatisticsDTO = new CorporateStatisticsDTO();
return new CorporateStatisticsVO(BigDecimal.valueOf(3820), BigDecimal.valueOf(3820), BigDecimal.valueOf(3820), BigDecimal.valueOf(3820)); 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.domain.DcBaseWorkSpecial;
import com.lzbi.special.mapper.DcBaseWorkSpecialMapper; import com.lzbi.special.mapper.DcBaseWorkSpecialMapper;
import com.lzbi.system.service.impl.SysDeptServiceImpl; 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 com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -94,10 +94,10 @@ public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMo
if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) { if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) {
dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName()); dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName());
} }
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode()); DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) { if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTargetDao.getTargetName()); dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTarget.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTargetDao.getTargetNameAlias()); dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTarget.getTargetNameAlias());
} }
dcBusiPlanTargetMonth.setCreatedTime(DateUtils.getNowDate()); dcBusiPlanTargetMonth.setCreatedTime(DateUtils.getNowDate());
@ -133,10 +133,10 @@ public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMo
if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) { if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) {
dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName()); dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName());
} }
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode()); DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) { if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTargetDao.getTargetName()); dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTarget.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTargetDao.getTargetNameAlias()); dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTarget.getTargetNameAlias());
} }
dcBusiPlanTargetMonth.setUpdatedTime(DateUtils.getNowDate()); dcBusiPlanTargetMonth.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiPlanTargetMonth(dcBusiPlanTargetMonth); 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.domain.DcBaseWorkSpecial;
import com.lzbi.special.service.DcBaseWorkSpecialService; import com.lzbi.special.service.DcBaseWorkSpecialService;
import com.lzbi.system.service.impl.SysDeptServiceImpl; 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 com.lzbi.targetFolder.service.DcBaseAssetTargetService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -114,22 +114,22 @@ public class SelectOptionsControl extends BaseController {
@PostMapping("/assetTaget/list") @PostMapping("/assetTaget/list")
public AjaxResult getAssetTargetSelectList(@RequestBody AssetQueryParams assetQueryParams) public AjaxResult getAssetTargetSelectList(@RequestBody AssetQueryParams assetQueryParams)
{ {
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao(); DcBaseAssetTarget dcBaseAssetTarget=new DcBaseAssetTarget();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode()); dcBaseAssetTarget.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTargetDao.setTargetField(assetQueryParams.getFieldCode()); dcBaseAssetTarget.setTargetField(assetQueryParams.getFieldCode());
dcBaseAssetTargetDao.setColumnType("T"); dcBaseAssetTarget.setColumnType("T");
//dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao)); return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget));
} }
@PostMapping("/assetParam/list") @PostMapping("/assetParam/list")
public AjaxResult getAssetParamSelectList(@RequestBody AssetQueryParams assetQueryParams) public AjaxResult getAssetParamSelectList(@RequestBody AssetQueryParams assetQueryParams)
{ {
DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao(); DcBaseAssetTarget dcBaseAssetTarget=new DcBaseAssetTarget();
dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode()); dcBaseAssetTarget.setAssetCode(assetQueryParams.getAssetCode());
dcBaseAssetTargetDao.setTargetField(assetQueryParams.getFieldCode()); dcBaseAssetTarget.setTargetField(assetQueryParams.getFieldCode());
dcBaseAssetTargetDao.setColumnType("P"); dcBaseAssetTarget.setColumnType("P");
//dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId());
return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao)); return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget));
} }
// //
//获取IOT参数列表 //获取IOT参数列表

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

@ -77,6 +77,10 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity
@Excel(name = "月") @Excel(name = "月")
private String countMonth; private String countMonth;
/** 累计值 */
@Excel(name = "累计值")
private BigDecimal valAccumulative;
/** 和值 */ /** 和值 */
@Excel(name = "和值") @Excel(name = "和值")
private BigDecimal valSum; private BigDecimal valSum;
@ -229,4 +233,6 @@ public class DcBusiTargetDraftDay extends BaseModuleEntity
@Excel(name = "31日") @Excel(name = "31日")
private BigDecimal valP31; 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】") @Excel(name = "年月日【yyyy-mm-dd】")
private String countDate; private String countDate;
/** 年 */
@Excel(name = "年")
private String countYear;
/** 月 */
@Excel(name = "月")
private String countMonth;
/** 原值 */ /** 原值 */
@Excel(name = "原值") @Excel(name = "原值")
private BigDecimal valOriginal; private BigDecimal valOriginal;
@ -87,4 +95,6 @@ public class DcBusiTargetDraftMonth extends BaseModuleEntity
@Excel(name = "计划值") @Excel(name = "计划值")
private String valPlan; 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 java.util.List;
import com.lzbi.bi.domain.DcBusDataScreenNewReq; import com.lzbi.bi.domain.*;
import com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO;
import com.lzbi.draft.domain.DcBusiTargetDraftDay; import com.lzbi.draft.domain.DcBusiTargetDraftDay;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO; import com.lzbi.draft.entity.dto.TargetDraftMonthReportValueDTO;
@ -35,7 +34,21 @@ public interface DcBusiTargetDraftDayMapper extends BaseMapper<DcBusiTargetDraft
*/ */
public List<DcBusiTargetDraftDay> selectDcBusiTargetDraftDayList(DcBusiTargetDraftDay dcBusiTargetDraftDay); 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.lzbi.draft.domain.DcBusiTargetDraftMonth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 指标数据底稿()Mapper接口 * 指标数据底稿()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.common.utils.DateUtils;
import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao; import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao;
import com.lzbi.draft.mapper.DcBusiTargetAdjustDaySubMapper; 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 com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -59,9 +59,9 @@ public class DcBusiTargetAdjustDaySubService extends ServiceImpl<DcBusiTargetAdj
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int insertDcBusiTargetAdjustDaySubDao(DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao, String assetCode) public int insertDcBusiTargetAdjustDaySubDao(DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao, String assetCode)
{ {
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiTargetAdjustDaySubDao.getTargetCode(), assetCode); DcBaseAssetTarget dcBaseAssetTarget = dcBaseAssetTargetMapper.selectDcBaseAssetTargetByTargetCodeAndAssetCode(dcBusiTargetAdjustDaySubDao.getTargetCode(), assetCode);
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) { if (ObjectUtils.isNotEmpty(dcBaseAssetTarget)) {
dcBusiTargetAdjustDaySubDao.setTargetName(dcBaseAssetTargetDao.getTargetName()); dcBusiTargetAdjustDaySubDao.setTargetName(dcBaseAssetTarget.getTargetName());
} }
dcBusiTargetAdjustDaySubDao.setCreatedTime(DateUtils.getNowDate()); dcBusiTargetAdjustDaySubDao.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetAdjustDaySubDao(dcBusiTargetAdjustDaySubDao); 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 = "") @ApiModelProperty(name = "删除时间", notes = "")
private Date deleteTime; private Date deleteTime;
@ApiModelProperty("分页") @ApiModelProperty("分页")
private Integer pageNum; private Integer pageNum;
@ApiModelProperty("分页大小") @ApiModelProperty("分页大小")

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

@ -1,8 +1,14 @@
package com.lzbi.targetFolder.controller; package com.lzbi.targetFolder.controller;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; 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.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; 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.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult; import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType; import com.lzbi.common.enums.BusinessType;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.service.DcBaseAssetTargetService; import com.lzbi.targetFolder.service.DcBaseAssetTargetService;
import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo; import com.lzbi.common.core.page.TableDataInfo;
@ -40,10 +45,10 @@ public class DcBaseAssetTargetController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('target:target:list')") @PreAuthorize("@ss.hasPermi('target:target:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(DcBaseAssetTargetDao dcBaseAssetTargetDao) public TableDataInfo list(DcBaseAssetTarget dcBaseAssetTarget)
{ {
startPage(); startPage();
List<DcBaseAssetTargetDao> list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao); List<DcBaseAssetTarget> list = dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget);
return getDataTable(list); return getDataTable(list);
} }
@ -53,10 +58,10 @@ public class DcBaseAssetTargetController extends BaseController
@PreAuthorize("@ss.hasPermi('target:target:export')") @PreAuthorize("@ss.hasPermi('target:target:export')")
@Log(title = "资产指标配置", businessType = BusinessType.EXPORT) @Log(title = "资产指标配置", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, DcBaseAssetTargetDao dcBaseAssetTargetDao) public void export(HttpServletResponse response, DcBaseAssetTarget dcBaseAssetTarget)
{ {
List<DcBaseAssetTargetDao> list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao); List<DcBaseAssetTarget> list = dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget);
ExcelUtil<DcBaseAssetTargetDao> util = new ExcelUtil<DcBaseAssetTargetDao>(DcBaseAssetTargetDao.class); ExcelUtil<DcBaseAssetTarget> util = new ExcelUtil<DcBaseAssetTarget>(DcBaseAssetTarget.class);
util.exportExcel(response, list, "资产指标配置数据"); util.exportExcel(response, list, "资产指标配置数据");
} }
@ -67,7 +72,7 @@ public class DcBaseAssetTargetController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long 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')") @PreAuthorize("@ss.hasPermi('target:target:add')")
@Log(title = "资产指标配置", businessType = BusinessType.INSERT) @Log(title = "资产指标配置", businessType = BusinessType.INSERT)
@PostMapping @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')") @PreAuthorize("@ss.hasPermi('target:target:edit')")
@Log(title = "资产指标配置", businessType = BusinessType.UPDATE) @Log(title = "资产指标配置", businessType = BusinessType.UPDATE)
@PutMapping @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}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] 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')") @PreAuthorize("@ss.hasPermi('target:target:list')")
@GetMapping("/listNoPage") @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); 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.math.BigDecimal;
import java.util.Date; import java.util.Date;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import com.lzbi.common.annotation.Excel; import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity; import com.lzbi.module.base.BaseModuleEntity;
import lombok.experimental.Accessors;
/** /**
* 资产指标配置对象 dc_base_asset_target * 资产指标配置对象 dc_base_asset_target
* *
* @author Lu.JL * @author Lu.JL
* @date 2023-11-30 * @date 2023-12-14
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class DcBaseAssetTargetDao extends BaseModuleEntity public class DcBaseAssetTarget extends BaseModuleEntity
{ {
private static final long serialVersionUID = 1L; 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; private Long assetId;
/** 指标模型编码 */ /** 指标模型编码 */
@ -38,6 +35,7 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity
@Excel(name = "指标名称") @Excel(name = "指标名称")
private String targetName; private String targetName;
/** 指标别名 */
@Excel(name = "指标别名") @Excel(name = "指标别名")
private String targetNameAlias; private String targetNameAlias;
@ -73,32 +71,20 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity
@Excel(name = "是否积算") @Excel(name = "是否积算")
private String flagCompute; private String flagCompute;
/** 排序 */ /** $column.columnComment */
@Excel(name = "排序") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String sort; private String sort;
/** 统计单元编码 */ /** 所属专业名称 */
@Excel(name = "统计单元编码") @Excel(name = "所属专业名称")
private String assetCode;
//add by zhousq 2023-12-12
@ApiModelProperty("所属专业名称")
private String targetFieldName; private String targetFieldName;
@ApiModelProperty("单位")
private String fieldUnit;
@ApiModelProperty("字段类型")
private String columnType;
private String value;
private String label;
public String getValue() { /** T指标P参数 */
return this.targetCode; @Excel(name = "T指标P参数")
} private String columnType;
public String getLabel() {
return this.targetCode;
}
/** 单位 */
@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; package com.lzbi.targetFolder.mapper;
import java.util.List; import java.util.List;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -14,7 +15,7 @@ import org.apache.ibatis.annotations.Param;
*/ */
@Mapper @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 资产指标配置主键 * @param id 资产指标配置主键
* @return 资产指标配置 * @return 资产指标配置
*/ */
public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoById(Long id); public DcBaseAssetTarget selectDcBaseAssetTargetById(Long id);
/** /**
* 查询资产指标配置 * 查询资产指标配置
* *
@ -30,24 +31,24 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param assetCode 统计单元编码 * @param assetCode 统计单元编码
* @return 资产指标配置 * @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 资产指标配置集合 * @return 资产指标配置集合
*/ */
public List<DcBaseAssetTargetDao> selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao dcBaseAssetTargetDao); public List<DcBaseAssetTarget> selectDcBaseAssetTargetList(DcBaseAssetTarget dcBaseAssetTarget);
/** /**
* 新增资产指标配置 * 新增资产指标配置
* *
* @param dcBaseAssetTargetDao 资产指标配置 * @param dcBaseAssetTarget 资产指标配置
* @return 结果 * @return 结果
*/ */
public int insertDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao); public int insertDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget);
/** /**
* 修改资产指标配置 * 修改资产指标配置
@ -55,7 +56,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param dcBaseAssetTarget 资产指标配置 * @param dcBaseAssetTarget 资产指标配置
* @return 结果 * @return 结果
*/ */
public int updateDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao); public int updateDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget);
/** /**
* 删除资产指标配置 * 删除资产指标配置
@ -63,7 +64,7 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param id 资产指标配置主键 * @param id 资产指标配置主键
* @return 结果 * @return 结果
*/ */
public int deleteDcBaseAssetTargetDaoById(Long id); public int deleteDcBaseAssetTargetById(Long id);
/** /**
* 批量删除资产指标配置 * 批量删除资产指标配置
@ -71,5 +72,5 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @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 java.util.List;
import com.lzbi.common.utils.DateUtils; import com.lzbi.common.utils.DateUtils;
import com.lzbi.targetFolder.domain.DcBaseAssetTarget;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper; import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -16,7 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
* @date 2023-11-30 * @date 2023-11-30
*/ */
@Service @Service
public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMapper, DcBaseAssetTargetDao> implements IService<DcBaseAssetTargetDao> public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMapper, DcBaseAssetTarget> implements IService<DcBaseAssetTarget>
{ {
@Autowired @Autowired
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper; private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
@ -27,46 +27,46 @@ public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMappe
* @param id 资产指标配置主键 * @param id 资产指标配置主键
* @return 资产指标配置 * @return 资产指标配置
*/ */
public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoById(Long id) public DcBaseAssetTarget selectDcBaseAssetTargetById(Long id)
{ {
return dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoById(id); return dcBaseAssetTargetMapper.selectDcBaseAssetTargetById(id);
} }
/** /**
* 查询资产指标配置列表 * 查询资产指标配置列表
* *
* @param dcBaseAssetTargetDao 资产指标配置 * @param dcBaseAssetTarget 资产指标配置
* @return 资产指标配置 * @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 结果 * @return 结果
*/ */
public int insertDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao) public int insertDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget)
{ {
dcBaseAssetTargetDao.setCreatedTime(DateUtils.getNowDate()); dcBaseAssetTarget.setCreatedTime(DateUtils.getNowDate());
return dcBaseAssetTargetMapper.insertDcBaseAssetTargetDao(dcBaseAssetTargetDao); return dcBaseAssetTargetMapper.insertDcBaseAssetTarget(dcBaseAssetTarget);
} }
/** /**
* 修改资产指标配置 * 修改资产指标配置
* *
* @param dcBaseAssetTargetDao 资产指标配置 * @param dcBaseAssetTarget 资产指标配置
* @return 结果 * @return 结果
*/ */
public int updateDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao) public int updateDcBaseAssetTarget(DcBaseAssetTarget dcBaseAssetTarget)
{ {
dcBaseAssetTargetDao.setUpdatedTime(DateUtils.getNowDate()); dcBaseAssetTarget.setUpdatedTime(DateUtils.getNowDate());
return dcBaseAssetTargetMapper.updateDcBaseAssetTargetDao(dcBaseAssetTargetDao); return dcBaseAssetTargetMapper.updateDcBaseAssetTarget(dcBaseAssetTarget);
} }
/** /**
@ -76,9 +76,9 @@ public class DcBaseAssetTargetService extends ServiceImpl<DcBaseAssetTargetMappe
* @return 结果 * @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 结果 * @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="targetCode" column="target_code" />
<result property="targetUint" column="target_uint" /> <result property="targetUint" column="target_uint" />
<result property="countDate" column="count_date" /> <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="valOriginal" column="val_original" />
<result property="valAdjust" column="val_adjust" /> <result property="valAdjust" column="val_adjust" />
<result property="valResult" column="val_result" /> <result property="valResult" column="val_result" />
@ -33,19 +35,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDcBusiTargetDraftMonthVo"> <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> </sql>
<select id="selectDcBusiTargetDraftMonthList" parameterType="DcBusiTargetDraftMonth" resultMap="DcBusiTargetDraftMonthResult"> <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> <where>
<if test="companyId != null "> and company_id = #{companyId}</if> <if test="companyId != null "> and t.company_id = #{companyId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if> <if test="orgId != null "> and t.org_id = #{orgId}</if>
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if> <if test="assetCode != null and assetCode != ''"> and t.asset_code = #{assetCode}</if>
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if> <if test="fieldCode != null and fieldCode != ''"> and t.field_code = #{fieldCode}</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if> <if test="targetName != null and targetName != ''"> and t.target_name like concat('%', #{targetName}, '%')</if>
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if> <if test="targetCode != null and targetCode != ''"> and t.target_code = #{targetCode}</if>
<if test="countDate != null and countDate != ''"> and count_date = #{countDate}</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> </where>
</select> </select>
@ -55,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<insert id="insertDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth" useGeneratedKeys="true" keyProperty="id"> <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=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyName != null">company_name,</if> <if test="companyName != null">company_name,</if>
<if test="companyId != null">company_id,</if> <if test="companyId != null">company_id,</if>
@ -111,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert> </insert>
<update id="updateDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth"> <update id="updateDcBusiTargetDraftMonth" parameterType="DcBusiTargetDraftMonth">
update dc_busi_target_draft_day update dc_busi_target_draft_month
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="companyName != null">company_name = #{companyName},</if> <if test="companyName != null">company_name = #{companyName},</if>
<if test="companyId != null">company_id = #{companyId},</if> <if test="companyId != null">company_id = #{companyId},</if>
@ -142,11 +150,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteDcBusiTargetDraftMonthById" parameterType="Long"> <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>
<delete id="deleteDcBusiTargetDraftMonthByIds" parameterType="String"> <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=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </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="countYear" column="count_year" />
<result property="countMonth" column="count_month" /> <result property="countMonth" column="count_month" />
<result property="valSum" column="val_sum" /> <result property="valSum" column="val_sum" />
<result property="valAccumulative" column="val_accumulative" />
<result property="valAvgAll" column="val_avg_all" /> <result property="valAvgAll" column="val_avg_all" />
<result property="valAvgNull" column="val_avg_null" /> <result property="valAvgNull" column="val_avg_null" />
<result property="valPlan" column="val_plan" /> <result property="valPlan" column="val_plan" />
@ -66,11 +67,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDcBusiTargetDraftDayVo"> <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> </sql>
<select id="selectDcBusiTargetDraftDayList" parameterType="DcBusiTargetDraftDay" resultMap="DcBusiTargetDraftDayResult"> <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> <where>
<if test="companyId != null "> and company_id = #{companyId}</if> <if test="companyId != null "> and company_id = #{companyId}</if>
<if test="orgId != null "> and org_id = #{orgId}</if> <if test="orgId != null "> and org_id = #{orgId}</if>
@ -84,93 +89,130 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </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" <select id="selectProvideAnswerWaterAverageTemperatureList"
parameterType="com.lzbi.bi.domain.DcBusDataScreenNewReq" parameterType="com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureReq"
resultType="com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO"> resultType="com.lzbi.bi.domain.ProvideAnswerWaterAverageTemperatureDTO">
SELECT SELECT
<choose>
<when test="orgId != null">
t1.asset_name AS "title",
</when>
<otherwise>
t1.org_name AS "title", t1.org_name AS "title",
</otherwise>
</choose>
t1.provideWaterAverageTemperature, t1.provideWaterAverageTemperature,
t2.answerWaterAverageTemperature t2.answerWaterAverageTemperature
FROM FROM
( (
SELECT SELECT
t.company_id,
t.company_name,
t.org_id, t.org_id,
t.org_name 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" ,AVG( t.val_avg_null ) AS "provideWaterAverageTemperature"
</otherwise>
</choose>
FROM FROM
`dc_busi_target_draft_day` t `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 WHERE
t.target_code = 'TM00039' t.count_year = #{year}
AND t.count_year = #{year}
AND t.count_month = #{month} AND t.count_month = #{month}
AND t.company_id = #{companyId}
GROUP BY GROUP BY
t.company_id,
t.company_name,
t.org_id, t.org_id,
t.org_name t.org_name
<if test="orgId != null">
,t.asset_code
,t.asset_name
</if>
) t1 ) t1
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
t.company_id,
t.company_name,
t.org_id, t.org_id,
t.org_name 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" ,AVG( t.val_avg_null ) AS "answerWaterAverageTemperature"
</otherwise>
</choose>
FROM FROM
`dc_busi_target_draft_day` t `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 WHERE
t.target_code = 'TM00040' t.count_year = #{year}
AND t.count_year = #{year}
AND t.count_month = #{month} AND t.count_month = #{month}
AND t.company_id = #{companyId}
GROUP BY GROUP BY
t.company_id,
t.company_name,
t.org_id, t.org_id,
t.org_name t.org_name
<if test="orgId != null"> ) t2 ON t1.org_id = t2.org_id
,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>
</select> </select>
<select id="selectDcBusiTargetDraftDayById" parameterType="Long" resultMap="DcBusiTargetDraftDayResult"> <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="targetUint != null">target_uint,</if>
<if test="countYear != null">count_year,</if> <if test="countYear != null">count_year,</if>
<if test="countMonth != null">count_month,</if> <if test="countMonth != null">count_month,</if>
<if test="valAccumulative != null">val_accumulative,</if>
<if test="valSum != null">val_sum,</if> <if test="valSum != null">val_sum,</if>
<if test="valAvgAll != null">val_avg_all,</if> <if test="valAvgAll != null">val_avg_all,</if>
<if test="valAvgNull != null">val_avg_null,</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="targetUint != null">#{targetUint},</if>
<if test="countYear != null">#{countYear},</if> <if test="countYear != null">#{countYear},</if>
<if test="countMonth != null">#{countMonth},</if> <if test="countMonth != null">#{countMonth},</if>
<if test="valAccumulative != null">#{valAccumulative},</if>
<if test="valSum != null">#{valSum},</if> <if test="valSum != null">#{valSum},</if>
<if test="valAvgAll != null">#{valAvgAll},</if> <if test="valAvgAll != null">#{valAvgAll},</if>
<if test="valAvgNull != null">#{valAvgNull},</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="targetUint != null">target_uint = #{targetUint},</if>
<if test="countYear != null">count_year = #{countYear},</if> <if test="countYear != null">count_year = #{countYear},</if>
<if test="countMonth != null">count_month = #{countMonth},</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="valSum != null">val_sum = #{valSum},</if>
<if test="valAvgAll != null">val_avg_all = #{valAvgAll},</if> <if test="valAvgAll != null">val_avg_all = #{valAvgAll},</if>
<if test="valAvgNull != null">val_avg_null = #{valAvgNull},</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"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper"> <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="id" column="id" />
<result property="assetId" column="asset_id" />
<result property="assetCode" column="asset_code" /> <result property="assetCode" column="asset_code" />
<result property="assetId" column="asset_id" />
<result property="targetModelCode" column="target_model_code" /> <result property="targetModelCode" column="target_model_code" />
<result property="targetName" column="target_name" /> <result property="targetName" column="target_name" />
<result property="targetNameAlias" column="target_name_alias" />
<result property="targetCode" column="target_code" /> <result property="targetCode" column="target_code" />
<result property="targetField" column="target_field" /> <result property="targetField" column="target_field" />
<result property="limitUp" column="limit_up" /> <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="flagAvg" column="flag_avg" />
<result property="flagSum" column="flag_sum" /> <result property="flagSum" column="flag_sum" />
<result property="flagCompute" column="flag_compute" /> <result property="flagCompute" column="flag_compute" />
<result property="sort" column="sort" />
<result property="tenantId" column="tenant_id" /> <result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" /> <result property="revision" column="revision" />
<result property="createdBy" column="created_by" /> <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="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" /> <result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" /> <result property="deleteTime" column="delete_time" />
<result property="sort" column="sort" />
<result property="targetFieldName" column="target_field_name" /> <result property="targetFieldName" column="target_field_name" />
<result property="fieldUnit" column="field_unit" />
<result property="columnType" column="column_type" /> <result property="columnType" column="column_type" />
<result property="fieldUnit" column="field_unit" />
</resultMap> </resultMap>
<sql id="selectDcBaseAssetTargetVo"> <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 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
value_type,
field_unit
from dc_base_asset_target
</sql> </sql>
<select id="selectDcBaseAssetTargetDaoList" parameterType="DcBaseAssetTargetDao" resultMap="DcBaseAssetTargetResult"> <select id="selectDcBaseAssetTargetList" parameterType="DcBaseAssetTarget" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/> <include refid="selectDcBaseAssetTargetVo"/>
<where> <where>
<if test="assetId != null "> and asset_id = #{assetId}</if> <if test="assetId != null "> and asset_id = #{assetId}</if>
@ -53,17 +51,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectDcBaseAssetTargetDaoById" parameterType="Long" resultMap="DcBaseAssetTargetResult"> <select id="selectDcBaseAssetTargetById" parameterType="Long" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/> <include refid="selectDcBaseAssetTargetVo"/>
where id = #{id} where id = #{id}
</select> </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 insert into dc_base_asset_target
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="assetCode != null">asset_code,</if>
<if test="assetId != null">asset_id,</if> <if test="assetId != null">asset_id,</if>
<if test="targetModelCode != null">target_model_code,</if> <if test="targetModelCode != null">target_model_code,</if>
<if test="targetName != null">target_name,</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="targetCode != null">target_code,</if>
<if test="targetField != null">target_field,</if> <if test="targetField != null">target_field,</if>
<if test="limitUp != null">limit_up,</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="flagAvg != null">flag_avg,</if>
<if test="flagSum != null">flag_sum,</if> <if test="flagSum != null">flag_sum,</if>
<if test="flagCompute != null">flag_compute,</if> <if test="flagCompute != null">flag_compute,</if>
<if test="sort != null">sort,</if>
<if test="tenantId != null">tenant_id,</if> <if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if> <if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</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="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if> <if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</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>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="assetCode != null">#{assetCode},</if>
<if test="assetId != null">#{assetId},</if> <if test="assetId != null">#{assetId},</if>
<if test="targetModelCode != null">#{targetModelCode},</if> <if test="targetModelCode != null">#{targetModelCode},</if>
<if test="targetName != null">#{targetName},</if> <if test="targetName != null">#{targetName},</if>
<if test="targetNameAlias != null">#{targetNameAlias},</if>
<if test="targetCode != null">#{targetCode},</if> <if test="targetCode != null">#{targetCode},</if>
<if test="targetField != null">#{targetField},</if> <if test="targetField != null">#{targetField},</if>
<if test="limitUp != null">#{limitUp},</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="flagAvg != null">#{flagAvg},</if>
<if test="flagSum != null">#{flagSum},</if> <if test="flagSum != null">#{flagSum},</if>
<if test="flagCompute != null">#{flagCompute},</if> <if test="flagCompute != null">#{flagCompute},</if>
<if test="sort != null">#{sort},</if>
<if test="tenantId != null">#{tenantId},</if> <if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if> <if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</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="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if> <if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</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> </trim>
</insert> </insert>
<update id="updateDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao"> <update id="updateDcBaseAssetTarget" parameterType="DcBaseAssetTarget">
update dc_base_asset_target update dc_base_asset_target
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="assetCode != null">asset_code = #{assetCode},</if>
<if test="assetId != null">asset_id = #{assetId},</if> <if test="assetId != null">asset_id = #{assetId},</if>
<if test="targetModelCode != null">target_model_code = #{targetModelCode},</if> <if test="targetModelCode != null">target_model_code = #{targetModelCode},</if>
<if test="targetName != null">target_name = #{targetName},</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="targetCode != null">target_code = #{targetCode},</if>
<if test="targetField != null">target_field = #{targetField},</if> <if test="targetField != null">target_field = #{targetField},</if>
<if test="limitUp != null">limit_up = #{limitUp},</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="flagAvg != null">flag_avg = #{flagAvg},</if>
<if test="flagSum != null">flag_sum = #{flagSum},</if> <if test="flagSum != null">flag_sum = #{flagSum},</if>
<if test="flagCompute != null">flag_compute = #{flagCompute},</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="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if> <if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</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="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if> <if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</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> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteDcBaseAssetTargetDaoById" parameterType="Long"> <delete id="deleteDcBaseAssetTargetById" parameterType="Long">
delete from dc_base_asset_target where id = #{id} delete from dc_base_asset_target where id = #{id}
</delete> </delete>
<delete id="deleteDcBaseAssetTargetDaoByIds" parameterType="String"> <delete id="deleteDcBaseAssetTargetByIds" parameterType="String">
delete from dc_base_asset_target where id in delete from dc_base_asset_target where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}

Loading…
Cancel
Save