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.ltgk.common.annotation.Excel;
import com.ltgk.common.validation.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.util.Date;

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

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "值班日志主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotNull(message = "值班日志主键不能为空！", groups = Update.class)
    private String id;

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

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

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

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

    @ApiModelProperty(value = "值班人联系方式")
    @TableField(value = "duty_person_phone", condition = SqlCondition.LIKE)
    @Excel(name = "值班人电话", sort = 2)
    private String dutyPersonPhone;

    @ApiModelProperty(value = "值班情况")
    @TableField(value = "duty_situation", condition = SqlCondition.LIKE)
    private String dutySituation;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "开始时间")
    @TableField(value = "begin_time")
    @Excel(name = "上班时间", sort = 4, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date beginTime;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "结束时间")
    @TableField(value = "end_time")
    @Excel(name = "下班时间", sort = 5, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "交接时间")
    @TableField(value = "handover_time")
    @Excel(name = "交接时间", sort = 6, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date handoverTime;

    @ApiModelProperty(value = "交接人ID")
    @TableField(value = "handover_person_id")
    private String handoverPersonId;

    @ApiModelProperty(value = "交接人姓名")
    @TableField(value = "handover_person_name", condition = SqlCondition.LIKE)
    @Excel(name = "交班人员", sort = 3)
    private String handoverPersonName;

    @ApiModelProperty(value = "交接人联系方式")
    @TableField(value = "handover_person_phone", condition = SqlCondition.LIKE)
    private String handoverPersonPhone;

    @ApiModelProperty(value = "提出问题")
    @TableField(value = "ask_questions", condition = SqlCondition.LIKE)
    private String askQuestions;

    @ApiModelProperty(value = "是否确认;【0-没有确认，1-已确认】")
    @TableField(value = "be_verify")
    private Integer beVerify;

    @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;

    @ApiModelProperty(value = "值班统计页面使用 - 值班工时")
    @TableField(exist = false)
    private Integer onDutyHours;
}
