zhubaomin
2025-04-07 1a2b07f01ba4616fd9e894dddf474b56d020158c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.dy.pipIrrWechat.irrigation;
 
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoIr.IrIrrigateGroupMapper;
import com.dy.pipIrrGlobal.daoIr.IrProjectMapper;
import com.dy.pipIrrGlobal.voIr.VoGroupSimple;
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;
import org.springframework.stereotype.Service;
 
import java.util.List;
import java.util.Map;
 
/**
 * @author ZhuBaoMin
 * @date 2025-02-20 8:59
 * @LastEditTime 2025-02-20 8:59
 * @Description
 */
 
@Slf4j
@Service
public class IrrigationSv {
    @Autowired
    private IrProjectMapper irProjectMapper;
 
    @Autowired
    private IrIrrigateGroupMapper irIrrigateGroupMapper;
 
    /**
     * 根据指定条件获取项目记录(精简)
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoProjectSimple>> getSimpleProjects(QoProject queryVo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = irProjectMapper.getSimpleProjectsCount(params);
 
        QueryResultVo<List<VoProjectSimple>> rsVo = new QueryResultVo<>();
 
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = irProjectMapper.getSimpleProjects(params);
        return rsVo;
    }
 
    /**
     * 根据指定条件获取轮灌组列表
     * @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.calculateAndSet(itemTotal, params);
        rsVo.obj = irIrrigateGroupMapper.getSimpleGroups(params);
        return rsVo;
    }
 
}