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

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

/**
 * 人设标签 Mapper
 *
 * @author ziin
 */
@Mapper
public interface KeyboardTagMapper extends BaseMapperX<KeyboardTagDO> {

    default PageResult<KeyboardTagDO> selectPage(KeyboardTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KeyboardTagDO>()
                .likeIfPresent(KeyboardTagDO::getTagName, reqVO.getTagName())
                .eqIfPresent(KeyboardTagDO::getCreatedAt, reqVO.getCreatedAt())
                .eqIfPresent(KeyboardTagDO::getUpdatedAt, reqVO.getUpdatedAt())
                .orderByDesc(KeyboardTagDO::getId));
    }

}