package com.yolo.keyboard.dal.mysql.themestyles;
import java.util.*;

import com.yolo.keyboard.controller.admin.themestyles.vo.KeyboardThemeStylesPageReqVO;
import com.yolo.keyboard.dal.dataobject.themestyles.KeyboardThemeStylesDO;
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 org.apache.ibatis.annotations.Mapper;

/**
 * 主题风格 Mapper
 *
 * @author ziin
 */
@Mapper
public interface KeyboardThemeStylesMapper extends BaseMapperX<KeyboardThemeStylesDO> {

    default PageResult<KeyboardThemeStylesDO> selectPage(KeyboardThemeStylesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardThemeStylesDO>()
                .likeIfPresent(KeyboardThemeStylesDO::getStyleName, reqVO.getStyleName())
                .eqIfPresent(KeyboardThemeStylesDO::getCreatedAt, reqVO.getCreatedAt())
                .eqIfPresent(KeyboardThemeStylesDO::getUpdatedAt, reqVO.getUpdatedAt())
                .orderByDesc(KeyboardThemeStylesDO::getId));
    }

}