package com.jeequan.jeepay.service.impl;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeequan.jeepay.db.entity.PackageOrder;
import com.jeequan.jeepay.service.mapper.PackageOrderMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 产品分类表 服务实现类
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2022-03-12
 */
@Service
public class PackageOrderService extends ServiceImpl<PackageOrderMapper, PackageOrder> {

    public Page<PackageOrder> getList(Page<PackageOrder>page, PackageOrder packageOrder) {
        page.addOrder(OrderItem.desc("po.created_at"));
        return baseMapper.getPage(page, packageOrder);
    }

    public int getProductAppCheckNumber(String mchNo){
        return baseMapper.getPackageOrderCheckNumber(mchNo);
    }


    public PackageOrder getDetail(String id){
        return baseMapper.getDetail(id);
    }

    public List<PackageOrder> getList(String productId, String mchNo){
        return baseMapper.getList(productId,mchNo);
    }
}
