package com.bohuikeji.frame.module.admin.entity.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnWayEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 10552
 * @since 2019-10-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SysDept对象", description="")
public class SysDept extends EntityBase {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "dept_id",type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer deptId;

    @ApiModelProperty(value = "上级部门")
    @TableField("super_id")
    @TableShowField("上级部门")
    @TableQueryField(like = false)
    @TableKeyField(key = SysDept.class,keyShowFields = {"deptName","deptNum"},keyLikeFields = {"deptName"})
    @TableNewField(block = SelectBlock.class)
    private Integer superId;

    @ApiModelProperty(value = "部门编号")
    @TableField("dept_num")
    @TableShowField("部门编号")
    @TableQueryField(show = false)
    @TableNewField(show = false,way = ColumnWayEnum.AUTO_ADD)
    private String deptNum;

    @ApiModelProperty(value = "部门名称")
    @TableField("dept_name")
    @TableShowField("部门名称")
    @TableQueryField(show = false)
    @TableNewField
    private String deptName;

    @ApiModelProperty(value = "创建人")
    @TableField("dept_create_user")
    @TableKeyField(key = SysUser.class ,keyShowFields = {"userName"},keyLikeFields = {"userName"})
    @TableQueryField(like = false)
    @TableShowField("创建人")
    @TableNewField(show = false,way = ColumnWayEnum.SESSION_USER)
    private Integer deptCreateUser;

    @ApiModelProperty(value = "创建时间")
    @TableField("dept_create_time")
    @TableShowField("创建时间")
    private LocalDateTime deptCreateTime=LocalDateTime.now();

    @ApiModelProperty(value = "最后一次修改人")
    @TableField("dept_update_user")
    @TableKeyField(key = SysUser.class ,keyShowFields = {"userName"},keyLikeFields = {"userName"})
    @TableShowField("最后一次修改人")
    @TableNewField(show = false,way = ColumnWayEnum.SESSION_USER)
    private Integer deptUpdateUser;

    @ApiModelProperty(value = "最后一次修改时间")
    @TableField("dept_update_time")
    @TableShowField("最后一次修改时间")
    private LocalDateTime deptUpdateTime;

    @ApiModelProperty(value = "删除标记")
    @TableField("delete_flag")
    /*@TableShowField("删除标记")
    @TableNewField*/
    private Boolean deleteFlag;


}
