package me.zhengjie.modules.dm.order.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Data
@Table(name="dm_order_payment")
public class DmOrderPayment implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "bh")
    @ApiModelProperty(value = "编号")
    private String bh;

    @Column(name = "type")
    @ApiModelProperty(value = "type")
    private String type;

    @Column(name = "amt")
    @ApiModelProperty(value = "商品售价")
    private Double amt;

    @Column(name = "balance")
    @ApiModelProperty(value = "余额")
    private Double balance;

    @Column(name = "uid")
    @ApiModelProperty(value = "uid")
    private String uid;

    public void copy(DmOrderPayment source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
