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

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.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

import lombok.Data;

/**
 * 应用表 Entity
 *
 * @author zhanghaijun
 * @date 2021-06-30 15:40:49
 */
@Data
@TableName("edu_apply")
public class EduApply {
    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;


    /**
     * 应用名称
     */
    @TableField("apply_name")
    private String applyName;

    /**
     * 应用编码与前端应用相匹配
     */
    @TableField("apply_code")
    private String applyCode;

    /**
     * 是否删除，1删除0未删除，默认0
     */
    @TableField("del_flag")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    /**
     * 创建时间
     */
    @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;

    /**
     * 创建人id
     */
    @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;

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


    /**
     * 应用名字
     */
    @TableField(exist = false)
    private String function;

    private transient List<EduApplyFunction> functionList;

}