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


import com.neusoft.smart.pos.trade.persistent.domain.BillRuleDict;
import com.neusoft.smart.pos.trade.persistent.domain.BillRuleDictExample;
import com.neusoft.smart.pos.trade.persistent.domain.BillSettlementRule;
import com.neusoft.smart.pos.trade.persistent.domain.BillSettlementRuleExample;
import com.neusoft.smart.pos.trade.persistent.mapper.BillRuleDictMapper;
import lombok.val;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zcf
 * @date 2018-11-08 10：43
 * @description 系统默认规则管理使用Repository
 */
@Component
public class BillRuleRepository {

	@Resource
	private BillRuleDictMapper billRuleDictMapper;
	
	/**
	 * 系统默认规则列表查询方法
	 * @return
	 */
	public List<BillRuleDict> queryBillRules(){
		val example = new BillRuleDictExample();
		return billRuleDictMapper.selectByExample(example);
	}
	
	/**
	 * 系统规则查询方法
	 * @return
	 */
	public BillRuleDict queryBillRuleDictById(Integer ruleId){
		return  billRuleDictMapper.selectByPrimaryKey(ruleId);
	}

}
