liyong
10 天以前 88e384da863bb2f7324cb1e1474885df3b7cce91
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.hrm.dal.mysql.salary;
 
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.hrm.controller.admin.salary.vo.HrmSalaryPaymentPageReqVO;
import cn.iocoder.yudao.module.hrm.dal.dataobject.salary.HrmSalaryPaymentDO;
import org.apache.ibatis.annotations.Mapper;
 
/**
 * 薪资发放台账 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface HrmSalaryPaymentMapper extends BaseMapperX<HrmSalaryPaymentDO> {
 
    default PageResult<HrmSalaryPaymentDO> selectPage(HrmSalaryPaymentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HrmSalaryPaymentDO>()
                .likeIfPresent(HrmSalaryPaymentDO::getNo, reqVO.getNo())
                .eqIfPresent(HrmSalaryPaymentDO::getPeriod, reqVO.getPeriod())
                .eqIfPresent(HrmSalaryPaymentDO::getStatus, reqVO.getStatus())
                .orderByDesc(HrmSalaryPaymentDO::getId));
    }
 
    default HrmSalaryPaymentDO selectByNo(String no) {
        return selectOne(HrmSalaryPaymentDO::getNo, no);
    }
 
    default HrmSalaryPaymentDO selectByPeriod(String period) {
        return selectOne(new LambdaQueryWrapperX<HrmSalaryPaymentDO>()
                .eq(HrmSalaryPaymentDO::getPeriod, period)
                .orderByDesc(HrmSalaryPaymentDO::getId)
                .last("LIMIT 1"));
    }
 
}