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

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.system.controller.admin.dict.vo.language.LanguageDictPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dict.LanguageDictDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 系统语言字典 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface LanguageDictMapper extends BaseMapperX<LanguageDictDO> {

    default PageResult<LanguageDictDO> selectPage(LanguageDictPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LanguageDictDO>()
                .eqIfPresent(LanguageDictDO::getType, reqVO.getType())
                .eqIfPresent(LanguageDictDO::getLanguageKey, reqVO.getLanguageKey())
                .eqIfPresent(LanguageDictDO::getLanguageValue, reqVO.getLanguageValue())
                .betweenIfPresent(LanguageDictDO::getCreatedTime, reqVO.getCreatedTime())
                .eqIfPresent(LanguageDictDO::getCreatedBy, reqVO.getCreatedBy())
                .orderByDesc(LanguageDictDO::getCreatedTime));
    }

}