/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.dm.order.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author sunmz
* @date 2021-09-15
**/
@Entity
@Data
@Table(name="dm_order_record")
public class DmOrderRecord implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private Long id;

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

    @Column(name = "money")
    @ApiModelProperty(value = "实付金额")
    private String money;

    @Column(name = "user_name")
    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @Column(name = "user_type")
    @ApiModelProperty(value = "人员种类")
    private String userType;

    @Column(name = "phone")
    @ApiModelProperty(value = "用户手机号")
    private String phone;

    @Column(name = "order_time")
    @ApiModelProperty(value = "下单时间")
    private Timestamp orderTime;

    @Column(name = "total_money")
    @ApiModelProperty(value = "合计金额")
    private String totalMoney;

    @Column(name = "zk_money")
    @ApiModelProperty(value = "折扣")
    private String zkMoney;

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