package com.qmth.qrzk.repository.user.service.impl;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.qmth.qrzk.dao.IPaperBatchDao;
import com.qmth.qrzk.repository.common.base.BaseDao;
import com.qmth.qrzk.repository.service.query.PaperBatchParams;
import com.qmth.qrzk.repository.user.model.PaperBatch;
import com.qmth.qrzk.repository.user.service.IPaperBatchService;

@Service("paperBatchServiceImpl")
public class PaperBatchServiceImpl implements IPaperBatchService {

	@Autowired
	@Qualifier("paperBatchDaoImpl")
	private IPaperBatchDao paperBatchDaoImpl;
	
	@Autowired
	private BaseDao baseDao;
	
	
	public List<PaperBatch> queryBatch(PaperBatchParams params) {
		return baseDao.getPagerList("queryBatch", params);
	}


	public int insertBatch(PaperBatch pb) {
		pb.setCreatedTime(new Date());
		pb.setUpdatedTime(new Date());
		return paperBatchDaoImpl.insertBatch(pb);
	}


	public int getCount(PaperBatchParams params) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.getCount(params);
	}


	public List<PaperBatch> findByCondition(PaperBatch pb) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.findByCondition(pb);
	}


	public List<PaperBatch> findByType(PaperBatch pb, String type1,
			String type2, String type3) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.findByType(pb, type1, type2, type3);
	}


	public PaperBatch findById(int batchId) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.findById(batchId);
	}


	public PaperBatch findTypeById(int id) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.findTypeById(id);
	}


	public List<PaperBatch> findAllBatch() {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.findAllBatch();
	}


	public int isSameCode(String code) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.isSameCode(code);
	}


	@Override
	public int deleteBatch(int id) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.deleteBatch(id);
	}


	@Override
	public int updateTime(PaperBatch pb) {
		// TODO Auto-generated method stub
		return paperBatchDaoImpl.updateTime(pb);
	}

}
