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 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 getAllBreakTimeRule(BreakTimeRuleInfo breakTimeRuleInfo) { return breakTimeRuleInfoRepository.getAllBreakTimeRule(breakTimeRuleInfo); } /** * 根据id查询数据 * @param id * @return */ @Override public BreakTimeRuleInfo getBreakTimeRuleById(Long id) { return breakTimeRuleInfoRepository.selectById(id); } @Override public List getAllBreakTimeRuleByPage(Page page, BreakTimeRuleInfo breakTimeRuleInfo) { return breakTimeRuleInfoRepository.getAllBreakTimeRule(page,breakTimeRuleInfo); } }