Your Name 7d881ab617 修复Notification实体类updateTime字段导致的SQL错误
问题:审核通过时发送通知失败,提示'Unknown column update_time in field list'
原因:Notification实体类定义了updateTime字段并标记为自动填充,但数据库表sys_notification中没有此字段
解决:将updateTime字段标记为exist=false,表示此字段不存在于数据库表中
2026-01-02 18:52:42 +08:00

269 lines
5.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.designhub.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 通知消息实体类
*/
@Data
@TableName("sys_notification")
public class Notification implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 通知类型:system-系统通知, task-任务通知, score-积分通知, review-评审通知
*/
@TableField("type")
private String notificationType;
/**
* 接收用户ID
*/
@TableField("receiver_id")
private Long receiverId;
/**
* 发送用户ID(可为空,系统通知为空)
*/
@TableField(exist = false)
private Long senderId;
/**
* 通知标题
*/
private String title;
/**
* 通知内容
*/
private String content;
/**
* 关联业务ID(任务ID、积分记录ID等)
*/
@TableField("related_task_id")
private Long relatedId;
/**
* 关联业务类型:task, score, review, system
*/
@TableField(exist = false)
private String relatedType;
/**
* 跳转链接
*/
@TableField("link")
private String linkUrl;
/**
* 是否已读:0-未读,1-已读
*/
@TableField("is_read")
private Integer isRead;
/**
* 阅读时间
*/
private LocalDateTime readTime;
/**
* 是否推送到钉钉:0-否,1-是
*/
@TableField("ding_enabled")
private Integer pushDingtalk;
/**
* 钉钉推送状态:pending-待推送, success-成功, failed-失败
*/
@TableField(exist = false)
private String dingtalkStatus;
/**
* 钉钉推送时间
*/
@TableField("ding_push_time")
private LocalDateTime dingtalkPushTime;
/**
* 优先级:low-低, normal-普通, high-高, urgent-紧急
*/
@TableField("ding_priority")
private Integer priority;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 更新时间(表中不存在此字段,标记为不存在)
*/
@TableField(exist = false)
private LocalDateTime updateTime;
/**
* 删除标志:0-未删除,1-已删除
*/
@TableLogic
private Integer deleted;
// Getters and Setters (手动添加以解决Lombok编译问题)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNotificationType() {
return notificationType;
}
public void setNotificationType(String notificationType) {
this.notificationType = notificationType;
}
public Long getReceiverId() {
return receiverId;
}
public void setReceiverId(Long receiverId) {
this.receiverId = receiverId;
}
public Long getSenderId() {
return senderId;
}
public void setSenderId(Long senderId) {
this.senderId = senderId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Long getRelatedId() {
return relatedId;
}
public void setRelatedId(Long relatedId) {
this.relatedId = relatedId;
}
public String getRelatedType() {
return relatedType;
}
public void setRelatedType(String relatedType) {
this.relatedType = relatedType;
}
public String getLinkUrl() {
return linkUrl;
}
public void setLinkUrl(String linkUrl) {
this.linkUrl = linkUrl;
}
public Integer getIsRead() {
return isRead;
}
public void setIsRead(Integer isRead) {
this.isRead = isRead;
}
public LocalDateTime getReadTime() {
return readTime;
}
public void setReadTime(LocalDateTime readTime) {
this.readTime = readTime;
}
public Integer getPushDingtalk() {
return pushDingtalk;
}
public void setPushDingtalk(Integer pushDingtalk) {
this.pushDingtalk = pushDingtalk;
}
public String getDingtalkStatus() {
return dingtalkStatus;
}
public void setDingtalkStatus(String dingtalkStatus) {
this.dingtalkStatus = dingtalkStatus;
}
public LocalDateTime getDingtalkPushTime() {
return dingtalkPushTime;
}
public void setDingtalkPushTime(LocalDateTime dingtalkPushTime) {
this.dingtalkPushTime = dingtalkPushTime;
}
public Integer getPriority() {
return priority;
}
public void setPriority(Integer priority) {
this.priority = priority;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleted() {
return deleted;
}
public void setDeleted(Integer deleted) {
this.deleted = deleted;
}
}