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

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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@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);
	}
	
	
	


}
