package com.bjtdba.order.service.impl;

import com.bjtdba.order.dao.MerchantDao;
import com.bjtdba.order.dao.StoreOrderMapperDao;
import com.bjtdba.order.service.StoreOrderService;
import com.bjtdba.order.vo.StoreGroupOrderVo;
import com.bjtdba.order.vo.StoreOrderProductVo;
import com.bjtdba.order.vo.StoreOrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service("storeOrderService")
public class StoreOrderServiceImpl implements StoreOrderService {

    @Autowired
    private MerchantDao merchantDao;
    @Autowired
    private StoreOrderMapperDao storeOrderMapperDao;

    public  Integer[] getMeridsMerchantType(Integer num){
        return merchantDao.getMeridsMerchantType(num);
    }

    public int  querycount(Long uid, Integer status, Integer paid, Integer[] merIds){
        return storeOrderMapperDao.querycount(uid,status,paid,merIds);
    }

    public List<StoreOrderVo> queryStoreOrderList(Long uid, Integer status, Integer paid, Integer[] merIds){
        return storeOrderMapperDao.queryStoreOrderList(uid,status,paid,merIds);
    }

    public List<StoreOrderProductVo> getStoreOrderPorduct(Integer[] orderIds){
        return storeOrderMapperDao.getStoreOrderPorduct(orderIds);
    }

    public Date getChangeTime(Long orderId){
        return  storeOrderMapperDao.getChangeTime(orderId);
    }

    public List<StoreGroupOrderVo>  getStoreGroupOrder(Long uid, Integer paid, Integer isdel){
        Integer[] merIds=merchantDao.getMeridsMerchantType(2);
        return storeOrderMapperDao.getStoreGroupOrder(uid,paid,isdel,merIds);
    }

    public Integer[] getOrderIds(Long groupOrderId){
        return storeOrderMapperDao.getOrderIds(groupOrderId);
    }

}
