TdCCouponRuleCustidCarnumRelDaoImpl.java 1.46 KB
package com.zteits.pay.dao.impl;

import com.zteits.pay.domain.*;
import com.zteits.pay.mapper.TdCCouponRuleCustidCarnumRelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class TdCCouponRuleCustidCarnumRelDaoImpl {

	@Autowired
	private TdCCouponRuleCustidCarnumRelMapper tdCCouponRuleCustidCarnumRelMapper;

	public List<TdCCouponRuleCustidCarnumRel> getListByCardNo(String cardNo){
		TdCCouponRuleCustidCarnumRelExample example = new TdCCouponRuleCustidCarnumRelExample();
		example.createCriteria().andCardNoEqualTo(cardNo);
		return tdCCouponRuleCustidCarnumRelMapper.selectByExample(example);
	}

	public List<TdCCouponRuleCustidCarnumRel> getList(TdCCouponRuleCustidCarnumRel rel){
		TdCCouponRuleCustidCarnumRelExample example = new TdCCouponRuleCustidCarnumRelExample();
		example.createCriteria()
				.andCardNoEqualTo(rel.getCardNo())
				.andCustIdEqualTo(rel.getCustId());
		return tdCCouponRuleCustidCarnumRelMapper.selectByExample(example);
	}

	public int delTdCCouponRuleCustidCarnumRel(List iDs) {
		TdCCouponRuleCustidCarnumRelExample example = new TdCCouponRuleCustidCarnumRelExample();
		example.createCriteria().andIdIn(iDs);
		return tdCCouponRuleCustidCarnumRelMapper.deleteByExample(example);
	}

	public Integer insertTdCCouponRuleCustidCarnumRel(TdCCouponRuleCustidCarnumRel rel) {
		return tdCCouponRuleCustidCarnumRelMapper.insertSelective(rel);
	}

}