package cn.aagro.pp.module.crm.dal.mysql.business;

import cn.aagro.pp.framework.common.pojo.PageParam;
import cn.aagro.pp.framework.common.pojo.PageResult;
import cn.aagro.pp.framework.mybatis.core.mapper.BaseMapperX;
import cn.aagro.pp.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.aagro.pp.module.crm.dal.dataobject.business.CrmBusinessStatusTypeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 商机状态组 Mapper
 *
 * @author ljlleo
 */
@Mapper
public interface CrmBusinessStatusTypeMapper extends BaseMapperX<CrmBusinessStatusTypeDO> {

    default PageResult<CrmBusinessStatusTypeDO> selectPage(PageParam reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CrmBusinessStatusTypeDO>()
                .orderByDesc(CrmBusinessStatusTypeDO::getId));
    }

    default CrmBusinessStatusTypeDO selectByName(String name) {
        return selectOne(CrmBusinessStatusTypeDO::getName, name);
    }

}
