package com.iamberry.wechat.service.qrcode.dao.impl;

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

import com.iamberry.wechat.core.entity.qrcode.Qrcode;
import com.iamberry.wechat.service.mapper.QrcodeMapper;
import com.iamberry.wechat.service.qrcode.dao.QrcodeDao;

/**
 * @author 何秀刚
 * Class Description: 二维码Dao实现类
 * Create Date:2016年4月18日
 * Update Date:2016年4月18日
 */
@Repository
public class QrcodeDaoImpl implements QrcodeDao {

	@Autowired
	private QrcodeMapper qrcodeMapper;
	public void setQrcodeMapper(QrcodeMapper qrcodeMapper) {
		this.qrcodeMapper = qrcodeMapper;
	}
	
	@Override
	public Qrcode selectQrcodeByQrcodeId(Integer id) {
		// TODO Auto-generated method stub
		return qrcodeMapper.selectQrcodeByQrcodeId(id);
	}

	@Override
	public Integer updateQRcodeStatusByUserOpenid(String openid) {
		// TODO Auto-generated method stub
		return qrcodeMapper.updateQRcodeStatusByUserOpenid(openid);
	}

	@Override
	public Integer updateQRcodeScannNumAndSubNum(Qrcode qrcode) {
		// TODO Auto-generated method stub
		return qrcodeMapper.updateQRcodeScannNumAndSubNum(qrcode);
	}

	@Override
	public Qrcode selectSpareQrcode() {
		// TODO Auto-generated method stub
		return qrcodeMapper.selectSpareQrcode();
	}

	@Override
	public Integer updateQRcodeUserAndStatusById(Qrcode qrcode) {
		// TODO Auto-generated method stub
		return  qrcodeMapper.updateQRcodeUserAndStatusById(qrcode);
	}

	@Override
	public Integer insertQrcode(Qrcode qrcode) {
		// TODO Auto-generated method stub
		return qrcodeMapper.insertQrcode(qrcode);
	}

	@Override
	public Integer updateQrcodeURLByOpenid(Qrcode qrcode) {
		// TODO Auto-generated method stub
		return qrcodeMapper.updateQrcodeURLByOpenid(qrcode);
	}

	@Override
	public String selectQrcodeUrlByReplaceUser(String replaceUserOpenid) {
		// TODO Auto-generated method stub
		return qrcodeMapper.selectQrcodeUrlByReplaceUser(replaceUserOpenid);
	}
}
