package com.yida.data.common.core.entity.mall;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 账单订单关联项目表 Entity
 *
 * @author ZYJ
 * @date 2022-03-31 14:50:18
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("edu_bill_order_item")
public class EduBillOrderItem implements Serializable {

    private static final long serialVersionUID = 5918088219431508785L;

    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 是否删除，1删除0未删除，默认0
     */
    @ApiModelProperty(value = "是否删除，1删除0未删除，默认0")
    @TableField("del_flag")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_date", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    /**
     * 创建人id
     */
    @ApiModelProperty(value = "创建人id")
    @TableField(value = "create_id", fill = FieldFill.INSERT)
    private Long createId;

    /**
     * 最后修改时间
     */
    @ApiModelProperty(value = "最后修改时间")
    @TableField(value = "update_date", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    /**
     * 最后修改人id
     */
    @ApiModelProperty(value = "最后修改人id")
    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private Long updateId;

    /**
     * 缴费单id
     */
    @ApiModelProperty(value = "缴费单id")
    @TableField("bill_id")
    private Long billId;

    /**
     * 账单订单主键ID
     */
    @ApiModelProperty(value = "账单订单主键ID")
    @TableField("order_id")
    private Long orderId;

    /**
     * 账单项目主键ID
     */
    @ApiModelProperty(value = "账单项目主键ID")
    @TableField("item_id")
    private Long itemId;

    /**
     * 缴费项目名称
     */
    @ApiModelProperty(value = "缴费项目名称")
    @TableField("item_name")
    private String itemName;

    /**
     * 缴费项目金额
     */
    @ApiModelProperty(value = "缴费项目金额")
    @TableField("item_price")
    private BigDecimal itemPrice;
    /**
     * 学生主键ID
     */
    @ApiModelProperty(value = "学生主键ID")
    @TableField("student_id")
    private Long studentId;

    @ApiModelProperty(value = "本次减免金额")
    private BigDecimal reductionPrice;

    @ApiModelProperty("项目选项")
    private transient List<EduBillOrderItemSub> orderItemSubList;
}