package cn.newfeifan.mall.sale.dal.mysql.shopstatus;

import cn.newfeifan.mall.framework.common.pojo.PageResult;
import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
import cn.newfeifan.mall.sale.controller.admin.shopstatus.vo.ShopStatusPageReqVO;
import cn.newfeifan.mall.sale.dal.dataobject.shopstatus.ShopStatusDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 店铺状态 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface ShopStatusMapper extends BaseMapperX<ShopStatusDO> {

    default PageResult<ShopStatusDO> selectPage(ShopStatusPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopStatusDO>()
                .likeIfPresent(ShopStatusDO::getName, reqVO.getName())
                .betweenIfPresent(ShopStatusDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopStatusDO::getId));
    }

}