package com.iamberry.wechat.service.member.dao.imp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.iamberry.wechat.core.entity.member.ShareInfo;
import com.iamberry.wechat.service.mapper.ShareInfoMapper;
import com.iamberry.wechat.service.member.dao.ShareInfoDao;

@Service
public class ShareInfoDaoImpl implements ShareInfoDao {
	@Autowired
	private ShareInfoMapper shareInfoMapper;
	@Override
	public int addShareInfo(ShareInfo share) {
		return shareInfoMapper.addShareInfo(share);
	}

	/**
	 * 根据openid 和用户类型 查询一个分享
	 * create date 2016年5月26日
	 * @author 穆再兴
	 * @param shareInfo
	 * @return
	 */
	public ShareInfo getShareInfoByOpenidAndType(ShareInfo shareInfo){
		return shareInfoMapper.getShareInfoByOpenidAndType(shareInfo);
	}
	
	/**
	 * 根据openid 和用户类型 查询一个分享信息
	 * create date 2016年6月3日
	 * @author 穆再兴
	 * @param shareId
	 * @return
	 */
	public ShareInfo getShareInfoById(Integer shareId){
		return shareInfoMapper.getShareInfoById(shareId);
	}
}
