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

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.bpm.controller.admin.definition.vo.cc.BpmProcessCcPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessCcDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * BPM 流程抄送配置 Mapper
 *
 * @author 符溶馨
 */
@Mapper
public interface BpmProcessCcMapper extends BaseMapperX<BpmProcessCcDO> {

    default PageResult<BpmProcessCcDO> selectPage(BpmProcessCcPageReqVO reqVO) {

        return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessCcDO>()
                .likeIfPresent(BpmProcessCcDO::getName, reqVO.getName())
                .likeIfPresent(BpmProcessCcDO::getUserGroupId, reqVO.getUserGroupId())
                .likeIfPresent(BpmProcessCcDO::getCompanyDeptId, reqVO.getCompanyDeptId())
                .eqIfPresent(BpmProcessCcDO::getStatus, reqVO.getStatus())
                .orderByDesc(BpmProcessCcDO::getId));
    }
}