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

import com.yida.data.common.core.entity.user.EduStudent;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 请假表 Entity
 * @author ccl
 * @date 2021-11-22 16:27:42
 */
@Data
@TableName("edu_leave_request")
public class EduLeaveRequest {

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

    /**
     * 学生id
     */
    @TableField("student_id")
    private Long studentId;

    /**
     * 家长名字
     */
    @TableField("student_name")
    private String studentName;

    /**
     * 家长id
     */
    @TableField("parent_id")
    private Long parentId;

    /**
     * 家长名字
     */
    @TableField("parent_name")
    private String parentName;

    /**
     * 教师id
     */
    @TableField("teacher_id")
    private Long teacherId;

    /**
     * 教师名字
     */
    @TableField("teacher_name")
    private String teacherName;

    /**
     * 请假理由
     */
    @TableField("reason")
    private String reason;


    @TableField("pic_url")
    private String picUrl;

    /**
     * 开始时间
     */
    @TableField("start_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @TableField("end_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime endTime;

    /**
     * 审核时间
     */
    @TableField("check_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime checkTime;

    /**
     * 状态
     */
    @TableField("status")
    private Integer status;

    /**
     * 学校
     */
    @TableField("school_id")
    private Long schoolId;

    /**
     * 学区Id
     */
    @TableField("camps_id")
    private Long campsId;


    /**
     * 学段Id
     */
    @TableField("section_id")
    private Long sectionId;

    /**
     * 年级Id
     */
    @TableField("grade_id")
    private Long gradeId;

    /**
     * 班级Id
     */
    @TableField("class_id")
    private Long classId;

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

    /**
     *
     */
    @TableField(value = "create_id", fill = FieldFill.INSERT)
    private Long createId;

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

    /**
     *
     */
    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private Long updateId;

    /**
     * 0为未删除，1为已删除
     */
    @TableField("del_flag")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;


    @TableField(exist = false)
    private EduStudent student;
}