package com.gxwebsoft.clinic.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * 处方明细表

 *
 * @author 科技小王子
 * @since 2025-10-22 02:01:13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ClinicPrescriptionItem对象", description = "处方明细表")
public class ClinicPrescriptionItem implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "自增ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "关联处方")
    private Integer prescriptionId;

    @Schema(description = "订单编号")
    private String prescriptionNo;

    @Schema(description = "关联药品")
    private Integer medicineId;

    @Schema(description = "药品名称")
    @TableField(exist = false)
    private String medicineName;

    @Schema(description = "规格")
    @TableField(exist = false)
    private String specification;

    @Schema(description = "单位")
    @TableField(exist = false)
    private String unit;

    @Schema(description = "单价")
    @TableField(exist = false)
    private BigDecimal pricePerUnit;

    @Schema(description = "药品")
    @TableField(exist = false)
    private ClinicMedicine clinicMedicine;

    @Schema(description = "剂量（如“10g”）")
    private String dosage;

    @Schema(description = "用法频率（如“每日三次”）")
    private String usageFrequency;

    @Schema(description = "服用天数")
    private Integer days;

    @Schema(description = "购买数量")
    private Integer amount;

    @Schema(description = "单价")
    private BigDecimal unitPrice;

    @Schema(description = "数量")
    private Integer quantity;

    @Schema(description = "排序号")
    private Integer sortNumber;

    @Schema(description = "备注")
    private String comments;

    @Schema(description = "用户id")
    private Integer userId;

    @Schema(description = "租户id")
    private Integer tenantId;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}
