package cn.iocoder.yudao.module.system.dal.mysql.biz;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.store.StoreManagePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.StoreManageDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface StoreManageMapper extends BaseMapperX<StoreManageDO> {

    default PageResult<StoreManageDO> selectPage(StoreManagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreManageDO>()
                .likeIfPresent(StoreManageDO::getStoreNumber, reqVO.getStoreNumber())
                .likeIfPresent(StoreManageDO::getStoreName, reqVO.getStoreName())
                .eqIfPresent(StoreManageDO::getStoreType, reqVO.getStoreType())
                .inIfPresent(StoreManageDO::getTenantId, reqVO.getTenantIds())
                .orderByDesc(StoreManageDO::getId));
    }

}
