package com.xxfc.platform.order.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import tk.mybatis.mapper.annotation.Version;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 *
 *
 * @author zjw
 * @email nishijjo@qq.com
 * @date 2019-06-15 11:35:33
 */
@Data
@Table(name = "base_order")
public class BaseOrder implements Serializable {
	private static final long serialVersionUID = 1L;
	public static final int ORDER_TYPE_VEHICLE = 1;

	public static final int ORDER_SIGN_NORMAL = 1;
	public static final int ORDER_SIGN_APPLY = 2;
	public static final int ORDER_SIGN_SPECIAL = 3;

	public static final int INSURE_STATUS_NOT = 0;
	public static final int INSURE_STATUS_BUY = 1;
	public static final int INSURE_STATUS_CNL = 2;

	    /**
    *  主键
   */
    @Id
	@GeneratedValue(generator = "JDBC")
	@ApiModelProperty("主键")
    private Integer id;

	    /**
     *  订单号
     */
    @Column(name = "no")
	@ApiModelProperty(value = "订单号")
    private String no;

	    /**
     *  名称
     */
    @Column(name = "name")
	@ApiModelProperty(value = "名称")
    private String name;

	    /**
     *  订单类型 1--租车；2--旅游
     */
    @Column(name = "type")
	@ApiModelProperty(value = "订单类型 1--租车；2--旅游; 3--会员订单")
    private Integer type;

	    /**
     *  订单详情id
     */
    @Column(name = "detail_id")
	@ApiModelProperty(value = "订单详情id")
    private Integer detailId;

    @Column(name = "status")
	@ApiModelProperty(value = "订单状态"
		+"0--删除"
		+"1--创建订单"
		+"2--取消"
		+"3--待付款"
		+"4--待出行"
		+"5--出行中（进行中）"
		+"6--已完成")
    private Integer status;

	    /**
     *  商品价格
     */
    @Column(name = "goods_amount")
	@ApiModelProperty(value = "商品价格")
    private BigDecimal goodsAmount;

	    /**
     *  订单总金额
     */
    @Column(name = "order_amount")
	@ApiModelProperty(value = "订单总金额")
    private BigDecimal orderAmount;

	    /**
     *  实际价格
     */
    @Column(name = "real_amount")
	@ApiModelProperty(value = "实际价格")
    private BigDecimal realAmount;

	    /**
     *  第三方类型（支付渠道）
     */
    @Column(name = "third_type")
	@ApiModelProperty(value = "第三方类型（支付渠道）")
    private Integer thirdType;

	    /**
     *  流水号
     */
    @Column(name = "out_trade_no")
	@ApiModelProperty(value = "流水号")
    private String outTradeNo;

	    /**
     *  订单图片
     */
    @Column(name = "picture")
	@ApiModelProperty(value = "订单图片")
    private String picture;

	    /**
     *  创建时间
     */
    @Column(name = "crt_time")
	@ApiModelProperty(value = "创建时间", hidden = true )
    private Date crtTime;

	    /**
     *  创建者id
     */
    @Column(name = "crt_user")
	@ApiModelProperty(value = "创建者id")
    private String crtUser;

	    /**
     *  创建者名称
     */
    @Column(name = "crt_name")
	@ApiModelProperty(value = "创建者名称")
    private String crtName;

	    /**
     *  用户id
     */
    @Column(name = "user_id")
	@ApiModelProperty(value = "用户id")
    private Integer userId;

	    /**
     *  更新时间
     */
    @Column(name = "upd_time")
	@ApiModelProperty(value = "更新时间", hidden = true )
    private Date updTime;

	    /**
     *  创建者ip
     */
    @Column(name = "crt_host")
	@ApiModelProperty(value = "创建者ip")
    private String crtHost;

	    /**
     *  取消原因
     */
    @Column(name = "cancel_reason")
	@ApiModelProperty(value = "取消原因")
    private String cancelReason;

	    /**
     *  退款流水号
     */
    @Column(name = "refund_trade_no")
	@ApiModelProperty(value = "退款流水号")
    private String refundTradeNo;

	    /**
     *  支付时间
     */
    @Column(name = "pay_time")
	@ApiModelProperty(value = "支付时间")
    private Long payTime;

	    /**
     *  退款时间
     */
    @Column(name = "refund_time")
	@ApiModelProperty(value = "退款时间")
    private Long refundTime;

	/**
	 *  退款状态
	 */
	@Column(name = "refund_status")
	@ApiModelProperty(value = "退款的状态 0--未退还；1--已退还所有钱；2--已退还部分押金（保留违章预备金）；3--已退还所有押金（扣除该扣除的）")
	private Integer refundStatus;

	/**
	 *  是否有优惠
	 */
	@Column(name = "has_discount")
	@ApiModelProperty(value = "是否有优惠 0--无优惠；1--有优惠")
	private Integer hasDiscount;

	/**
	 *  是否有优惠
	 */
	@Column(name = "has_member_right")
	@ApiModelProperty(value = "是否有使用会员权益")
	private Integer hasMemberRight;

	/**
	 *  是否已支付
	 */
	@Column(name = "has_pay")
	@ApiModelProperty(value = "是否已支付")
	private Integer hasPay;

    /**
     * 乐观锁,修改版本号
     */
    @ApiModelProperty(value = "乐观锁,修改版本号")
    @Version
    private Integer version;

	/**
	 * 下单来源 1--app；2--小程序
	 */
	@ApiModelProperty(value = "下单来源 1--app；2--小程序")
	@Column(name = "order_origin")
	private Integer orderOrigin;

	/**
	 * 支付来源 1--app；2--小程序
	 */
	@ApiModelProperty(value = "支付来源 1--app；2--小程序")
	@Column(name = "pay_origin")
	private Integer payOrigin;

	/**
	 * 优惠券优惠的价格
	 */
	@ApiModelProperty(value = "优惠券优惠的价格")
	@Column(name = "coupon_amount")
	private BigDecimal couponAmount;

	/**
	 * 使用的优惠券票号，逗号分割
	 */
	@ApiModelProperty(value = "使用的优惠券票号，逗号分割")
	@Column(name = "coupon_ticker_nos")
	private String couponTickerNos;

	/**
	 * 下单时的会员等级
	 */
	@ApiModelProperty(value = "下单时的会员等级")
	@Column(name = "member_level")
	private Integer memberLevel;

	/**
	 * 违约金
	 */
	@ApiModelProperty(value = "违约金")
	@Column(name = "violate_amount")
	BigDecimal ViolateAmount;

	/**
	 * 赔偿金
	 */
	@ApiModelProperty(value = "赔偿金")
	@Column(name = "damages_amount")
	BigDecimal damagesAmount;

	/**
	 * 额外费用
	 */
	@ApiModelProperty(value = "额外费用")
	@Column(name = "extra_amount")
	BigDecimal extraAmount;

	/**
	 * 返还的优惠券
	 */
	@ApiModelProperty(value = "返回的优惠券")
	@Column(name = "back_coupon")
	String backCoupon;

	/**
	 * 促成人后台管理系统用户id
	 */
	@ApiModelProperty(value = "促成人后台管理系统用户id")
	@Column(name = "facilitate_id")
	Integer facilitateId;

	/**
	 * 促成人联系方式
	 */
	@ApiModelProperty(value = "促成人联系方式")
	@Column(name = "facilitate_phone")
	String facilitatePhone;

	/**
	 *  1:微信公众号支付 2.支付宝即时到账,3,银联
	 */
	@ApiModelProperty(value = "1:微信公众号支付 2.支付宝即时到账,3,银联")
	@Column(name = "pay_way")
	private Integer payWay;

	/**
	 * 备注
	 */
	@ApiModelProperty(value = "备注")
	@Column(name = "remark")
	private Integer remark;

	/**
	 * 上级id
	 */
	@ApiModelProperty(value = "上级id")
	@Column(name = "parent_user_id")
	private Integer parentUserId;

	/**
	 * 上级公司id
	 */
	@ApiModelProperty(value = "上级公司id")
	@Column(name = "parent_user_company_id")
	private Integer parentUserCompanyId;

	/**
	 * 上级公司员工id
	 */
	@ApiModelProperty(value = "上级公司员工id")
	@Column(name = "parent_position_id")
	private Integer parentPositionId;

	/**
	 * 是否开票
	 */
	@Column(name = "invoice_status")
	private Integer invoiceStatus;

	/**
	 * 开票记录Id
	 */
	@Column(name = "invoice_id")
	private Integer invoiceId;


	@Column(name = "revenue_json")
	private String revenueJson;

	@Column(name = "goods_type")
	private Integer goodsType;

	@Column(name = "user_phone")
	private String userPhone;

	@Column(name = "realname")
	private String realname;

	@Column(name = "order_sign")
	private Integer orderSign;

	@Column(name = "is_appraise")
	private Integer isAppraise;

	@Column(name = "insure_pic")
	private String insurePic;

	@Column(name = "insure_status")
	private Integer insureStatus;

	@Column(name = "person_insure_amount")
	private BigDecimal personInsureAmount;
}
