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

import java.util.Map;

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 com.alibaba.dubbo.config.annotation.Service;
import com.ssj.bean.weixin.card.domain.LibCardInfo;
import com.ssj.dao.weixin.card.dao.ILibMainCardDao;
import com.ssj.dao.weixin.card.dao.LibMainCardQuery;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.weixin.card.service.ILibMainCardService;


@Service(version="1.0")
public class LibMainCardServiceImpl extends BaseServiceImpl<LibCardInfo, String> implements ILibMainCardService {

	@Autowired
	private ILibMainCardDao dao;
	
	@Autowired
	private LibMainCardQuery queryDao;
	
	@Override
	public PagingAndSortingRepository<LibCardInfo, String> getDao() {
		
		return dao;
	}

	@Override
	public LibCardInfo findByCardId(String cardId) {
		
		return dao.findByCardId(cardId);
	}

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

	@Override
	public void updateCardStat(String cardType, String stat) {
		
		dao.updateCardStat(cardType,stat);
	}

	@Override
	public LibCardInfo findByCardTypeAndStat(String cardType, String stat) {
		return dao.findByCardTypeAndStat(cardType, stat);
	}


	

}
