package com.yc.ship.module.miniapplet.dal.mysql.brand;


import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.miniapplet.controller.admin.brand.vo.AppletBrandPageReqVO;
import com.yc.ship.module.miniapplet.dal.dataobject.brand.AppletBrandDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 小程序系统配置 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface AppletBrandMapper extends BaseMapperX<AppletBrandDO> {

    default PageResult<AppletBrandDO> selectPage(AppletBrandPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppletBrandDO>()
                .eqIfPresent(AppletBrandDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(AppletBrandDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppletBrandDO::getId));
    }

    default AppletBrandDO selectOne() {
        return selectOne(new LambdaQueryWrapperX<AppletBrandDO>()
                .last("LIMIT 1"));
    }
}