package com.qmth.qrzk.dao.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.qmth.qrzk.dao.ICodeBookDao;
import com.qmth.qrzk.repository.common.mapper.CodeBookMapper;
import com.qmth.qrzk.repository.user.model.CodeBook;

@Repository("codeBookImpl")
@Transactional
public class CodeBookImpl implements ICodeBookDao {

	//注入roleMapper提供操作数据库的sql语句
	@Autowired
	@Qualifier("codeBookMapper")
	private CodeBookMapper codeBookMapper;

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return codeBookMapper.getCount();
	}

	@Override
	public void insertCodeBook(List<CodeBook> list) {
		codeBookMapper.insertCodeBook(list);
	}

	@Override
	public void deleteCodeBook(CodeBook cb) {
		// TODO Auto-generated method stub
		codeBookMapper.deleteCodeBook(cb);
	}

	@Override
	public List<CodeBook> getAllCodeBook() {
		// TODO Auto-generated method stub
		return codeBookMapper.getAllCodeBook();
	}

	@Override
	public List<CodeBook> findByRandomCode(String randomCode) {
		// TODO Auto-generated method stub
		return codeBookMapper.findByRandomCode(randomCode);
	}

	@Override
	public int validatePassword(CodeBook cb) {
		// TODO Auto-generated method stub
		return codeBookMapper.validatePassword(cb);
	}

}
