package cn.hmsoft.pay.data.dao;

import org.springframework.stereotype.Component;

import cn.hmsoft.frame.constants.FrameStatus;
import cn.hmsoft.jdbc.core.PlatformDaoSupport;
import cn.hmsoft.pay.data.model.PayMerchantChannel;

@Component
public class PayMerchantChannelDao extends PlatformDaoSupport<PayMerchantChannel> {

	public void init() {
		String sql = "update pay_merchant_channel set mc_status=? ";
		this.updateBySql(sql, FrameStatus.InActive.toString());
	}

	public void setRunning(String merchant_id, String channel_id) {
		String sql = "update pay_merchant_channel set mc_status=? where merchant_id=? and channel_id=?";
		this.updateBySql(sql, FrameStatus.Active.toString(), merchant_id, channel_id);
	}
}
