package com.fs.hospital580.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 问诊订单主表
 * </p>
 *
 * @author zhangqin
 * @since 2025-09-30
 */
@Getter
@Setter
@TableName("fs_store_hospital580_prescription_scrm")
@ApiModel(value = "FsStoreHospital580PrescriptionScrmEntity对象", description = "问诊订单主表")
public class Hospital580PrescriptionScrmEntity extends Model<Hospital580PrescriptionScrmEntity> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键ID")
    @TableId(value = "pre_id", type = IdType.AUTO)
    private Long preId;

    @ApiModelProperty("用户id")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty("服务类型：0-图文，1-视频")
    @TableField("service_type")
    private Byte serviceType;

    @ApiModelProperty("是否需要审方：0-不需要，1-需要")
    @TableField("is_examine")
    private Byte isExamine;

    @ApiModelProperty("是否孕妇：0-否，1-是")
    @TableField("is_pregnant_woman")
    private Byte isPregnantWoman;

    @ApiModelProperty("是否哺乳期：0-否，1-是")
    @TableField("is_lactation")
    private Byte isLactation;

    @ApiModelProperty("来源：0-微信小程序，1-APP，2-H5，3-支付宝小程序")
    @TableField("souce_from")
    private Byte souceFrom;

    @ApiModelProperty("用药人姓名")
    @TableField("user_family_name")
    private String userFamilyName;

    @ApiModelProperty("身份证")
    @TableField("user_family_id_card")
    private String userFamilyIdCard;

    @ApiModelProperty("年龄")
    @TableField("user_family_age")
    private Integer userFamilyAge;

    @ApiModelProperty("性别：1-男，2-女")
    @TableField("user_family_gender")
    private Byte userFamilyGender;

    @ApiModelProperty("手机号码")
    @TableField("user_family_phone")
    private String userFamilyPhone;

    @ApiModelProperty("关系：1-本人，2-父母，3-配偶，4-子女，5-其他")
    @TableField("relationship")
    private Byte relationship;

    @ApiModelProperty("就诊人住址（最多30个字符）")
    @TableField("user_family_addr")
    private String userFamilyAddr;

    @ApiModelProperty("图片附件URL，多个以英文逗号隔开")
    @TableField("img_list")
    private String imgList;

    @ApiModelProperty("结束问诊后跳回三方的地址")
    @TableField("third_return_url")
    private String thirdReturnUrl;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("处方id(580)")
    @TableField("pid")
    private Long pid;

    @ApiModelProperty("医院名称")
    @TableField("hospital_name")
    private String hospitalName;

    @ApiModelProperty("药店ID")
    @TableField("store_id")
    private Long storeId;

    @ApiModelProperty("药店名称")
    @TableField("store_name")
    private String storeName;

    @ApiModelProperty("问诊单ID(580)")
    @TableField("diagnosis_id")
    private Long diagnosisId;

    @ApiModelProperty("医生签名时间")
    @TableField("doctor_sign_time")
    private LocalDateTime doctorSignTime;

    @ApiModelProperty("医生ID")
    @TableField("doctor_id")
    private Long doctorId;

    @ApiModelProperty("医生科室")
    @TableField("doctor_office")
    private String doctorOffice;

    @ApiModelProperty("医生姓名")
    @TableField("doctor_name")
    private String doctorName;

    @ApiModelProperty("诊断标签")
    @TableField("tags")
    private String tags;

    @ApiModelProperty("处方状态(1正常 2已作废 )")
    @TableField("status")
    private Byte status;

    @ApiModelProperty("备注")
    @TableField("memo")
    private String memo;

    @ApiModelProperty("说明")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty("审核不通过的理由（可能为空）")
    @TableField("reason")
    private String reason;

    @ApiModelProperty("处方图片地址")
    @TableField("dst_file_path")
    private String dstFilePath;

    @ApiModelProperty("创建时间/开方时间")
    @TableField("created_time")
    private LocalDateTime createdTime;

    @ApiModelProperty("处方编号")
    @TableField("serial_no")
    private String serialNo;

    @ApiModelProperty("处方审核状态:1为待审核，2为审核通过，3为审核不通过")
    @TableField("audit_status")
    private Integer auditStatus;

    @ApiModelProperty("审方时间")
    @TableField("audit_time")
    private LocalDateTime auditTime;

    @ApiModelProperty("审方药师名称")
    @TableField("audit_apothecary_name")
    private String auditApothecaryName;

    @ApiModelProperty("审方药师名称")
    @TableField("audit_apothecary_id")
    private Long auditApothecaryId;

    @ApiModelProperty("问诊知情确认页面URL")
    @TableField("jump_url")
    private String jumpUrl;

    @ApiModelProperty("开方情况0未开方1开方2拒绝")
    @TableField("prescription_status")
    private Byte prescriptionStatus;

    @ApiModelProperty("商城订单id")
    @TableField("store_order_id")
    private Long storeOrderId;

    /**
     * 系统店铺ID
     * **/
    private Long storeSysId;

    /**
     * 系统店铺名称
     * **/
    private String storeSysName;

    //点单编号
    @TableField(exist = false)
    private String orderCode;
    @Override
    public Serializable pkVal() {
        return this.preId;
    }
}
