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

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

import java.util.List;

/**
 *@ClassName CoomserviceImpl
 *@Description TODO
 *@Author QuZhangJing
 *@Date 2019/10/15 11:36
 *@Version 1.0
 */
@Service
public class CoomserviceImpl extends BaseService<Coom> implements CoomService {
    @Autowired
    CoomMapper coomMapper;

    @Override
    public List<Coom> getCooms() {
        return coomMapper.getCooms();
    }

    @Override
    public Coom getCoomsById(Integer id) {
        return coomMapper.getCoomsById(id);
    }

    @Override
    public void delCoomById(Integer id) {
    coomMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Coom> getCoomId(Integer cid, Integer id) {
        return coomMapper.getCoomId(cid, id);
    }

    @Override
    public List<Coom> getCoomCid(Integer cid) {
        return coomMapper.getCoomCid(cid);
    }

    @Override
    public List<Coom> selCoomid(Integer id) {
        return coomMapper.selCoomid(id);
    }

    @Override
    public List<Coom> getCoomt(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return coomMapper.getCooms();
    }
    @Override
    public List<Coom> getIdNotIn(Integer id, String startTime, String endTime, Integer pageNum, Integer pageSize, Integer cid) {
        PageHelper.startPage(pageNum, pageSize);
        return coomMapper.getIdNotIn(id, startTime, endTime, cid);
    }

    @Override
    public List<Coom> getCoomsPage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return coomMapper.getCoomsPage();
    }
}
