zhubaomin
2025-04-17 d711c899e42e8cacee3ed6408f4c57e91c962dc8
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package com.dy.pipIrrGlobal.daoIr;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan;
import com.dy.pipIrrGlobal.voIr.VoPlanDetails;
import com.dy.pipIrrGlobal.voIr.VoPlanSimple;
import com.dy.pipIrrGlobal.voIr.VoPlans;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
 
import java.util.Date;
import java.util.List;
import java.util.Map;
 
/**
 * @author ZhuBaoMin
 * @date 2025-03-27 8:54
 * @LastEditTime 2025-03-27 8:54
 * @Description
 */
 
@Mapper
public interface IrIrrigatePlanMapper extends BaseMapper<IrIrrigatePlan> {
    int deleteByPrimaryKey(Long id);
 
    int insert(IrIrrigatePlan record);
 
    int insertSelective(IrIrrigatePlan record);
 
    IrIrrigatePlan selectByPrimaryKey(Long id);
 
    int updateByPrimaryKeySelective(IrIrrigatePlan record);
 
    int updateByPrimaryKey(IrIrrigatePlan record);
 
    /**
     * 根据指定的计划ID获取启动模式
     * @param planId
     * @return
     */
    Byte getStartupMode(Long planId);
 
    /**
     * 根据指定的条件获取计划数量
     * @param params
     * @return
     */
    //Long getIrrigatePlanCount(Map<?, ?> params);
 
    /**
     * 根据指定的条件获取计划列表
     * @param params
     * @return
     */
    //List<VoIrrigatePlan> getIrrigatePlans(Map<?, ?> params);
 
    /**
     * 根据计划ID获取计划简单信息
     * @return
     */
    VoPlanSimple getPlanSimple(Long planId);
 
    /**
     * 根据计划ID更新计划信息(起止时间、计划状态)
     * @param planId
     * @return
     */
    Integer updatePlanTimes(@Param("planStartTime") Date planStartTime, @Param("planStopTime") Date planEndTime, @Param("planId")  Long planId);
 
    /**
     * 获取未完成的计划列表,小程序计划列表页使用
     * 计划状态:1-草稿,2-未执行,3-执行中,4-已完成
     * @return
     */
    List<VoPlans> getNotCompletePlans();
 
    /**
     * 获取已完成的计划数量
     * @return
     */
    Long getCompletedPlansCount(Map<String, Object> params);
 
    /**
     * 获取已完成的计划列表,小程序计划列表页使用
     * 计划状态:1-草稿,2-未执行,3-执行中,4-已完成
     * @return
     */
    List<VoPlans> getCompletedPlans(Map<String, Object> params);
 
    /**
     * 根据计划ID获取待终止计划的结束时间:未删除、未终止、已发布、当前时间小于计划结束时间
     * @param planId
     * @return
     */
    Date getToTerminatePlan(@Param("planId") Long planId);
 
    /**
     * 根据计划ID获取计划详情,包括计划名称,项目名,计划开始时间,计划结束时间,计划详情页使用
     * @param planId
     * @return
     */
    VoPlanDetails getPlanDetails(@Param("planId") Long planId);
 
    /**
     * 根据计划ID获取已终止计划的详情,结束时间为实际终止时间
     * @param planId
     * @param terminateTime
     * @return
     */
    VoPlanDetails getPlanDetails_terminate(@Param("planId") Long planId, @Param("terminateTime") Date terminateTime);
 
    /**
     * 根据计划ID获取计划状态,用于判断是否可以删除计划
     * @param planId
     * @return
     */
    Integer getPlanState(@Param("planId") Long planId);
 
    /**
     * 判断当前项目是否存在已发布、未终止、未删除、未完成的计划,发布计划前判断使用
     * @param planId
     * @return
     */
    Integer hasPlan_CurrentProject(Long planId);
 
    /**
     * 判断当前计划包含的轮灌组是否与其他项目下计划包含的轮灌组有交集,且其他项目的计划状态为已发布、未终止、未删除、未完成,发布计划前判断使用
     * @param planId
     * @return
     */
    Integer hasPlan_OtherProject(Long planId);
 
    /**
     * 根据计划ID获取计划最新状态
     * @param planId
     * @return
     */
    Integer getPlanLatestState(@Param("planId") Long planId);
}