| | |
| | | package com.dy.pipIrrWechat.irrigation; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoIr.IrGroupClientMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrUnitClientMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigateGroupMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrProjectMapper; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupSimple; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitSimple; |
| | | import com.dy.pipIrrWechat.irrigation.qo.QoClient; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectSimple; |
| | | import com.dy.pipIrrWechat.irrigation.qo.QoGroup; |
| | | import com.dy.pipIrrWechat.irrigation.qo.QoProject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Service |
| | | public class IrrigationSv { |
| | | @Autowired |
| | | private IrGroupClientMapper irGroupClientMapper; |
| | | private IrProjectMapper irProjectMapper; |
| | | |
| | | @Autowired |
| | | private IrUnitClientMapper irUnitClientMapper; |
| | | private IrIrrigateGroupMapper irIrrigateGroupMapper; |
| | | |
| | | /** |
| | | * 根据农户编号获取轮灌组列表 |
| | | * 根据指定条件获取项目记录(精简) |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoGroupSimple>> getGroupsByClientId(QoClient queryVo) { |
| | | public List<VoProjectSimple> getSimpleProjects(QoProject queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | return irProjectMapper.getSimpleProjects(params); |
| | | } |
| | | |
| | | Long itemTotal = irGroupClientMapper.getGroupCountByClientId(params); |
| | | /** |
| | | * 根据指定条件获取轮灌组列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoGroupSimple>> getSimpleGroups(QoGroup queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = irIrrigateGroupMapper.getSimpleGroupCount(params); |
| | | |
| | | QueryResultVo<List<VoGroupSimple>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = irGroupClientMapper.getGroupsByClientId(params); |
| | | rsVo.obj = irIrrigateGroupMapper.getSimpleGroups(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取灌溉单元列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoUnitSimple>> getUnitsByClientId(QoClient queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = irUnitClientMapper.getUnitCountByClientId(params); |
| | | |
| | | QueryResultVo<List<VoUnitSimple>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = irUnitClientMapper.getUnitsByClientId(params); |
| | | return rsVo; |
| | | } |
| | | } |