package com.yc.education.service.impl;/**
 * huangpan
 * 2019/10/15
 * energy
 */

import com.github.pagehelper.PageHelper;
import com.yc.education.mapper.OrdersMapper;
import com.yc.education.model.Orders;
import com.yc.education.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *@ClassName OrdersServiceImpl
 *@Description TODO
 *@Author QuZhangJing
 *@Date 2019/10/15 11:36
 *@Version 1.0
 */
@Service
public class OrdersServiceImpl extends BaseService<Orders> implements OrdersService {
    @Autowired
    OrdersMapper ordersMapper;

    @Override
    public List<Orders> getOrdersStartEnd(String startTime, String endTime) {
        return ordersMapper.getOrdersStartEnd(startTime, endTime);
    }

    @Override
    public List<Orders> getOrdersCid(Integer id) {
        return ordersMapper.getOrdersCid(id);
    }

    @Override
    public void delOrderById(Integer id) {
    ordersMapper.deleteByPrimaryKey(id);
    }

    @Override
    public  List<Orders>  getOrdersStartEndId(String startTime, String endTime) {
        return ordersMapper.getOrdersStartEndId(startTime, endTime);
    }

    @Override
    public List<Orders> getOrdersPid(Integer id,Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return ordersMapper.getOrdersPid(id);
    }

    @Override
    public List<Orders> getOrders(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return ordersMapper.getOrders();
    }

    @Override
    public List<Orders> getOrdersStartEndIds(Integer cid, String startTime) {
        return ordersMapper.getOrdersStartEndIds(cid, startTime);
    }

    @Override
    public List<Orders> getOrderCidTime(Integer id, String startTime, String endTime,Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return ordersMapper.getOrderCidTime(id, startTime, endTime);
    }

    @Override
    public List<Orders> getOrderCfpId(Integer cfpid, String startTime, String endTime) {
        return ordersMapper.getOrderCfpId(cfpid, startTime,endTime);
    }

    @Override
    public List<Orders> gethoutai( Integer cid, String startTime, String endTime,Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return ordersMapper.gethoutai( cid, startTime, endTime);
    }

    @Override
    public List<Orders> getYyy(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return ordersMapper.getYyy();
    }

    @Override
    public List<Orders> getCoomsCid(Integer id, String startTime, String endTime, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return ordersMapper.getCoomsCid(id, startTime, endTime);
    }
}
