content: package com.xiliu.common.domain;
  
  import com.baomidou.mybatisplus.annotation.FieldFill;
  import com.baomidou.mybatisplus.annotation.TableField;
  import com.baomidou.mybatisplus.annotation.Version;
  import io.swagger.annotations.ApiModelProperty;
  import org.springframework.format.annotation.DateTimeFormat;
  
  import javax.persistence.MappedSuperclass;
  import javax.persistence.Transient;
  import java.io.Serializable;
  import java.util.Date;
  import java.util.HashMap;
  import java.util.Map;
  
  /**
   * @author xiliu
   * @description 基类
   * @date 2022/7/14
   */
  @MappedSuperclass
  public class BaseEntity<T> implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      @TableField(fill = FieldFill.INSERT)
      @ApiModelProperty(value = "逻辑删除 1已删除 0未删除")
      private Boolean deleted;
  
      @TableField(fill = FieldFill.INSERT)
      @ApiModelProperty(value = "创建人")
      private Long createdBy;
  
      @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
      @TableField(fill = FieldFill.INSERT)
      @ApiModelProperty(value = "创建时间")
      private Date createdTime;
  
      @TableField(fill = FieldFill.UPDATE)
      @ApiModelProperty(value = "更新时间")
      private Date updatedTime;
  
      @TableField(fill = FieldFill.UPDATE)
      @ApiModelProperty(value = "更新人")
      private Long updatedBy;
  
      @Version
      @ApiModelProperty(value = "数据版本")
      private Long version;
  
  
      /**
       * 搜索值
       */
      @TableField(exist = false)
      private String searchValue;
  
      /**
       * 开始日期
       */
      @TableField(exist = false)
      private String beginTime;
  
      /**
       * 结束日期
       */
      @TableField(exist = false)
      private String endTime;
  
      /**
       * 请求参数
       */
      @Transient
      @TableField(exist = false)
      private Map<String, Object> params;
  
      public Boolean getDeleted() {
          return deleted;
      }
  
      public void setDeleted(Boolean deleted) {
          this.deleted = deleted;
      }
  
      public Long getCreatedBy() {
          return createdBy;
      }
  
      public void setCreatedBy(Long createdBy) {
          this.createdBy = createdBy;
      }
  
      public Date getCreatedTime() {
          return createdTime;
      }
  
      public void setCreatedTime(Date createdTime) {
          this.createdTime = createdTime;
      }
  
      public Date getUpdatedTime() {
          return updatedTime;
      }
  
      public void setUpdatedTime(Date updatedTime) {
          this.updatedTime = updatedTime;
      }
  
      public Long getUpdatedBy() {
          return updatedBy;
      }
  
      public void setUpdatedBy(Long updatedBy) {
          this.updatedBy = updatedBy;
      }
  
      public Long getVersion() {
          return version;
      }
  
      public void setVersion(Long version) {
          this.version = version;
      }
  
      public String getSearchValue() {
          return searchValue;
      }
  
      public void setSearchValue(String searchValue) {
          this.searchValue = searchValue;
      }
  
      public String getBeginTime() {
          return beginTime;
      }
  
      public void setBeginTime(String beginTime) {
          this.beginTime = beginTime;
      }
  
      public String getEndTime() {
          return endTime;
      }
  
      public void setEndTime(String endTime) {
          this.endTime = endTime;
      }
  
      public Map<String, Object> getParams() {
          if (params == null) {
              params = new HashMap<>();
          }
          return params;
      }
  
      public void setParams(Map<String, Object> params) {
          this.params = params;
      }
  }
  