郑永安
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
60
61
62
63
64
65
66
67
68
package com.gkhy.safePlatform.account.service.baseService.impl;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.account.entity.schedule.BreakTimeRuleInfo;
import com.gkhy.safePlatform.account.entity.schedule.BreakTimeRuleInfoDO;
import com.gkhy.safePlatform.account.model.dto.resp.BreakTimeRuleRespDTO;
import com.gkhy.safePlatform.account.repository.schedule.BreakTimeRuleInfoRepository;
import com.gkhy.safePlatform.account.service.baseService.BreakTimeRuleInfoService;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.exception.BusinessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service("breakTimeRuleInfoService")
public class BreakTimeRuleInfoServiceImpl extends ServiceImpl<BreakTimeRuleInfoRepository, BreakTimeRuleInfo> implements BreakTimeRuleInfoService {
 
    @Autowired
    private BreakTimeRuleInfoRepository breakTimeRuleInfoRepository;
 
    /**
     * 新增休班规则
     * @param breakTimeRuleInfo
     * @return
     */
    @Override
    public int addBreakTimeRule(BreakTimeRuleInfo breakTimeRuleInfo) {
        return breakTimeRuleInfoRepository.insert(breakTimeRuleInfo);
    }
 
 
    /**
     * 更新
     * @param breakTimeRuleInfo
     * @return
     */
    @Override
    public int updateBreakTimeRule(BreakTimeRuleInfo breakTimeRuleInfo) {
        return breakTimeRuleInfoRepository.updateById(breakTimeRuleInfo);
    }
 
    /**
     * 查询所有的休息规则
     * @param breakTimeRuleInfo
     * @return
     */
    @Override
    public List<BreakTimeRuleInfo> getAllBreakTimeRule(BreakTimeRuleInfo breakTimeRuleInfo) {
        return breakTimeRuleInfoRepository.getAllBreakTimeRule(breakTimeRuleInfo);
    }
 
    /**
     * 根据id查询数据
     * @param id
     * @return
     */
    @Override
    public BreakTimeRuleInfo getBreakTimeRuleById(Long id) {
        return breakTimeRuleInfoRepository.selectById(id);
    }
 
    @Override
    public List<BreakTimeRuleInfo> getAllBreakTimeRuleByPage(Page<BreakTimeRuleInfo> page, BreakTimeRuleInfo breakTimeRuleInfo) {
        return breakTimeRuleInfoRepository.getAllBreakTimeRule(page,breakTimeRuleInfo);
    }
}