mybatisplus中如果实体类里面的字段在表中是不存在的,使用 @TableField(exist = false)

package com.zykj.zf_kaopuren.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.classgraph.json.Id;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 投诉信息存储类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ToString
@TableName("complaint")
public class Complaint {
  @TableId(type = IdType.AUTO)
  private Long id;
  private String respondent;
  private String content;
  private String address;


  private Integer typeid;
  @TableField(exist = false)
  private String type;

  private Integer oid;
  @TableField(exist = false)
  private String organization;

  private Integer detailid;
  @TableField(exist = false)
  private String detail;

  private Long urlid;
  @TableField(exist = false)
  private String url;

  private String uname;
  private String ucard;
  private String uphone;
  @TableField(exist = false)
  private String remark;
  private Long remarkId;
  private int status; // 状态,0未处理,1处理中,2已处理
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime createtime;
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime updatetime;
}

上一篇:Week01


下一篇:mybatis|Error building SqlSession. The error may exist in UserMapper.xml