目标策划:根据指标ID查询规则
This commit is contained in:
parent
8f03f3ea7a
commit
ece954b468
39
src/main/java/iet/ustb/sf/controller/RuleController.java
Normal file
39
src/main/java/iet/ustb/sf/controller/RuleController.java
Normal file
@ -0,0 +1,39 @@
|
||||
package iet.ustb.sf.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import iet.ustb.sf.common.R;
|
||||
import iet.ustb.sf.domain.Rule;
|
||||
import iet.ustb.sf.service.RuleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 目标管控-规则
|
||||
* RuleController
|
||||
*
|
||||
* @author huangge1199
|
||||
* @since 2025/8/11 13:55:47
|
||||
*/
|
||||
@Tag(name = "目标管控-规则")
|
||||
@RestController
|
||||
@RequestMapping("/mbgk/rule")
|
||||
public class RuleController {
|
||||
|
||||
@Resource
|
||||
private RuleService ruleService;
|
||||
|
||||
@Operation(summary = "根据指标ID查询规则")
|
||||
@PostMapping("/getRulesByTarget")
|
||||
public R<List<Rule>> getRulesByTarget(@RequestBody JSONObject params) {
|
||||
List<Rule> ruleList = ruleService.getRulesByTarget(params);
|
||||
return R.ok(ruleList);
|
||||
}
|
||||
|
||||
}
|
@ -121,18 +121,6 @@ public class Rule {
|
||||
@TableField(value = "cycle_num")
|
||||
private Integer cycleNum;
|
||||
|
||||
/**
|
||||
* 停时方案
|
||||
*/
|
||||
@TableField(value = "plan_line")
|
||||
private String planLine;
|
||||
|
||||
/**
|
||||
* 停时区域
|
||||
*/
|
||||
@TableField(value = "plan_area")
|
||||
private String planArea;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
@ -161,9 +149,7 @@ public class Rule {
|
||||
&& (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
|
||||
&& (this.getXVar() == null ? other.getXVar() == null : this.getXVar().equals(other.getXVar()))
|
||||
&& (this.getIsPush() == null ? other.getIsPush() == null : this.getIsPush().equals(other.getIsPush()))
|
||||
&& (this.getCycleNum() == null ? other.getCycleNum() == null : this.getCycleNum().equals(other.getCycleNum()))
|
||||
&& (this.getPlanLine() == null ? other.getPlanLine() == null : this.getPlanLine().equals(other.getPlanLine()))
|
||||
&& (this.getPlanArea() == null ? other.getPlanArea() == null : this.getPlanArea().equals(other.getPlanArea()));
|
||||
&& (this.getCycleNum() == null ? other.getCycleNum() == null : this.getCycleNum().equals(other.getCycleNum()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -187,8 +173,6 @@ public class Rule {
|
||||
result = prime * result + ((getXVar() == null) ? 0 : getXVar().hashCode());
|
||||
result = prime * result + ((getIsPush() == null) ? 0 : getIsPush().hashCode());
|
||||
result = prime * result + ((getCycleNum() == null) ? 0 : getCycleNum().hashCode());
|
||||
result = prime * result + ((getPlanLine() == null) ? 0 : getPlanLine().hashCode());
|
||||
result = prime * result + ((getPlanArea() == null) ? 0 : getPlanArea().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -214,8 +198,6 @@ public class Rule {
|
||||
", xVar=" + xVar +
|
||||
", isPush=" + isPush +
|
||||
", cycleNum=" + cycleNum +
|
||||
", planLine=" + planLine +
|
||||
", planArea=" + planArea +
|
||||
"]";
|
||||
}
|
||||
}
|
@ -1,8 +1,11 @@
|
||||
package iet.ustb.sf.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import iet.ustb.sf.domain.Rule;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hyy
|
||||
* @description 针对表【mbgk_rule】的数据库操作Service
|
||||
@ -10,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface RuleService extends IService<Rule> {
|
||||
|
||||
List<Rule> getRulesByTarget(JSONObject params);
|
||||
}
|
||||
|
@ -1,20 +1,35 @@
|
||||
package iet.ustb.sf.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import iet.ustb.sf.domain.Rule;
|
||||
import iet.ustb.sf.service.RuleService;
|
||||
import iet.ustb.sf.mapper.RuleMapper;
|
||||
import iet.ustb.sf.util.CheckUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hyy
|
||||
* @description 针对表【mbgk_rule】的数据库操作Service实现
|
||||
* @createDate 2025-08-05 15:39:11
|
||||
*/
|
||||
* @author hyy
|
||||
* @description 针对表【mbgk_rule】的数据库操作Service实现
|
||||
* @createDate 2025-08-05 15:39:11
|
||||
*/
|
||||
@Service
|
||||
public class RuleServiceImpl extends ServiceImpl<RuleMapper, Rule>
|
||||
implements RuleService{
|
||||
implements RuleService {
|
||||
|
||||
@Resource
|
||||
private RuleMapper ruleMapper;
|
||||
|
||||
@Override
|
||||
public List<Rule> getRulesByTarget(JSONObject params) {
|
||||
String targetId = params.getString("id");
|
||||
CheckUtils.checkEmpty(targetId, "指标ID");
|
||||
return ruleMapper.selectList(new QueryWrapper<Rule>().eq("target_id", targetId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user