| | |
| | | package com.dy.pipIrrIrrigate.irrigateGroup; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoIr.IrGroupClientMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrGroupUnitMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigateGroupMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrGroupClient; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrGroupUnit; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroup; |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class IrrigateGroupSv { |
| | | |
| | | @Autowired |
| | | private IrIrrigateGroupMapper irIrrigateGroupMapper; |
| | | @Autowired |
| | | private IrGroupUnitMapper irGroupUnitMapper; |
| | | |
| | | @Autowired |
| | | private IrGroupClientMapper irGroupClientMapper; |
| | | |
| | | /** |
| | | * 创建轮灌组 |
| | |
| | | * @return |
| | | */ |
| | | public Integer addIrrigateGroup(IrIrrigateGroup po) { |
| | | po.setOperateDt(new Date()); |
| | | po.setOperateTime(new Date()); |
| | | po.setDeleted((byte) 0); |
| | | int rows = irIrrigateGroupMapper.insertSelective(po); |
| | | if (rows == 0) { |
| | |
| | | * @return |
| | | */ |
| | | public Integer updateIrrigateGroup(IrIrrigateGroup po){ |
| | | po.setOperateDt(new Date()); |
| | | po.setOperateTime(new Date()); |
| | | int rows = irIrrigateGroupMapper.updateByPrimaryKeySelective(po); |
| | | if (rows == 0){ |
| | | return 0; |
| | |
| | | List<Long> groupBindUnits = irGroupUnitMapper.getGroupBindUnits(groupId); |
| | | return groupBindUnits; |
| | | } |
| | | |
| | | /** |
| | | * //查未绑定轮灌组的灌溉单元id |
| | | * @return |
| | | */ |
| | | public List<Long> getNotBindUnits() { |
| | | List<Long> notBindUnits = irGroupUnitMapper.getNotBindUnits(); |
| | | return notBindUnits; |
| | | } |
| | | |
| | | //轮灌组关联农户 |
| | | public Long addGroupClient(IrGroupClient po) { |
| | | irGroupClientMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 删除轮灌组与农户管理 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer deleteGroupClient (Long id) { |
| | | return irGroupClientMapper.deleteByPrimaryKey(id); |
| | | } |
| | | } |