Browse Source

考评规则添加年度和考评周期 字段筛选条件

wangchangsheng 1 year ago
parent
commit
3afccc7802

+ 10 - 6
ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluateRuleController.java

@@ -45,8 +45,10 @@ public class EvaluateRuleController {
 				  @RequestParam(value = "id", required = false) String id,
 				  @RequestParam(value = "des", required = false) String des,
 				  @RequestParam(value = "binSection", required = false) String binSection,
-				  @RequestParam(value = "binStage", required = false) String binStage) {
-		IPage<EvaluateRule> list = evaluateRuleService.listPage(pageNum, pageSize, id, des, binSection, binStage);
+				  @RequestParam(value = "binStage", required = false) String binStage,
+				  @RequestParam(value = "checkCycle", required = false) String checkCycle,
+				  @RequestParam(value = "year", required = false) String year) {
+		IPage<EvaluateRule> list = evaluateRuleService.listPage(pageNum, pageSize, id, des, binSection, binStage, checkCycle, year);
 		return R.ok().data(list);
 	}
 
@@ -63,10 +65,12 @@ public class EvaluateRuleController {
 	//@ImsPreAuth("eval:dataDictionary:view")
 	@GetMapping(value = "listAll")
 	public R listAll(@RequestParam(value = "id", required = false) String id,
-				  @RequestParam(value = "des", required = false) String des,
-				  @RequestParam(value = "binSection", required = false) String binSection,
-				  @RequestParam(value = "binStage", required = false) String binStage) {
-		List<EvaluateRule> list = evaluateRuleService.listAll(id, des, binSection, binStage);
+					 @RequestParam(value = "des", required = false) String des,
+					 @RequestParam(value = "binSection", required = false) String binSection,
+					 @RequestParam(value = "binStage", required = false) String binStage,
+					 @RequestParam(value = "checkCycle", required = false) String checkCycle,
+					 @RequestParam(value = "year", required = false) String year) {
+		List<EvaluateRule> list = evaluateRuleService.listAll(id, des, binSection, binStage, checkCycle, year);
 		return R.ok().data(list);
 	}
 

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

@@ -22,7 +22,9 @@ public interface EvaluateRuleMapper extends BaseMapper<EvaluateRule> {
 	IPage<EvaluateRule>  selectListPage(Page page, @Param("id") String id,
 										@Param("des") String des,
 										@Param("binSection") String binSection,
-										@Param("binStage") String binStage);
+										@Param("binStage") String binStage,
+										@Param("checkCycle") String checkCycle,
+										@Param("year")String year);
 
 
 	List <EvaluateRuleInfoResDTO> selectListInIdsInfos(List<String> ids, String binSection, String binStage);

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

@@ -19,9 +19,9 @@ public interface IEvaluateRuleService extends IService<EvaluateRule> {
 
 	IPage<EvaluateRule> list(Integer pageNum, Integer pageSize, String id, String des, String binSection, String binStage);
 
-	IPage<EvaluateRule> listPage(Integer pageNum, Integer pageSize, String id, String des, String binSection, String binStage);
+	IPage<EvaluateRule> listPage(Integer pageNum, Integer pageSize, String id, String des, String binSection, String binStage,String checkCycle,String year);
 
-	List<EvaluateRule> listAll( String id, String des, String binSection, String binStage);
+	List<EvaluateRule> listAll( String id, String des, String binSection, String binStage,String checkCycle,String year);
 
 
 	List<EvaluateRule> listAll(List<String> ids);

+ 12 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateRuleServiceImpl.java

@@ -66,18 +66,18 @@ public class EvaluateRuleServiceImpl extends ServiceImpl<EvaluateRuleMapper, Eva
 	}
 
 	@Override
-	public IPage<EvaluateRule> listPage(Integer pageNum, Integer pageSize, String id, String des, String binSection, String binStage) {
+	public IPage<EvaluateRule> listPage(Integer pageNum, Integer pageSize, String id, String des, String binSection, String binStage,String checkCycle,String year) {
 		if (null == pageNum || null == pageSize) {
 			throw new RuntimeException("分页参数为空");
 		}
 		//构造分页构造器
 		Page<EvaluateRule> page = new Page<>(pageNum, pageSize);
-		IPage<EvaluateRule> list = baseMapper.selectListPage(page, id, des, binSection, binStage);
+		IPage<EvaluateRule> list = baseMapper.selectListPage(page, id, des, binSection, binStage,checkCycle,year);
 		return list;
 	}
 
 	@Override
-	public List<EvaluateRule> listAll(String id, String des, String binSection, String binStage) {
+	public List<EvaluateRule> listAll(String id, String des, String binSection, String binStage,String checkCycle,String year) {
 		QueryWrapper<EvaluateRule> qw = new QueryWrapper<>();
 
 		if (StringUtils.isNotEmpty(id)) {
@@ -100,6 +100,15 @@ public class EvaluateRuleServiceImpl extends ServiceImpl<EvaluateRuleMapper, Eva
 			qw.lambda().in(EvaluateRule::getBinStage, binStages);
 		}
 
+
+		if (StringUtils.isNotEmpty(checkCycle)) {
+			qw.lambda().eq(EvaluateRule::getCheckCycle, checkCycle);
+		}
+
+		if (StringUtils.isNotEmpty(year)) {
+			qw.lambda().eq(EvaluateRule::getYear, year);
+		}
+
 		qw.lambda().orderByDesc(EvaluateRule::getCreateTime);
 
 		List<EvaluateRule> list = baseMapper.selectList(qw);

+ 6 - 0
ims-service/ims-eval/src/main/resources/mappers/EvaluateRuleMapper.xml

@@ -47,6 +47,12 @@
                 <if test="binStage !=null and binStage !=''">
                     AND r.bin_stage = #{binStage}
                 </if>
+                <if test="checkCycle !=null and checkCycle !=''">
+                    AND r.check_cycle = #{checkCycle}
+                </if>
+                <if test="year !=null and year !=''">
+                    AND r.year = #{year}
+                </if>
 
                 order by  r.create_time desc
             </where>