package com.ltgk.video.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ltgk.common.annotation.Excel;
import com.ltgk.common.validation.groups.Detail;
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 org.springframework.format.annotation.DateTimeFormat;

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

/**
 * <p>
 * 视频监控方案数据表
 * </p>
 *
 * @author zhouyaoyao
 * @since 2025-01-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ds_video_plan")
@ApiModel(value = "DsVideoPlan对象", description = "视频监控方案数据表")
public class DsVideoPlan extends Model<DsVideoPlan> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "视频监控方案主键不能为空", groups = {Detail.class, Update.class})
    private Integer id;

    @ApiModelProperty(value = "方案名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "方案布局")
    @TableField("layout")
    private String layout;

    @ApiModelProperty(value = "摄像头列表")
    @TableField("videos")
    private String videos;

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

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

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

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

    @ApiModelProperty(value = "编辑人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty(value = "删除标记")
    @TableField("del_flag")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    @ApiModelProperty(value = "行政区域编码")
    @Excel(name = "行政区域名称", required = true)
    private String areaCode;

    @ApiModelProperty(value = "行政区域名称")
    @Excel(name = "行政区域名称", required = true)
    private String areaName;

    /**
     * 页容量
     */
    @TableField(exist = false)
    @JsonIgnore
    private Integer pageSize;

    /**
     * 页码
     */
    @TableField(exist = false)
    @JsonIgnore
    private Integer pageNum;
}
