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

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.userthemes.KeyboardUserThemesDO;
import org.apache.ibatis.annotations.Mapper;
import com.yolo.keyboard.controller.admin.userthemes.vo.*;

/**
 * 用户主题 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface KeyboardUserThemesMapper extends BaseMapperX<KeyboardUserThemesDO> {

    default PageResult<KeyboardUserThemesDO> selectPage(KeyboardUserThemesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardUserThemesDO>()
                .eqIfPresent(KeyboardUserThemesDO::getThemeId, reqVO.getThemeId())
                .eqIfPresent(KeyboardUserThemesDO::getUserId, reqVO.getUserId())
                .eqIfPresent(KeyboardUserThemesDO::getCreatedAt, reqVO.getCreatedAt())
                .eqIfPresent(KeyboardUserThemesDO::getViewDeleted, reqVO.getViewDeleted())
                .eqIfPresent(KeyboardUserThemesDO::getUpdatedAt, reqVO.getUpdatedAt())
                .orderByDesc(KeyboardUserThemesDO::getId));
    }

}