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

import com.ssj.bean.weixin.libmy.domain.TbLibBookBase;
import com.ssj.dao.weixin.library.dao.IBookBaseDao;
import com.ssj.dao.weixin.library.dao.ILibJoinQueryDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.weixin.library.service.IBookBaseService;
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 java.util.List;
import java.util.Map;


@Service
public class BookBaseServiceImpl extends BaseServiceImpl<TbLibBookBase, String> implements IBookBaseService {

	@Autowired
	private IBookBaseDao dao;
	
	@Autowired
	private ILibJoinQueryDao  libJoinQueryDao;
	
	@Override
	public PagingAndSortingRepository<TbLibBookBase, String> getDao() {
		
		return dao;
	}

	@Override
	public TbLibBookBase findByIsbn13(String isbn13) {
		
		return dao.findByIsbn13(isbn13);
	}

	@Override
	public List<TbLibBookBase> getBaseCsList(String isbn13) {
		
		return dao.getBaseCsList(isbn13);
	}

	@Override
	public TbLibBookBase getBookcs(String isbn13, String csisbn) {
		
		return dao.getBookcs(isbn13,csisbn);
	}

	@Override
	public Page<Map<String, Object>> findForPageList(Map<String, Object> params, Pageable initPage) {
		
		return libJoinQueryDao.findForBasePageList(params,initPage);
	}

	@Override
	public TbLibBookBase findInsertData(String isbn13) {
		
		return dao.findInsertData(isbn13);
	}

	@Override
	public List<Map<String, Object>> findRecommendBook(int grTotal,int pageSize) {
		
		return libJoinQueryDao.findRecommendBook(grTotal,pageSize);
	}

	

}
