package com.lz.modules.equipment.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.utils.PageUtils;
import com.lz.modules.equipment.dao.TCountMapper;
import com.lz.modules.equipment.entity.TCount;
import com.lz.modules.equipment.entity.TCountReq;
import com.lz.modules.equipment.service.TCountService;
import lombok.Builder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* <p>
* 盘点 服务类
* </p>
*
* @author quyixiao
* @since 2020-08-10
*/

@Service
public class TCountServiceImpl extends ServiceImpl<TCountMapper, TCount> implements TCountService {


    @Autowired
	private TCountMapper tCountMapper;



	@Override
	public TCount selectTCountById(Long id){
		return tCountMapper.selectTCountById(id);
	}



	@Override
	public Long insertTCount(TCount tCount){
		return tCountMapper.insertTCount(tCount);
	}



	@Override
	public int updateTCountById(TCount tCount){
		return tCountMapper.updateTCountById(tCount);
	}



	@Override
	public int updateCoverTCountById(TCount tCount){
		return tCountMapper.updateCoverTCountById(tCount);
	}



	@Override
	public int deleteTCountById(Long id){
		return tCountMapper.deleteTCountById(id);
	}

	@Override
	public TCount selectMaxTCount() {
		return tCountMapper.selectMaxCount();
	}

    @Override
    public List<TCount> selectListLimit(int limit) {
        return tCountMapper.selectListLimit(limit);
    }

    @Override
	public PageUtils selectByReq(TCountReq req){
		PageUtils page = PageUtils.startPage(req.getPage(), req.getRows()).doSelect(
				page1 -> tCountMapper.selectByReq(page1, req)
		);
		return page;
	}


}
