package cn.iocoder.yudao.module.member.dal.mysql.storesalegoods;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.storesalegoods.StoreSaleGoodsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.storesalegoods.vo.*;

/**
 * 售卖商品 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface StoreSaleGoodsMapper extends BaseMapperX<StoreSaleGoodsDO> {

    default PageResult<StoreSaleGoodsDO> selectPage(StoreSaleGoodsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreSaleGoodsDO>()
                .eqIfPresent(StoreSaleGoodsDO::getGoodsId, reqVO.getGoodsId())
                .eqIfPresent(StoreSaleGoodsDO::getNumber, reqVO.getNumber())
                .eqIfPresent(StoreSaleGoodsDO::getEquipmentCode, reqVO.getEquipmentCode())
                .betweenIfPresent(StoreSaleGoodsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StoreSaleGoodsDO::getId));
    }

}