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

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.storegoodsinventoryrecord.StoreGoodsInventoryRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.storegoodsinventoryrecord.vo.*;

/**
 * 商品出入库记录 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface StoreGoodsInventoryRecordMapper extends BaseMapperX<StoreGoodsInventoryRecordDO> {

    default PageResult<StoreGoodsInventoryRecordDO> selectPage(StoreGoodsInventoryRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreGoodsInventoryRecordDO>()
                .eqIfPresent(StoreGoodsInventoryRecordDO::getGoodsId, reqVO.getGoodsId())
                .eqIfPresent(StoreGoodsInventoryRecordDO::getCarteenId, reqVO.getCarteenId())
                .eqIfPresent(StoreGoodsInventoryRecordDO::getNumber, reqVO.getNumber())
                .eqIfPresent(StoreGoodsInventoryRecordDO::getWeight, reqVO.getWeight())
                .eqIfPresent(StoreGoodsInventoryRecordDO::getType, reqVO.getType())
                .eqIfPresent(StoreGoodsInventoryRecordDO::getOutType, reqVO.getOutType())
                .betweenIfPresent(StoreGoodsInventoryRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StoreGoodsInventoryRecordDO::getId));
    }

}