Преглед изворни кода

业绩对标管理功能开发

hlf пре 8 месеци
родитељ
комит
d59918a440
14 измењених фајлова са 451 додато и 337 уклоњено
  1. 6 62
      ims-service/ims-eval/src/main/java/com/ims/eval/controller/PerformanceBenchmarkingManageController.java
  2. 22 0
      ims-service/ims-eval/src/main/java/com/ims/eval/dao/BenchmarkingRecordMapper.java
  3. 3 1
      ims-service/ims-eval/src/main/java/com/ims/eval/dao/OrganizationEvaluationInfoMapper.java
  4. 9 0
      ims-service/ims-eval/src/main/java/com/ims/eval/dao/PerformanceBenchmarkInfoMapper.java
  5. 48 0
      ims-service/ims-eval/src/main/java/com/ims/eval/entity/BenchmarkingRecord.java
  6. 17 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IBenchmarkingRecordService.java
  7. 1 1
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IOrganizationEvaluationInfoService.java
  8. 1 8
      ims-service/ims-eval/src/main/java/com/ims/eval/service/IPerformanceBenchmarkInfoService.java
  9. 24 0
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/BenchmarkingRecordServiceImpl.java
  10. 2 2
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java
  11. 154 190
      ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/PerformanceBenchmarkInfoServiceImpl.java
  12. 47 0
      ims-service/ims-eval/src/main/resources/mappers/BenchmarkingRecordMapper.xml
  13. 93 73
      ims-service/ims-eval/src/main/resources/mappers/OrganizationEvaluationInfoMapper.xml
  14. 24 0
      ims-service/ims-eval/src/main/resources/mappers/PerformanceBenchmarkInfoMapper.xml

+ 6 - 62
ims-service/ims-eval/src/main/java/com/ims/eval/controller/PerformanceBenchmarkingManageController.java

@@ -33,6 +33,8 @@ public class PerformanceBenchmarkingManageController {
 	 * @param toolCategory   工具类别(寻标、立标、标杆、达标、超标)
 	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
 	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
+	 * @param degreeYear     年度
+	 * @param quarterlyMonth 季/月度
 	 * @return 结果
 	 */
 	@GetMapping(value = "/list")
@@ -41,72 +43,14 @@ public class PerformanceBenchmarkingManageController {
 		@RequestParam(value = "pageSize") Integer pageSize,
 		@RequestParam(value = "toolCategory") String toolCategory,
 		@RequestParam(value = "manageCategory") String manageCategory,
-		@RequestParam(value = "checkCycle") String checkCycle) {
-		IPage<PerformanceBenchmarkInfo> list = performanceBenchmarkInfoService.listPage(pageNum, pageSize, toolCategory, manageCategory, checkCycle);
+		@RequestParam(value = "checkCycle") String checkCycle,
+		@RequestParam(value = "degreeYear") Integer degreeYear,
+		@RequestParam(value = "quarterlyMonth", required = false) Integer quarterlyMonth) {
+		IPage<PerformanceBenchmarkInfo> list = performanceBenchmarkInfoService.listPage(pageNum, pageSize, toolCategory, manageCategory, checkCycle, degreeYear, quarterlyMonth);
 		return R.ok().data(list);
 	}
 
 	/**
-	 * 立标
-	 *
-	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
-	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
-	 * @return 结果
-	 */
-	@PostMapping(value = "/lb")
-	public R lb(
-		@RequestParam(value = "manageCategory") String manageCategory,
-		@RequestParam(value = "checkCycle") String checkCycle) {
-		performanceBenchmarkInfoService.setRecommendedValue(manageCategory, checkCycle);
-		return R.ok();
-	}
-
-	/**
-	 * 标杆
-	 *
-	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
-	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
-	 * @return 结果
-	 */
-	@PostMapping(value = "/bg")
-	public R bg(
-		@RequestParam(value = "manageCategory") String manageCategory,
-		@RequestParam(value = "checkCycle") String checkCycle) {
-		performanceBenchmarkInfoService.bg(manageCategory, checkCycle);
-		return R.ok();
-	}
-
-	/**
-	 * 达标
-	 *
-	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
-	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
-	 * @return 结果
-	 */
-	@PostMapping(value = "/db")
-	public R db(
-		@RequestParam(value = "manageCategory") String manageCategory,
-		@RequestParam(value = "checkCycle") String checkCycle) {
-		performanceBenchmarkInfoService.db(manageCategory, checkCycle);
-		return R.ok();
-	}
-
-	/**
-	 * 超标
-	 *
-	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
-	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
-	 * @return 结果
-	 */
-	@PostMapping(value = "/cb")
-	public R cb(
-		@RequestParam(value = "manageCategory") String manageCategory,
-		@RequestParam(value = "checkCycle") String checkCycle) {
-		performanceBenchmarkInfoService.cb(manageCategory, checkCycle);
-		return R.ok();
-	}
-
-	/**
 	 * 修改业绩对标管理信息
 	 *
 	 * @param performanceBenchmarkInfo 业绩对标管理实体

+ 22 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/BenchmarkingRecordMapper.java

@@ -0,0 +1,22 @@
+package com.ims.eval.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ims.eval.entity.BenchmarkingRecord;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2024/4/10 10:08
+ * 文件说明:
+ */
+public interface BenchmarkingRecordMapper extends BaseMapper<BenchmarkingRecord> {
+
+	List<BenchmarkingRecord> selectList(@Param("manageCategory") String manageCategory,
+										@Param("checkCycle") String checkCycle,
+										@Param("degreeYear") Integer degreeYear,
+										@Param("quarterlyMonth") Integer quarterlyMonth,
+										@Param("tagType") String tagType);
+
+}

+ 3 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/dao/OrganizationEvaluationInfoMapper.java

@@ -73,7 +73,9 @@ public interface OrganizationEvaluationInfoMapper extends BaseMapper<Organizatio
 											@Param("deptId") String deptId,
 											@Param("state") List<String> state);
 
-    List<OrganizationEvaluationInfo> getOrganizationEvaluationInfoListByIndicatorDictionaryId(@Param("indicatorDictionaryId") String indicatorDictionaryId);
+    List<OrganizationEvaluationInfo> getOrganizationEvaluationInfoListByIndicatorDictionaryId(@Param("indicatorDictionaryId") String indicatorDictionaryId,
+																							  @Param("degreeYear") String degreeYear,
+																							  @Param("quarterlyMonth") String quarterlyMonth);
 
 
 //	void updateEvaluationInfo(@Param("evaluationInfos")  List<OrganizationEvaluationInfo> evaluationInfos);

+ 9 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/PerformanceBenchmarkInfoMapper.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ims.eval.entity.PerformanceBenchmarkInfo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @author hlf
  * @date 2024/3/28 14:08
@@ -16,8 +18,15 @@ public interface PerformanceBenchmarkInfoMapper extends BaseMapper<PerformanceBe
 	IPage<PerformanceBenchmarkInfo> selectListPage(Page<PerformanceBenchmarkInfo> page,
 												   @Param("manageCategory") String manageCategory,
 												   @Param("checkCycle") String checkCycle,
+												   @Param("degreeYear") Integer degreeYear,
+												   @Param("quarterlyMonth") Integer quarterlyMonth,
 												   @Param("isBg") Integer isBg,
 												   @Param("isDb") Integer isDb,
 												   @Param("isCb") Integer isCb);
 
+	List<PerformanceBenchmarkInfo> selectList(@Param("manageCategory") String manageCategory,
+											  @Param("checkCycle") String checkCycle,
+											  @Param("degreeYear") Integer degreeYear,
+											  @Param("quarterlyMonth") Integer quarterlyMonth);
+
 }

+ 48 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/BenchmarkingRecord.java

@@ -0,0 +1,48 @@
+package com.ims.eval.entity;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author hlf
+ * @date 2024/4/10 10:06
+ * 文件说明:对标记录表
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class BenchmarkingRecord extends Model {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	private String id;
+
+	/**
+	 * 周期
+	 */
+	private String checkCycle;
+
+	/**
+	 * 年度
+	 */
+	private Integer degreeYear;
+
+	/**
+	 * 季/月度
+	 */
+	private Integer quarterlyMonth;
+
+	/**
+	 * 经营类别(火电、水电、风电、光伏、煤电、海外、综合)
+	 */
+	private String manageCategory;
+
+	/**
+	 * 标签类别
+	 */
+	private String tagType;
+
+}

+ 17 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IBenchmarkingRecordService.java

@@ -0,0 +1,17 @@
+package com.ims.eval.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ims.eval.entity.BenchmarkingRecord;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2024/4/10 10:07
+ * 文件说明:
+ */
+public interface IBenchmarkingRecordService extends IService<BenchmarkingRecord> {
+
+	List<BenchmarkingRecord> selectList(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth, String tagType);
+
+}

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IOrganizationEvaluationInfoService.java

@@ -71,5 +71,5 @@ public interface IOrganizationEvaluationInfoService extends IService<Organizatio
 
 	List<OrganizationEvaluationInfo> getConvergeCommonInfo(String organizationEvaluationId, String organizationId, String indicatorId);
 
-	List<OrganizationEvaluationInfo> getOrganizationEvaluationInfoListByIndicatorDictionaryId(String indicatorDictionaryId);
+	List<OrganizationEvaluationInfo> getOrganizationEvaluationInfoListByIndicatorDictionaryId(String indicatorDictionaryId, String degreeYear, String quarterlyMonth);
 }

+ 1 - 8
ims-service/ims-eval/src/main/java/com/ims/eval/service/IPerformanceBenchmarkInfoService.java

@@ -11,13 +11,6 @@ import com.ims.eval.entity.PerformanceBenchmarkInfo;
  */
 public interface IPerformanceBenchmarkInfoService extends IService<PerformanceBenchmarkInfo> {
 
-	IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, String toolCategory, String manageCategory, String checkCycle);
+	IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, String toolCategory, String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth);
 
-	void setRecommendedValue(String manageCategory, String checkCycle);
-
-	void bg(String manageCategory, String checkCycle);
-
-	void db(String manageCategory, String checkCycle);
-
-	void cb(String manageCategory, String checkCycle);
 }

+ 24 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/BenchmarkingRecordServiceImpl.java

@@ -0,0 +1,24 @@
+package com.ims.eval.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ims.eval.dao.BenchmarkingRecordMapper;
+import com.ims.eval.entity.BenchmarkingRecord;
+import com.ims.eval.service.IBenchmarkingRecordService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2024/4/10 10:08
+ * 文件说明:
+ */
+@Service
+public class BenchmarkingRecordServiceImpl extends ServiceImpl<BenchmarkingRecordMapper, BenchmarkingRecord> implements IBenchmarkingRecordService {
+
+	@Override
+	public List<BenchmarkingRecord> selectList(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth, String tagType) {
+		return baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, tagType);
+	}
+
+}

+ 2 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationEvaluationInfoServiceImpl.java

@@ -1295,8 +1295,8 @@ public class OrganizationEvaluationInfoServiceImpl extends ServiceImpl<Organizat
 	}
 
 	@Override
-	public List<OrganizationEvaluationInfo> getOrganizationEvaluationInfoListByIndicatorDictionaryId(String indicatorDictionaryId) {
-		return baseMapper.getOrganizationEvaluationInfoListByIndicatorDictionaryId(indicatorDictionaryId);
+	public List<OrganizationEvaluationInfo> getOrganizationEvaluationInfoListByIndicatorDictionaryId(String indicatorDictionaryId, String degreeYear, String quarterlyMonth) {
+		return baseMapper.getOrganizationEvaluationInfoListByIndicatorDictionaryId(indicatorDictionaryId, degreeYear, quarterlyMonth);
 	}
 
 	/**

+ 154 - 190
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/PerformanceBenchmarkInfoServiceImpl.java

@@ -2,11 +2,9 @@ package com.ims.eval.service.impl;
 
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.IdUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ims.common.utils.StringUtils;
 import com.ims.eval.dao.PerformanceBenchmarkInfoMapper;
 import com.ims.eval.entity.*;
 import com.ims.eval.service.*;
@@ -16,8 +14,6 @@ import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * @author hlf
@@ -28,6 +24,9 @@ import java.util.stream.Collectors;
 public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<PerformanceBenchmarkInfoMapper, PerformanceBenchmarkInfo> implements IPerformanceBenchmarkInfoService {
 
 	@Resource
+	private IBenchmarkingRecordService benchmarkingRecordService;
+
+	@Resource
 	private IEvaluateRuleService evaluateRuleService;
 
 	@Resource
@@ -40,68 +39,79 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
 	private IOrganizationEvaluationInfoService organizationEvaluationInfoService;
 
 	@Override
-	public IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, String toolCategory, String manageCategory, String checkCycle) {
+	public IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, String toolCategory, String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
 		if (null == pageNum || null == pageSize) {
 			throw new RuntimeException("分页参数为空");
 		}
-		//构造分页构造器
-		Page<PerformanceBenchmarkInfo> page = new Page<>(pageNum, pageSize);
 		int isBg = 0;
 		int isDb = 0;
 		int isCb = 0;
 		if ("寻标".equals(toolCategory)) {
-			xb(checkCycle, manageCategory);
+			xb(manageCategory, checkCycle, degreeYear, quarterlyMonth);
+		} else if ("立标".equals(toolCategory)) {
+			lb(manageCategory, checkCycle, degreeYear, quarterlyMonth);
 		} else if ("标杆".equals(toolCategory)) {
+			bg(manageCategory, checkCycle, degreeYear, quarterlyMonth);
 			isBg = 1;
 		} else if ("达标".equals(toolCategory)) {
+			db(manageCategory, checkCycle, degreeYear, quarterlyMonth);
 			isDb = 2;
 		} else if ("超标".equals(toolCategory)) {
+			cb(manageCategory, checkCycle, degreeYear, quarterlyMonth);
 			isCb = 3;
 		}
-		return baseMapper.selectListPage(page, manageCategory, checkCycle, isBg, isDb, isCb);
+		//构造分页构造器
+		Page<PerformanceBenchmarkInfo> page = new Page<>(pageNum, pageSize);
+		return baseMapper.selectListPage(page, manageCategory, checkCycle, degreeYear, quarterlyMonth, isBg, isDb, isCb);
 	}
 
 	/**
 	 * 寻标
+	 *
+	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
+	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
+	 * @param degreeYear     年度
+	 * @param quarterlyMonth 季/月度
 	 */
-	private void xb(String checkCycle, String manageCategory) {
-		List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = new ArrayList<>();
-		EvaluateRule evaluateRule = evaluateRuleService.getEvaluateRuleListByYear("", checkCycle, manageCategory);
-		if (null != evaluateRule) {
-			List<EvaluateRuleInfo> evaluateRuleInfoList = evaluateRuleInfoService.getEvaluateRuleInfoByEvaluateRuleId(evaluateRule.getId());
-			for (EvaluateRuleInfo evaluateRuleInfo : evaluateRuleInfoList) {
-				List<IndicatorDictionary> indicatorDictionaryList = indicatorDictionaryService.getIndicatorDictionaryList(evaluateRuleInfo.getIndicatorId());
-				if (indicatorDictionaryList.size() > 0) {
-					//计划值
-					IndicatorDictionary jhz = indicatorDictionaryList.stream().filter(p -> !p.getOptionCode().equals("WCZ")).findFirst().orElse(null);
-					//实际完成值
-					IndicatorDictionary wcz = indicatorDictionaryList.stream().filter(p -> p.getOptionCode().equals("WCZ")).findFirst().orElse(null);
-					if (jhz != null && wcz != null) {
-						List<OrganizationEvaluationInfo> jhzList = organizationEvaluationInfoService.getOrganizationEvaluationInfoListByIndicatorDictionaryId(jhz.getId());
-						List<OrganizationEvaluationInfo> wczList = organizationEvaluationInfoService.getOrganizationEvaluationInfoListByIndicatorDictionaryId(wcz.getId());
-						if (jhzList.size() == wczList.size()) {
-							for (int i = 0; i < wczList.size(); i++) {
-								OrganizationEvaluationInfo jhzObj = jhzList.get(i);
-								OrganizationEvaluationInfo wczObj = wczList.get(i);
-								PerformanceBenchmarkInfo performanceBenchmarkInfo = new PerformanceBenchmarkInfo();
-								performanceBenchmarkInfo.setId(Convert.toStr(IdUtil.getSnowflake(1, 1).nextId()));
-								performanceBenchmarkInfo.setCheckCycle(wczObj.getCheckCycle());
-								performanceBenchmarkInfo.setDegreeYear(Integer.valueOf(wczObj.getDegreeYear()));
-								if (!"NDKP".equals(checkCycle)) {
-									performanceBenchmarkInfo.setQuarterlyMonth(Integer.valueOf(wczObj.getQuarterlyMonth()));
-								}
-								performanceBenchmarkInfo.setManageCategory(manageCategory);
-								performanceBenchmarkInfo.setCompanyId(wczObj.getOrganizationId());
-								performanceBenchmarkInfo.setCompanyName(wczObj.getCompanyName());
-								performanceBenchmarkInfo.setCompanyShort(wczObj.getCompanyShort());
-								performanceBenchmarkInfo.setInstallCapacity(wczObj.getInstallCapacity());
-								performanceBenchmarkInfo.setIndexName(evaluateRuleInfo.getIndicatorName());
-								performanceBenchmarkInfo.setPlannedValue(jhzObj.getQuantifiedValue());
-								performanceBenchmarkInfo.setCompleteValue(wczObj.getQuantifiedValue());
-								performanceBenchmarkInfo.setIsBg(0);
-								performanceBenchmarkInfo.setIsDb(0);
-								performanceBenchmarkInfo.setIsCb(0);
-								if (uniquenessCheck(performanceBenchmarkInfo)) {
+	private void xb(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
+		List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "寻标");
+		if (benchmarkingRecordList.size() == 0) {
+			List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = new ArrayList<>();
+			EvaluateRule evaluateRule = evaluateRuleService.getEvaluateRuleListByYear(String.valueOf(degreeYear), checkCycle, manageCategory);
+			if (null != evaluateRule) {
+				List<EvaluateRuleInfo> evaluateRuleInfoList = evaluateRuleInfoService.getEvaluateRuleInfoByEvaluateRuleId(evaluateRule.getId());
+				for (EvaluateRuleInfo evaluateRuleInfo : evaluateRuleInfoList) {
+					List<IndicatorDictionary> indicatorDictionaryList = indicatorDictionaryService.getIndicatorDictionaryList(evaluateRuleInfo.getIndicatorId());
+					if (indicatorDictionaryList.size() > 0) {
+						//计划值
+						IndicatorDictionary jhz = indicatorDictionaryList.stream().filter(p -> !p.getOptionCode().equals("WCZ")).findFirst().orElse(null);
+						//实际完成值
+						IndicatorDictionary wcz = indicatorDictionaryList.stream().filter(p -> p.getOptionCode().equals("WCZ")).findFirst().orElse(null);
+						if (jhz != null && wcz != null) {
+							List<OrganizationEvaluationInfo> jhzList = organizationEvaluationInfoService.getOrganizationEvaluationInfoListByIndicatorDictionaryId(jhz.getId(), String.valueOf(degreeYear), String.valueOf(quarterlyMonth));
+							List<OrganizationEvaluationInfo> wczList = organizationEvaluationInfoService.getOrganizationEvaluationInfoListByIndicatorDictionaryId(wcz.getId(), String.valueOf(degreeYear), String.valueOf(quarterlyMonth));
+							if (jhzList.size() == wczList.size()) {
+								for (int i = 0; i < wczList.size(); i++) {
+									OrganizationEvaluationInfo jhzObj = jhzList.get(i);
+									OrganizationEvaluationInfo wczObj = wczList.get(i);
+									PerformanceBenchmarkInfo performanceBenchmarkInfo = new PerformanceBenchmarkInfo();
+									performanceBenchmarkInfo.setId(Convert.toStr(IdUtil.getSnowflake(1, 1).nextId()));
+									performanceBenchmarkInfo.setCheckCycle(wczObj.getCheckCycle());
+									performanceBenchmarkInfo.setDegreeYear(degreeYear);
+									if (!"NDKP".equals(checkCycle)) {
+										performanceBenchmarkInfo.setQuarterlyMonth(quarterlyMonth);
+									}
+									performanceBenchmarkInfo.setManageCategory(manageCategory);
+									performanceBenchmarkInfo.setCompanyId(wczObj.getOrganizationId());
+									performanceBenchmarkInfo.setCompanyName(wczObj.getCompanyName());
+									performanceBenchmarkInfo.setCompanyShort(wczObj.getCompanyShort());
+									performanceBenchmarkInfo.setInstallCapacity(wczObj.getInstallCapacity());
+									performanceBenchmarkInfo.setIndexName(evaluateRuleInfo.getIndicatorName());
+									performanceBenchmarkInfo.setPlannedValue(jhzObj.getQuantifiedValue());
+									performanceBenchmarkInfo.setCompleteValue(wczObj.getQuantifiedValue());
+									performanceBenchmarkInfo.setIsBg(0);
+									performanceBenchmarkInfo.setIsDb(0);
+									performanceBenchmarkInfo.setIsCb(0);
 									performanceBenchmarkInfoList.add(performanceBenchmarkInfo);
 								}
 							}
@@ -109,140 +119,110 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
 					}
 				}
 			}
+			super.saveBatch(performanceBenchmarkInfoList);
+			addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "寻标");
 		}
-		super.saveBatch(performanceBenchmarkInfoList);
 	}
 
-	@Override
-	public void setRecommendedValue(String manageCategory, String checkCycle) {
-		QueryWrapper<PerformanceBenchmarkInfo> qw = new QueryWrapper<>();
-		if (StringUtils.isNotEmpty(manageCategory)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getManageCategory, manageCategory);
-		}
-		if (StringUtils.isNotEmpty(checkCycle)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getCheckCycle, checkCycle);
-		}
-		if ("NDKP".equals(checkCycle)) {
-			Map<Integer, Map<String, List<PerformanceBenchmarkInfo>>> grouped = baseMapper.selectList(qw).stream()
-				.collect(Collectors.groupingBy(
-					PerformanceBenchmarkInfo::getDegreeYear,
-					Collectors.groupingBy(
-						PerformanceBenchmarkInfo::getIndexName
-					)
-				));
-			List<PerformanceBenchmarkInfo> updateList = new ArrayList<>();
-			grouped.forEach((degreeYear, indexNameMap) -> {
-				indexNameMap.forEach((indexName, performanceBenchmarkInfoList) -> {
-					double completeValueSum = performanceBenchmarkInfoList.stream().mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
-					double installCapacitySum = performanceBenchmarkInfoList.stream().mapToDouble(PerformanceBenchmarkInfo::getInstallCapacity).sum();
-					performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
-						PerformanceBenchmarkInfo.setRecommendedValue(yearIndexRecommendedValueA(completeValueSum, installCapacitySum, PerformanceBenchmarkInfo.getInstallCapacity()));
-						updateList.add(PerformanceBenchmarkInfo);
-					});
+	/**
+	 * 立标
+	 *
+	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
+	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
+	 * @param degreeYear     年度
+	 * @param quarterlyMonth 季/月度
+	 */
+	private void lb(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
+		List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "立标");
+		if (benchmarkingRecordList.size() == 0) {
+			if ("NDKP".equals(checkCycle)) {
+				List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, null);
+				double completeValueSum = performanceBenchmarkInfoList.stream().mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
+				double installCapacitySum = performanceBenchmarkInfoList.stream().mapToDouble(PerformanceBenchmarkInfo::getInstallCapacity).sum();
+				List<PerformanceBenchmarkInfo> updateList = new ArrayList<>();
+				performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
+					PerformanceBenchmarkInfo.setRecommendedValue(yearIndexRecommendedValueA(completeValueSum, installCapacitySum, PerformanceBenchmarkInfo.getInstallCapacity()));
+					updateList.add(PerformanceBenchmarkInfo);
 				});
-			});
-			super.updateBatchById(updateList);
-		} else if ("JDKP".equals(checkCycle) || "YDKP".equals(checkCycle)) {
-			Map<Integer, Map<Integer, Map<String, List<PerformanceBenchmarkInfo>>>> grouped = baseMapper.selectList(qw).stream()
-				.collect(Collectors.groupingBy(
-					PerformanceBenchmarkInfo::getDegreeYear,
-					Collectors.groupingBy(
-						PerformanceBenchmarkInfo::getQuarterlyMonth,
-						Collectors.groupingBy(
-							PerformanceBenchmarkInfo::getIndexName,
-							Collectors.toList()
-						)
-					)
-				));
-			List<PerformanceBenchmarkInfo> updateList = new ArrayList<>();
-			grouped.forEach((degreeYear, quarterlyMonthMap) -> {
-				quarterlyMonthMap.forEach((quarterlyMonth, indexNameMap) -> {
-					indexNameMap.forEach((indexName, performanceBenchmarkInfoList) -> {
-						performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
+				super.updateBatchById(updateList);
+			} else if ("JDKP".equals(checkCycle) || "YDKP".equals(checkCycle)) {
+				List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
+				List<PerformanceBenchmarkInfo> updateList = new ArrayList<>();
 
-						});
-					});
-				});
-			});
+
+			}
+			addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "立标");
 		}
 	}
 
-	@Override
-	public void bg(String manageCategory, String checkCycle) {
-		QueryWrapper<PerformanceBenchmarkInfo> qw = new QueryWrapper<>();
-		if (StringUtils.isNotEmpty(manageCategory)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getManageCategory, manageCategory);
-		}
-		if (StringUtils.isNotEmpty(checkCycle)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getCheckCycle, checkCycle);
-		}
-		Map<Integer, Map<String, List<PerformanceBenchmarkInfo>>> grouped = baseMapper.selectList(qw).stream()
-			.collect(Collectors.groupingBy(
-				PerformanceBenchmarkInfo::getDegreeYear,
-				Collectors.groupingBy(
-					PerformanceBenchmarkInfo::getIndexName
-				)
-			));
-		grouped.forEach((degreeYear, indexNameMap) -> {
-			indexNameMap.forEach((indexName, performanceBenchmarkInfoList) -> {
-				performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
-					PerformanceBenchmarkInfo.setBgVal(PerformanceBenchmarkInfo.getInstallCapacity() / PerformanceBenchmarkInfo.getCompleteValue());
-				});
-				performanceBenchmarkInfoList.sort(Comparator.comparingDouble(PerformanceBenchmarkInfo::getBgVal).reversed());
-				if (!performanceBenchmarkInfoList.isEmpty() && performanceBenchmarkInfoList.get(0).getBgVal() != 0) {
-					performanceBenchmarkInfoList.get(0).setIsBg(1);
-				}
-				super.updateBatchById(performanceBenchmarkInfoList);
+	/**
+	 * 标杆
+	 *
+	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
+	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
+	 * @param degreeYear     年度
+	 * @param quarterlyMonth 季/月度
+	 */
+	private void bg(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
+		List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "标杆");
+		if (benchmarkingRecordList.size() == 0) {
+			List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
+			performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
+				PerformanceBenchmarkInfo.setBgVal(PerformanceBenchmarkInfo.getInstallCapacity() / PerformanceBenchmarkInfo.getCompleteValue());
 			});
-		});
+			performanceBenchmarkInfoList.sort(Comparator.comparingDouble(PerformanceBenchmarkInfo::getBgVal).reversed());
+			if (!performanceBenchmarkInfoList.isEmpty() && performanceBenchmarkInfoList.get(0).getBgVal() != 0) {
+				performanceBenchmarkInfoList.get(0).setIsBg(1);
+			}
+			super.updateBatchById(performanceBenchmarkInfoList);
+			addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "标杆");
+		}
 	}
 
-	@Override
-	public void db(String manageCategory, String checkCycle) {
-		QueryWrapper<PerformanceBenchmarkInfo> qw = new QueryWrapper<>();
-		if (StringUtils.isNotEmpty(manageCategory)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getManageCategory, manageCategory);
-		}
-		if (StringUtils.isNotEmpty(checkCycle)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getCheckCycle, checkCycle);
-		}
-		List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(qw);
-		for (PerformanceBenchmarkInfo performanceBenchmarkInfo : performanceBenchmarkInfoList) {
-			if (performanceBenchmarkInfo.getCompleteValue() >= performanceBenchmarkInfo.getScalingValue()) {
-				performanceBenchmarkInfo.setIsDb(1);
-				performanceBenchmarkInfo.setDbVal(performanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
+	/**
+	 * 达标
+	 *
+	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
+	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
+	 * @param degreeYear     年度
+	 * @param quarterlyMonth 季/月度
+	 */
+	private void db(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
+		List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "达标");
+		if (benchmarkingRecordList.size() == 0) {
+			List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
+			for (PerformanceBenchmarkInfo performanceBenchmarkInfo : performanceBenchmarkInfoList) {
+				if (performanceBenchmarkInfo.getCompleteValue() >= performanceBenchmarkInfo.getScalingValue()) {
+					performanceBenchmarkInfo.setIsDb(1);
+					performanceBenchmarkInfo.setDbVal(performanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
+				}
 			}
+			super.updateBatchById(performanceBenchmarkInfoList);
+			addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "达标");
 		}
-		super.updateBatchById(performanceBenchmarkInfoList);
 	}
 
-	@Override
-	public void cb(String manageCategory, String checkCycle) {
-		QueryWrapper<PerformanceBenchmarkInfo> qw = new QueryWrapper<>();
-		if (StringUtils.isNotEmpty(manageCategory)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getManageCategory, manageCategory);
-		}
-		if (StringUtils.isNotEmpty(checkCycle)) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getCheckCycle, checkCycle);
+	/**
+	 * 超标
+	 *
+	 * @param manageCategory 经营类别(火电、水电、新能源(风电、光伏)、煤电、海外、综合)
+	 * @param checkCycle     周期(NDKP、JDKP、YDKP)
+	 * @param degreeYear     年度
+	 * @param quarterlyMonth 季/月度
+	 */
+	private void cb(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
+		List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "超标");
+		if (benchmarkingRecordList.size() == 0) {
+			List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
+			performanceBenchmarkInfoList.stream().filter(p -> p.getIsBg().equals(1)).findFirst().ifPresent(performanceBenchmarkInfo -> performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
+				if (PerformanceBenchmarkInfo.getCompleteValue() > performanceBenchmarkInfo.getScalingValue()) {
+					PerformanceBenchmarkInfo.setIsCb(1);
+					PerformanceBenchmarkInfo.setCbVal(PerformanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
+				}
+			}));
+			super.updateBatchById(performanceBenchmarkInfoList);
+			addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "超标");
 		}
-		Map<Integer, Map<String, List<PerformanceBenchmarkInfo>>> grouped = baseMapper.selectList(qw).stream()
-			.collect(Collectors.groupingBy(
-				PerformanceBenchmarkInfo::getDegreeYear,
-				Collectors.groupingBy(
-					PerformanceBenchmarkInfo::getIndexName
-				)
-			));
-		grouped.forEach((degreeYear, indexNameMap) -> {
-			indexNameMap.forEach((indexName, performanceBenchmarkInfoList) -> {
-				performanceBenchmarkInfoList.stream().filter(p -> p.getIsBg().equals(1)).findFirst().ifPresent(performanceBenchmarkInfo -> performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
-					if (PerformanceBenchmarkInfo.getCompleteValue() > performanceBenchmarkInfo.getScalingValue()) {
-						PerformanceBenchmarkInfo.setIsCb(1);
-						PerformanceBenchmarkInfo.setCbVal(PerformanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
-					}
-				}));
-				super.updateBatchById(performanceBenchmarkInfoList);
-			});
-		});
 	}
 
 	/**
@@ -272,30 +252,14 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
 		return a * b;
 	}
 
-	private boolean uniquenessCheck(PerformanceBenchmarkInfo performanceBenchmarkInfo) {
-		QueryWrapper<PerformanceBenchmarkInfo> qw = new QueryWrapper<>();
-		if (StringUtils.isNotEmpty(performanceBenchmarkInfo.getCheckCycle())) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getCheckCycle, performanceBenchmarkInfo.getCheckCycle());
-		}
-		if (null != performanceBenchmarkInfo.getDegreeYear()) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getDegreeYear, performanceBenchmarkInfo.getDegreeYear());
-		}
-		if (null != performanceBenchmarkInfo.getQuarterlyMonth()) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getQuarterlyMonth, performanceBenchmarkInfo.getQuarterlyMonth());
-		}
-		if (StringUtils.isNotEmpty(performanceBenchmarkInfo.getManageCategory())) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getManageCategory, performanceBenchmarkInfo.getManageCategory());
-		}
-		if (StringUtils.isNotEmpty(performanceBenchmarkInfo.getCompanyId())) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getCompanyId, performanceBenchmarkInfo.getCompanyId());
-		}
-		if (null != performanceBenchmarkInfo.getPlannedValue()) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getPlannedValue, performanceBenchmarkInfo.getPlannedValue());
-		}
-		if (null != performanceBenchmarkInfo.getCompleteValue()) {
-			qw.lambda().eq(PerformanceBenchmarkInfo::getCompleteValue, performanceBenchmarkInfo.getCompleteValue());
-		}
-		List<PerformanceBenchmarkInfo> objList = baseMapper.selectList(qw);
-		return objList.size() == 0;
+	private void addRecord(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth, String toolCategory) {
+		BenchmarkingRecord benchmarkingRecord = new BenchmarkingRecord();
+		benchmarkingRecord.setId(Convert.toStr(IdUtil.getSnowflake(1, 1).nextId()));
+		benchmarkingRecord.setManageCategory(manageCategory);
+		benchmarkingRecord.setCheckCycle(checkCycle);
+		benchmarkingRecord.setDegreeYear(degreeYear);
+		benchmarkingRecord.setQuarterlyMonth(quarterlyMonth);
+		benchmarkingRecord.setTagType(toolCategory);
+		benchmarkingRecordService.save(benchmarkingRecord);
 	}
 }

+ 47 - 0
ims-service/ims-eval/src/main/resources/mappers/BenchmarkingRecordMapper.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ims.eval.dao.BenchmarkingRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.ims.eval.entity.BenchmarkingRecord">
+        <id column="id" property="id"/>
+        <result column="check_cycle" property="checkCycle"/>
+        <result column="degree_year" property="degreeYear"/>
+        <result column="quarterly_month" property="quarterlyMonth"/>
+        <result column="manage_category" property="manageCategory"/>
+        <result column="tag_type" property="tagType"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="selectBenchmarkingRecordVo">
+        select id,
+               check_cycle,
+               degree_year,
+               quarterly_month,
+               manage_category,
+               tag_type
+        from benchmarking_record
+    </sql>
+
+    <select id="selectList" resultType="com.ims.eval.entity.BenchmarkingRecord">
+        select * from benchmarking_record
+        <where>
+            <if test="checkCycle != null and checkCycle != ''">
+                AND check_cycle = #{checkCycle}
+            </if>
+            <if test="degreeYear != null and degreeYear != ''">
+                AND degree_year = #{degreeYear}
+            </if>
+            <if test="quarterlyMonth != null and quarterlyMonth != ''">
+                AND quarterly_month = #{quarterlyMonth}
+            </if>
+            <if test="manageCategory != null and manageCategory != ''">
+                AND manage_category = #{manageCategory}
+            </if>
+            <if test="tagType != null and tagType != ''">
+                AND tag_type = #{tagType}
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 93 - 73
ims-service/ims-eval/src/main/resources/mappers/OrganizationEvaluationInfoMapper.xml

@@ -4,40 +4,41 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.ims.eval.entity.OrganizationEvaluationInfo">
-        <id column="id" property="id" />
-        <result column="organization_evaluation_id" property="organizationEvaluationId" />
-        <result column="indicator_id" property="indicatorId" />
-        <result column="indicator_dictionary_id" property="indicatorDictionaryId" />
-        <result column="option_code" property="optionCode" />
-        <result column="is_quantified" property="isQuantified" />
-        <result column="quantified_value" property="quantifiedValue" />
-        <result column="non_quantified_value" property="nonQuantifiedValue" />
-        <result column="create_time" property="createTime" />
-        <result column="create_by" property="createBy" />
-        <result column="update_time" property="updateTime" />
-        <result column="update_by" property="updateBy" />
-        <result column="remark" property="remark" />
+        <id column="id" property="id"/>
+        <result column="organization_evaluation_id" property="organizationEvaluationId"/>
+        <result column="indicator_id" property="indicatorId"/>
+        <result column="indicator_dictionary_id" property="indicatorDictionaryId"/>
+        <result column="option_code" property="optionCode"/>
+        <result column="is_quantified" property="isQuantified"/>
+        <result column="quantified_value" property="quantifiedValue"/>
+        <result column="non_quantified_value" property="nonQuantifiedValue"/>
+        <result column="create_time" property="createTime"/>
+        <result column="create_by" property="createBy"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="update_by" property="updateBy"/>
+        <result column="remark" property="remark"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, organization_evaluation_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark
+        id
+        , organization_evaluation_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark
     </sql>
 
 
-<!--    <update id="updateEvaluationInfo">-->
+    <!--    <update id="updateEvaluationInfo">-->
 
-<!--            <foreach collection="evaluationInfos" item="item" index="index" separator=";">-->
-<!--                <trim suffixOverrides=",">-->
-<!--                    UPDATE organization_evaluation_info-->
-<!--                    SET quantified_Value = ${item.quantifiedValue},-->
-<!--                    non_Quantified_Value = '${item.nonQuantifiedValue}'-->
-<!--                    WHERE id = '${item.id}'-->
-<!--                </trim>-->
-<!--            </foreach>-->
+    <!--            <foreach collection="evaluationInfos" item="item" index="index" separator=";">-->
+    <!--                <trim suffixOverrides=",">-->
+    <!--                    UPDATE organization_evaluation_info-->
+    <!--                    SET quantified_Value = ${item.quantifiedValue},-->
+    <!--                    non_Quantified_Value = '${item.nonQuantifiedValue}'-->
+    <!--                    WHERE id = '${item.id}'-->
+    <!--                </trim>-->
+    <!--            </foreach>-->
 
 
-<!--    </update>-->
+    <!--    </update>-->
 
     <select id="selectListEvaluationInfoId"
             resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
@@ -69,7 +70,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -78,7 +79,7 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and  ei.organization_evaluation_id  = #{organizationEvaluationId}
+                and ei.organization_evaluation_id = #{organizationEvaluationId}
             </if>
 
             <if test="optionCode !=null and optionCode !=''">
@@ -86,17 +87,20 @@
             </if>
 
             <if test="dept !=null and dept !=''">
-                and  dd.key_name = #{dept}
+                and dd.key_name = #{dept}
             </if>
 
             <if test="organizationId !=null and organizationId !=''">
-                and  oer.organization_id = #{organizationId}
+                and oer.organization_id = #{organizationId}
             </if>
 
-            and id.option_code not in ('CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
+            and id.option_code not in
+            ('CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
         </where>
 
-        order by be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.child_code,id.option_code,id.option_order asc
+        order by
+        be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.child_code,id.option_code,id.option_order
+        asc
 
     </select>
 
@@ -156,7 +160,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -165,7 +169,7 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and  ei.organization_evaluation_id  = #{organizationEvaluationId}
+                and ei.organization_evaluation_id = #{organizationEvaluationId}
             </if>
 
             <if test="optionCode !=null and optionCode !=''">
@@ -173,37 +177,41 @@
             </if>
 
             <if test="dept !=null and dept !=''">
-                and  dd.key_name  like   CONCAT('%',#{dept},'%')
+                and dd.key_name like CONCAT('%',#{dept},'%')
             </if>
 
             <if test="organizationShortName !=null and organizationShortName !=''">
-                and oer.organization_short_name  like   CONCAT('%',#{organizationShortName},'%')
+                and oer.organization_short_name like CONCAT('%',#{organizationShortName},'%')
             </if>
 
             <if test="indicatorName !=null and indicatorName !=''">
-                and  i.indicator_name  like   CONCAT('%',#{indicatorName},'%')
+                and i.indicator_name like CONCAT('%',#{indicatorName},'%')
             </if>
 
             <if test="binSection !=null and binSection !=''">
-                and  bn.id = #{binSection}
+                and bn.id = #{binSection}
             </if>
 
             <if test="isQuantified !=null and isQuantified !=''">
-                and  ei.is_quantified = #{isQuantified}
+                and ei.is_quantified = #{isQuantified}
             </if>
 
             <if test="organizationId !=null and organizationId !=''">
-                and  oer.organization_id = #{organizationId}
+                and oer.organization_id = #{organizationId}
             </if>
 
-            and id.option_code not in ('DF','DF2','CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
+            and id.option_code not in
+            ('DF','DF2','CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
             and id.is_show = true
         </where>
 
-        order by oer.organization_short_name,be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.option_order asc
+        order by
+        oer.organization_short_name,be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.option_order
+        asc
 
     </select>
-    <select id="selectByIdAndEvaluationInfoId" resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
+    <select id="selectByIdAndEvaluationInfoId"
+            resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
 
         select
         ei.id,
@@ -235,7 +243,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -243,21 +251,21 @@
         inner join data_dictionary dd on dd.data_key = i.dept_id
         <where>
 
-        <if test="id !=null and id !=''">
-            and  ei.id  = #{id}
-        </if>
+            <if test="id !=null and id !=''">
+                and ei.id = #{id}
+            </if>
 
-        <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-            and  ei.organization_evaluation_id  = #{organizationEvaluationId}
-        </if>
+            <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
+                and ei.organization_evaluation_id = #{organizationEvaluationId}
+            </if>
 
-        <if test="optionCode !=null and optionCode !=''">
-            and  id.option_code = #{optionCode}
-        </if>
+            <if test="optionCode !=null and optionCode !=''">
+                and id.option_code = #{optionCode}
+            </if>
 
-        <if test="indicatorId !=null and indicatorId !=''">
-            and  i.id = #{indicatorId}
-        </if>
+            <if test="indicatorId !=null and indicatorId !=''">
+                and i.id = #{indicatorId}
+            </if>
 
 
         </where>
@@ -267,32 +275,33 @@
     </select>
     <select id="selectEvaluationIndicatorList" resultType="java.util.Map">
 
-        select  DISTINCT i.id,i.indicator_name,ri.order_num from organization_evaluation_info   ei
+        select DISTINCT i.id,i.indicator_name,ri.order_num from organization_evaluation_info ei
         LEFT JOIN evaluate_rule_info ri on ei.evaluate_rule_info_id = ri.id
         LEFT JOIN evaluate_rule er on er.id = ri.evaluate_rule_id
         INNER JOIN indicator i on i.id = ri.indicator_id
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and  ei.organization_evaluation_id = #{organizationEvaluationId}
+                and ei.organization_evaluation_id = #{organizationEvaluationId}
             </if>
 
             <if test="binSection !=null and binSection !=''">
-                and  er.bin_section = #{binSection}
+                and er.bin_section = #{binSection}
             </if>
 
             <if test="binStage !=null and binStage !=''">
-                and  er.bin_stage = #{binStage}
+                and er.bin_stage = #{binStage}
             </if>
 
         </where>
 
-        order by  ri.order_num asc
+        order by ri.order_num asc
 
     </select>
 
 
-    <select id="selectEvaluationInfoList" resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
+    <select id="selectEvaluationInfoList"
+            resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
 
         select
         ei.id,
@@ -327,7 +336,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -336,12 +345,12 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and  ei.organization_evaluation_id  = #{organizationEvaluationId}
+                and ei.organization_evaluation_id = #{organizationEvaluationId}
             </if>
 
 
             <if test="indicatorId !=null and indicatorId !=''">
-                and  ei.indicator_id = #{indicatorId}
+                and ei.indicator_id = #{indicatorId}
             </if>
 
 
@@ -351,22 +360,21 @@
 
 
             <if test="binStage !=null and binStage !=''">
-                and  be.id = #{binStage}
+                and be.id = #{binStage}
             </if>
 
             <if test="organizationId !=null and organizationId !=''">
-                and  oer.organization_id = #{organizationId}
+                and oer.organization_id = #{organizationId}
             </if>
 
 
             <if test="organizationShortName !=null and organizationShortName !=''">
-                and  oer.organization_short_name  like   CONCAT('%',#{organizationShortName},'%')
+                and oer.organization_short_name like CONCAT('%',#{organizationShortName},'%')
             </if>
 
 
-
-
-            and id.option_code not in ('CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','LRGXKHMAX','LRGXKHMIN')
+            and id.option_code not in
+            ('CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','LRGXKHMAX','LRGXKHMIN')
         </where>
 
         order by oer.order_num asc
@@ -381,10 +389,10 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and  ei.organization_evaluation_id = #{organizationEvaluationId}
+                and ei.organization_evaluation_id = #{organizationEvaluationId}
             </if>
             <if test="deptId !=null and deptId !=''">
-                and  ei.dept_id = #{deptId}
+                and ei.dept_id = #{deptId}
             </if>
             <if test="state !=null">
                 AND ei.state in
@@ -393,7 +401,8 @@
         </where>
     </select>
 
-    <select id="getOrganizationEvaluationInfoListByIndicatorDictionaryId" resultType="com.ims.eval.entity.OrganizationEvaluationInfo">
+    <select id="getOrganizationEvaluationInfoListByIndicatorDictionaryId"
+            resultType="com.ims.eval.entity.OrganizationEvaluationInfo">
         select
         oei.*,
         oe.check_cycle checkCycle,
@@ -405,7 +414,18 @@
         from organization_evaluation_info oei
         left join organization_evaluation oe on oe.id = oei.organization_evaluation_id
         left join unit_install_capacity uic on uic.unit_id = oei.organization_id
-        where oei.indicator_dictionary_id = #{indicatorDictionaryId} and oei.is_quantified = 't'
+        <where>
+            oei.is_quantified = 't'
+            <if test="indicatorDictionaryId != null and indicatorDictionaryId !='' ">
+                and oei.indicator_dictionary_id = #{indicatorDictionaryId}
+            </if>
+            <if test="degreeYear !=null and degreeYear !=''">
+                and oe.year = #{degreeYear}
+            </if>
+            <if test="quarterlyMonth !=null and quarterlyMonth !=''">
+                and oe.month = #{quarterlyMonth}
+            </if>
+        </where>
         order by oei.organization_id asc
     </select>
 

+ 24 - 0
ims-service/ims-eval/src/main/resources/mappers/PerformanceBenchmarkInfoMapper.xml

@@ -60,6 +60,12 @@
             <if test="checkCycle != null and checkCycle != ''">
                 AND check_cycle = #{checkCycle}
             </if>
+            <if test="degreeYear != null and degreeYear != ''">
+                AND degree_year = #{degreeYear}
+            </if>
+            <if test="quarterlyMonth != null and quarterlyMonth != ''">
+                AND quarterly_month = #{quarterlyMonth}
+            </if>
             <if test="isBg == 1">
                 AND is_bg = 1 order by bg_val desc
             </if>
@@ -72,4 +78,22 @@
         </where>
     </select>
 
+    <select id="selectList" resultType="com.ims.eval.entity.PerformanceBenchmarkInfo">
+        select * from performance_benchmark_info
+        <where>
+            <if test="manageCategory != null and manageCategory != ''">
+                AND manage_category = #{manageCategory}
+            </if>
+            <if test="checkCycle != null and checkCycle != ''">
+                AND check_cycle = #{checkCycle}
+            </if>
+            <if test="degreeYear != null and degreeYear != ''">
+                AND degree_year = #{degreeYear}
+            </if>
+            <if test="quarterlyMonth != null and quarterlyMonth != ''">
+                AND quarterly_month = #{quarterlyMonth}
+            </if>
+        </where>
+    </select>
+
 </mapper>