package com.ltgk.port.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ltgk.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.sql.Time;
import java.util.Date;

/**
 * 值班排班对象 pp_duty_schedule
 *
 * @author Qi ChengBin
 * @date 2025-01-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("pp_duty_schedule")
@ApiModel(value = "值班排班对象", description = "值班排班表")
public class PpDutySchedule extends Model<PpDutySchedule> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "值班排班主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "所属部门ID")
    @TableField(value = "dept_id")
    private Long deptId;

    @ApiModelProperty(value = "所属部门名称")
    @TableField(value = "dept_name", condition = SqlCondition.LIKE)
    @Excel(name = "部门名称")
    private String deptName;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "值班日期")
    @TableField(value = "duty_date")
    private Date dutyDate;

    @ApiModelProperty(value = "值班任务")
    @TableField(value = "duty_task", condition = SqlCondition.LIKE)
    private String dutyTask;

    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "开始时间")
    @TableField(value = "begin_time")
    @Excel(name = "值班开始时间", dateFormat = "HH:mm:ss")
    private Time beginTime;

    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "结束时间")
    @TableField(value = "end_time")
    @Excel(name = "值班结束时间", dateFormat = "HH:mm:ss")
    private Time endTime;

    @ApiModelProperty(value = "值班人员ID")
    @TableField(value = "duty_man_id")
    private String dutyManId;

    @ApiModelProperty(value = "值班人员名称")
    @TableField(value = "duty_man_name", condition = SqlCondition.LIKE)
    @Excel(name = "值班人员名称")
    private String dutyManName;

    @ApiModelProperty(value = "值班人联系方式")
    @TableField(value = "duty_man_phone", condition = SqlCondition.LIKE)
    @Excel(name = "值班人员联系方式")
    private String dutyManPhone;

    @ApiModelProperty(value = "审核状态【0-未审核、1-通过、2-拒绝】")
    @TableField(value = "status")
    private Integer status;

    @ApiModelProperty(value = "审核内容")
    @TableField(value = "audit_content")
    private String auditContent;

    @ApiModelProperty(value = "行政区域编码")
    @TableField(value = "area_code")
    private String areaCode;

    @ApiModelProperty(value = "行政区域名称")
    @TableField(value = "area_name")
    private String areaName;

    @TableLogic(delval = "1", value = "0")
    @TableField(value = "del_flag")
    @ApiModelProperty(value = "删除标志: 0-未删除, 1-已删除")
    private Integer delFlag;

    @ApiModelProperty(value = "创建者")
    @TableField(value = "create_by")
    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_at")
    private Date createAt;

    @ApiModelProperty(value = "更新者")
    @TableField(value = "update_by")
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_at")
    private Date updateAt;

    @ApiModelProperty(value = "备注")
    @TableField(value = "remark")
    private String remark;
}
