| | |
| | | package com.dy.pipIrrProject.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.voPr.VoController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | public class ControllerSv { |
| | | @Autowired |
| | | private PrControllerMapper prControllerMapper; |
| | | |
| | | @Autowired |
| | | private PrIntakeMapper prIntakeMapper; |
| | | |
| | | /** |
| | | * 根据指定获取控制器记录 |
| | |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据控制器编号获取未删除的控制器数量 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer getRecordCountOfController(Long controllerId) { |
| | | return prControllerMapper.getRecordCountOfController(controllerId); |
| | | } |
| | | /** |
| | | * 根据控制器编号获取已绑定记录数 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer getBindedCount(Long controllerId) { |
| | | return prControllerMapper.getBindedCount(controllerId); |
| | | } |
| | | |
| | | /** |
| | | * 根据主键删除外键 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer deleteIntakeId(Long controllerId) { |
| | | return prControllerMapper.deleteIntakeId(controllerId); |
| | | } |
| | | |
| | | /** |
| | | * 获取未绑控制器的取水口列表 |
| | | * @return |
| | | */ |
| | | public JSONArray getNoBindingIntakes() { |
| | | List<Map<String, Object>> list = Optional.ofNullable(prIntakeMapper.getNoBindingIntakes()).orElse(new ArrayList<>()); |
| | | JSONArray array= null; |
| | | if(list.size() > 0) { |
| | | array= JSONArray.parseArray(JSON.toJSONString(list)); |
| | | } |
| | | return array; |
| | | } |
| | | } |