package com.ssj.service.sys.cardinfo.service.impl;

import com.ssj.bean.sys.cardinfo.domain.TbCardInfo;
import com.ssj.dao.sys.cardinfo.dao.ICardInfoDao;
import com.ssj.dao.sys.cardinfo.dao.ICardInfoQueryDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.sys.cardinfo.service.ICardInfoService;
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.Map;


@Service
@Transactional
public class CardInfoServiceImpl extends BaseServiceImpl<TbCardInfo, String> implements ICardInfoService {

	@Autowired
	private ICardInfoDao dao;
	
	@Autowired
	private ICardInfoQueryDao queryDao;
	
	@Override
	public PagingAndSortingRepository<TbCardInfo, String> getDao() {
		return dao;
	}

	@Override
	public TbCardInfo findByUserIdAndState(String userId, int state) {
		return dao.findByUserIdAndState(userId,state);
	}

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

	@Override
	public TbCardInfo findByUserIdValid(String userId) {
		return dao.findByUserIdValid(userId);
	}

	@Override
	public TbCardInfo findByLibId(String joinid) {
		
		return dao.findByLibId(joinid);
	}

	

}
