package com.zt.plat.module.base.dal.dao.businessalgorithm;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.base.dal.dataobject.businessalgorithm.BusinessAlgorithmDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.base.controller.admin.businessalgorithm.vo.*;

/**
 * 业务算法 Mapper
 *
 * @author yangxiaofeng
 */
@Mapper
public interface BusinessAlgorithmMapper extends BaseMapperX<BusinessAlgorithmDO> {

    default PageResult<BusinessAlgorithmDO> selectPage(BusinessAlgorithmPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessAlgorithmDO>()
                .eqIfPresent(BusinessAlgorithmDO::getTypeValue, reqVO.getTypeValue())
                .eqIfPresent(BusinessAlgorithmDO::getStatusValue, reqVO.getStatusValue())
                .eqIfPresent(BusinessAlgorithmDO::getCode, reqVO.getCode())
                .likeIfPresent(BusinessAlgorithmDO::getName, reqVO.getName())
                .orderByDesc(BusinessAlgorithmDO::getId));
    }

}