package cn.iocoder.yudao.module.bpm.dal.mysql.oa;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
import org.apache.ibatis.annotations.Mapper;

/**
 * 备用金申请 Mapper
 *
 * @author 符溶馨

 */
@Mapper
public interface BpmOAImprestMapper extends BaseMapperX<BpmOAImprestDO> {

    default BpmOAImprestDO selectByUserId(Long userId, Integer status){

        return selectOne(new LambdaQueryWrapperX<BpmOAImprestDO>().eq(BpmOAImprestDO::getUserId, userId)
                        .eq(BpmOAImprestDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult())
                        .eq(BpmOAImprestDO::getStatus, status));
    }
}
