package com.bonus.canteen.core.device.door.model;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.time.LocalDateTime;

@TableName("dc_group_door")
@ApiModel(
   value = "DcGroupDoor对象",
   description = ""
)
public class DcGroupDoor implements Serializable {
   private static final long serialVersionUID = 1L;
   @TableId(
      value = "id",
      type = IdType.AUTO
   )
   private Integer id;
   @ApiModelProperty("是否允许通行")
   private Integer access;
   @ApiModelProperty("群组id")
   private Integer groupId;
   @ApiModelProperty("门id")
   private Long doorId;
   @ApiModelProperty("时区id")
   private Integer timeZoneId;
   @ApiModelProperty("创建时间")
   @TableField(
      fill = FieldFill.INSERT
   )
   private LocalDateTime crtime;
   @ApiModelProperty("创建人")
   private String crby;
   @ApiModelProperty("更新人")
   private String upby;
   @ApiModelProperty("更新时间")
   @TableField(
      fill = FieldFill.INSERT_UPDATE
   )
   private LocalDateTime uptime;

   public Boolean getAccess() {
      return ObjectUtil.equal(this.access, 1);
   }

   public Integer getId() {
      return this.id;
   }

   public Integer getGroupId() {
      return this.groupId;
   }

   public Long getDoorId() {
      return this.doorId;
   }

   public Integer getTimeZoneId() {
      return this.timeZoneId;
   }

   public LocalDateTime getCrtime() {
      return this.crtime;
   }

   public String getCrby() {
      return this.crby;
   }

   public String getUpby() {
      return this.upby;
   }

   public LocalDateTime getUptime() {
      return this.uptime;
   }

   public DcGroupDoor setId(final Integer id) {
      this.id = id;
      return this;
   }

   public DcGroupDoor setAccess(final Integer access) {
      this.access = access;
      return this;
   }

   public DcGroupDoor setGroupId(final Integer groupId) {
      this.groupId = groupId;
      return this;
   }

   public DcGroupDoor setDoorId(final Long doorId) {
      this.doorId = doorId;
      return this;
   }

   public DcGroupDoor setTimeZoneId(final Integer timeZoneId) {
      this.timeZoneId = timeZoneId;
      return this;
   }

   public DcGroupDoor setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
      return this;
   }

   public DcGroupDoor setCrby(final String crby) {
      this.crby = crby;
      return this;
   }

   public DcGroupDoor setUpby(final String upby) {
      this.upby = upby;
      return this;
   }

   public DcGroupDoor setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
      return this;
   }
}
