package com.iamberry.wechat.service.coupon;

import java.util.List;

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

import com.iamberry.wechat.core.entity.coupon.CouponItem;
import com.iamberry.wechat.core.entity.coupon.CouponItemDto;
import com.iamberry.wechat.face.coupon.CouponItemService;
import com.iamberry.wechat.service.mapper.CouponItemMapper;
import com.iamberry.wechat.tools.StrUtils;
/**
 * 优惠券类型 service实现
 * 2016年7月6日
 * @author Administrator
 *
 */
@Service
public class CouponItemServiceImpl implements CouponItemService {
	@Autowired
	private CouponItemMapper couponItemMapper;
	
	
	public List<CouponItemDto> getCouponItemDtoList(CouponItemDto couponItemDto) {
		return couponItemMapper.getCouponItemDtoList(couponItemDto);
	}

	
	public Integer getCouponItemCount(CouponItemDto couponItemDto) {
		// TODO Auto-generated method stub
		return couponItemMapper.getCouponItemCount(couponItemDto);
	}

	
	public Integer insertCouponItem(CouponItem couponItem) {
		// TODO Auto-generated method stub
		String uuidStr = StrUtils.getUUID();
		couponItem.setCouponItemId(uuidStr);
		return couponItemMapper.insertCouponItem(couponItem);
	}

	
	public CouponItemDto getCouponItemById(String couponItemId) {
		// TODO Auto-generated method stub
		return couponItemMapper.getCouponItemById(couponItemId);
	}

	
	public Integer updateCouponItemById(CouponItem couponItem) {
		// TODO Auto-generated method stub
		return couponItemMapper.updateCouponItemById(couponItem);
	}

	
	public Integer updateCouponItemList(List<CouponItem> couponItemList) {
		// TODO Auto-generated method stub
		return couponItemMapper.updateCouponItemList(couponItemList);
	}

	@Override
	public List<CouponItemDto> expiredAndNoTake(CouponItemDto couponItemDto) {
		return couponItemMapper.expiredAndNoTake(couponItemDto);
	}
}
