郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
package com.gkhy.safePlatform.safeCheck.repository;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.safePlatform.safeCheck.entity.SafeCheckWork;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Repository;
 
import java.util.Date;
import java.util.List;
 
@Repository
public interface SafeCheckWorkRepository extends BaseMapper<SafeCheckWork> {
 
    /**
     * @description 根据巡检单元id查询对应的调度信息记录
     */
    SafeCheckWork getWorkByTaskUnitId(@Param("taskUnitId") Long taskUnitId, @Param("deleteStatus") int deleteStatus);
 
    /**
     * @description 根据调度信息id删除调度记录
     */
    int deleteWorkById(@Param("work") SafeCheckWork work, @Param("workStatus") List<Integer> workStatus,@Param("deleteStatus") int deleteStatus);
 
    /**
     * @description 根据workid更新work的状态
     */
    int updateWorkStatusById(@Param("work") SafeCheckWork work, @Param("status") int status);
 
    /**
     * @description 根据workid更新任务单元中主部分关于调度的信息
     */
    int updateWorkInfoById(@Param("work")SafeCheckWork newWork, int status);
 
    /**
     * @description 获取未来30分钟内的任务单元
     */
    List<SafeCheckWork> findActiveWorkListByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime,@Param("status") int status);
 
    /**
     * @description 根据work的id获取work调度表的记录
     */
    SafeCheckWork getWorkById(@Param("workId") Long workId);
 
    /**
     * @description 根据workid将work状态由调度中状态改为开启状态
     */
    int resetWorkStatus(@Param("work") SafeCheckWork work , @Param("newStatus") Byte newStatus);
 
    /**
     * @description 获取当前异常调度信息(下次通知时间在当前时间之前的)
     */
    List<SafeCheckWork> findFaildScheduleList(@Param("nowTime") Date nowTime, @Param("openStatus") Byte openStatus,@Param("dispatchingStatus") Byte dispatchingStatus);
 
    /**
     * @description 根据work的id和work状态查询work
     */
    SafeCheckWork getWorkByIdAndWorkStatus(Long workId, Byte status);
}