修改TableField注解的insertStrategy属性,它默认是NOT_NULL
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
package com.njcn.system.pojo.po;
|
package com.njcn.system.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
@@ -11,9 +15,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
* @date 2022年07月12日 14:45
|
* @date 2022年07月12日 14:45
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("sys_user_log")
|
@TableName("sys_user_log")
|
||||||
public class UserLog extends BaseEntity {
|
public class UserLog {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -25,11 +28,13 @@ public class UserLog extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 登录名
|
* 登录名
|
||||||
*/
|
*/
|
||||||
|
@TableField(insertStrategy = FieldStrategy.IGNORED)
|
||||||
private String loginName;
|
private String loginName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户已登录:用户名
|
* 用户已登录:用户名
|
||||||
*/
|
*/
|
||||||
|
@TableField(insertStrategy = FieldStrategy.IGNORED)
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,6 +60,7 @@ public class UserLog extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 失败原因
|
* 失败原因
|
||||||
*/
|
*/
|
||||||
|
@TableField(insertStrategy = FieldStrategy.IGNORED)
|
||||||
private String failReason;
|
private String failReason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,5 +83,32 @@ public class UserLog extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.IGNORED)
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.IGNORED)
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE, insertStrategy = FieldStrategy.IGNORED)
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE, insertStrategy = FieldStrategy.IGNORED)
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user