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
package cn.iocoder.yudao.module.mes.dal.mysql.safety;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.mes.controller.admin.safety.vo.train.SafetyTrainingPageReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.safety.SafetyTrainingDO;
import org.apache.ibatis.annotations.Mapper;
 
import java.util.List;
 
/**
 * 安全生产 - 培训记录 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface SafetyTrainingMapper extends BaseMapperX<SafetyTrainingDO> {
 
    default PageResult<SafetyTrainingDO> selectPage(SafetyTrainingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SafetyTrainingDO>()
                .likeIfPresent(SafetyTrainingDO::getTitle, reqVO.getTitle())
                .eqIfPresent(SafetyTrainingDO::getTrainingType, reqVO.getTrainingType())
                .likeIfPresent(SafetyTrainingDO::getTrainer, reqVO.getTrainer())
                .betweenIfPresent(SafetyTrainingDO::getTrainDate, reqVO.getTrainDate())
                .orderByDesc(SafetyTrainingDO::getTrainDate)
                .orderByDesc(SafetyTrainingDO::getId));
    }
 
    default List<SafetyTrainingDO> selectListBetween(java.time.LocalDate begin, java.time.LocalDate end) {
        return selectList(new LambdaQueryWrapperX<SafetyTrainingDO>()
                .geIfPresent(SafetyTrainingDO::getTrainDate, begin)
                .leIfPresent(SafetyTrainingDO::getTrainDate, end)
                .orderByAsc(SafetyTrainingDO::getTrainDate));
    }
 
}