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

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.alibaba.dubbo.config.annotation.Service;
import com.ssj.bean.weixin.card.domain.LibCardDetail;
import com.ssj.dao.weixin.card.dao.ILibCardDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.weixin.card.service.ILibCardService;


@Service(version="1.0")
@Transactional
public class LibCardServiceImpl extends BaseServiceImpl<LibCardDetail, String> implements ILibCardService {

	@Autowired
	private ILibCardDao dao;
	
	@Override
	public PagingAndSortingRepository<LibCardDetail, String> getDao() {
		
		return dao;
	}

	@Override
	public LibCardDetail findByCardIdAndUserCardCode(String cardId, String userCardCode) {
		return dao.findByCardIdAndUserCardCode(cardId,userCardCode);
	}
	
	@Override
	public List<LibCardDetail> findByOpenIdAndCardId(String cardId, String openid,String stat){
		return dao.findByOpenIdAndCardId(cardId,openid,stat);
	}

	@Override
	public void updateCardStatByCarIdAndUserCardCode(String cardStat,
			String cardId, String userCardCode) {
		dao.updateCardStatByCarIdAndUserCardCode(cardStat, cardId, userCardCode);
	}

	@Override
	public LibCardDetail findByUserCardCode(String userCardCode) {
		return dao.findByUserCardCode(userCardCode);
	}
	
	
	


}
