package cn.iocoder.yudao.module.system.dal.mysql.languagetype;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.languagetype.LanguageTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.languagetype.vo.*;

/**
 * 语言类型 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LanguageTypeMapper extends BaseMapperX<LanguageTypeDO> {

    default PageResult<LanguageTypeDO> selectPage(LanguageTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LanguageTypeDO>()
                .likeIfPresent(LanguageTypeDO::getName, reqVO.getName())
                .eqIfPresent(LanguageTypeDO::getPicPath, reqVO.getPicPath())
                .betweenIfPresent(LanguageTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LanguageTypeDO::getId));
    }

    default List<LanguageTypeDO> selectList(LanguageTypeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<LanguageTypeDO>()
                .likeIfPresent(LanguageTypeDO::getName, reqVO.getName())
                .eqIfPresent(LanguageTypeDO::getPicPath, reqVO.getPicPath())
                .betweenIfPresent(LanguageTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LanguageTypeDO::getId));
    }

}
