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

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

/**
 * 小程序商品购物车 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface StoreShoppingCartMapper extends BaseMapperX<StoreShoppingCartDO> {

    default PageResult<StoreShoppingCartDO> selectPage(StoreShoppingCartPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreShoppingCartDO>()
                .eqIfPresent(StoreShoppingCartDO::getNumber, reqVO.getNumber())
                .eqIfPresent(StoreShoppingCartDO::getGoodsId, reqVO.getGoodsId())
                .eqIfPresent(StoreShoppingCartDO::getUserId, reqVO.getUserId())
                .eqIfPresent(StoreShoppingCartDO::getCarteenId, reqVO.getCarteenId())
                .eqIfPresent(StoreShoppingCartDO::getSelected, reqVO.getSelected())
                .betweenIfPresent(StoreShoppingCartDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StoreShoppingCartDO::getId));
    }

}