package com.neusoft.smart.pos.payorder.repository;


import com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayDetail;
import com.neusoft.smart.pos.payorder.persistent.domain.TradeMchPayDetailExample;
import com.neusoft.smart.pos.payorder.persistent.mapper.TradeMchPayDetailMapper;
import lombok.val;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author zcf
 * @date 2018-02-23 10：43
 * @description 商户支付配置信息详情管理使用Repository
 */
@Component
public class TradeMchPayDetailRepository {

	@Resource
	private TradeMchPayDetailMapper tradeMchPayDetailMapper;
	
	public TradeMchPayDetail queryOrderByOrderNumber(Integer orgId, Integer shopId, String payType){
		val example = new TradeMchPayDetailExample();
		example.createCriteria()
				.andOrgIdEqualTo(orgId)
				.andShopIdEqualTo(shopId)
				.andPayTypeEqualTo(payType);
		val tradeMchPayDetails = tradeMchPayDetailMapper.selectByExample(example);
		return tradeMchPayDetails.size()>0?tradeMchPayDetails.get(0):null;
	}
}
