package com.ssj.service.weixin.problem.service.impl;

import com.ssj.bean.weixin.problem.domain.Artice;
import com.ssj.dao.weixin.problem.dao.ArticeDao;
import com.ssj.dao.weixin.problem.dao.YdzQueryDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.weixin.problem.service.ArticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class ArticeServiceImpl extends BaseServiceImpl<Artice, String> implements ArticeService{
	@Autowired
	private ArticeDao  articeDao;
	@Autowired
	private YdzQueryDao  ydzQueryDao;
	
	@Override
	public PagingAndSortingRepository<Artice, String> getDao() {
		return articeDao;
	}
	@Override
	public Page<Map<String, Object>> findArticePage(
			Map<String, Object> searchParams, Pageable pageable) {
		return ydzQueryDao.findArticePage(searchParams, pageable);
	}
	@Override
	public Integer countType() {
		return (int) articeDao.count();
	}
	@Override
	public void updatenum(String id, Integer number) {
		articeDao.updatenum(id, number);
		
	}
	@Override
	public Artice findInfoByName(String grad) {
		
		return articeDao.findInfoByName(grad);
	}
	@Override
	public List<Artice> findArticeList(String grade, int version) {
		
		return articeDao.findArticeList(grade,version);
	}

}
