package com.yolo.keyboard.dal.mysql.i18nmessage;

import java.util.*;

import com.yolo.keyboard.framework.common.pojo.PageResult;
import com.yolo.keyboard.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yolo.keyboard.framework.mybatis.core.mapper.BaseMapperX;
import com.yolo.keyboard.dal.dataobject.i18nmessage.KeyboardI18nMessageDO;
import org.apache.ibatis.annotations.Mapper;
import com.yolo.keyboard.controller.admin.i18nmessage.vo.*;

/**
 * 国际化错误提醒配置 Mapper
 *
 * @author ziin
 */
@Mapper
public interface KeyboardI18nMessageMapper extends BaseMapperX<KeyboardI18nMessageDO> {

    default PageResult<KeyboardI18nMessageDO> selectPage(KeyboardI18nMessagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardI18nMessageDO>()
                .eqIfPresent(KeyboardI18nMessageDO::getCode, reqVO.getCode())
                .eqIfPresent(KeyboardI18nMessageDO::getLocale, reqVO.getLocale())
                .eqIfPresent(KeyboardI18nMessageDO::getMessage, reqVO.getMessage())
                .orderByDesc(KeyboardI18nMessageDO::getId));
    }

}