package com.ifish.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * 优惠券
 * @author Administrator
 *
 */
@Entity
@Table(name="tbl_coupon")
public class Coupon implements Serializable {

	private static final long serialVersionUID = 970686228633163972L;
	/**
	 * 优惠券ID
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="coupon_id")
	private Integer couponId;
	/**
	 * 兑换RMB价值
	 */
	@Column(name="money_value",nullable=false)
	private Integer moneyValue;
	/**
	 * 兑换所需金币
	 */
	@Column(name="need_gold",precision=6,scale=2,nullable=false)
	private BigDecimal needGold;
	/**
	 * 使用兑换券需要消费金额
	 */
	@Column(name="use_need_money",nullable=false)
	private Integer useNeedMoney;
	/**
	 * 用户所能兑换数量
	 */
	@Column(name="upper_limit")
	private Integer upperLimit;
	/**
	 * 优惠券数量
	 */
	@Column(name="coupon_number")
	private Integer couponNumber;
	/**
	 * 文字标签
	 */
	@Column(name="tag_text",length=20)
	private String tagText;
	/**
	 * 有效开始时间
	 */
	@Column(name="valid_start_date")
	@Temporal(TemporalType.DATE)
	private Date validStartDate;
	/**
	 * 有效结束时间
	 */
	@Column(name="valid_end_date")
	@Temporal(TemporalType.DATE)
	private Date validEndDate;
	/**
	 * 更新时间
	 */
	@Column(name="update_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date updateTime;
	/**
	 * 兑换数量
	 */
	@Transient
	private Integer exchangeCount;
	
	public Integer getCouponId() {
		return couponId;
	}
	public void setCouponId(Integer couponId) {
		this.couponId = couponId;
	}
	public Integer getMoneyValue() {
		return moneyValue;
	}
	public void setMoneyValue(Integer moneyValue) {
		this.moneyValue = moneyValue;
	}
	public BigDecimal getNeedGold() {
		return needGold;
	}
	public void setNeedGold(BigDecimal needGold) {
		this.needGold = needGold;
	}
	public Integer getUseNeedMoney() {
		return useNeedMoney;
	}
	public void setUseNeedMoney(Integer useNeedMoney) {
		this.useNeedMoney = useNeedMoney;
	}
	public String getTagText() {
		return tagText;
	}
	public void setTagText(String tagText) {
		this.tagText = tagText;
	}
	public Date getValidStartDate() {
		return validStartDate;
	}
	public void setValidStartDate(Date validStartDate) {
		this.validStartDate = validStartDate;
	}
	public Date getValidEndDate() {
		return validEndDate;
	}
	public void setValidEndDate(Date validEndDate) {
		this.validEndDate = validEndDate;
	}
	public Integer getUpperLimit() {
		return upperLimit;
	}
	public void setUpperLimit(Integer upperLimit) {
		this.upperLimit = upperLimit;
	}
	public Integer getExchangeCount() {
		return exchangeCount;
	}
	public void setExchangeCount(Integer exchangeCount) {
		this.exchangeCount = exchangeCount;
	}
	public Integer getCouponNumber() {
		return couponNumber;
	}
	public void setCouponNumber(Integer couponNumber) {
		this.couponNumber = couponNumber;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
}
