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.ProductAppMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

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

    @Autowired private ProductAppMapper productAppMapper;

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

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


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

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