mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 06:51:23 +08:00
Temp commit deleteByNoticeId solve
This commit is contained in:
@@ -10,6 +10,8 @@ import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -30,6 +32,7 @@ public class Notice implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId("id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@@ -48,6 +51,7 @@ public class Notice implements Serializable {
|
||||
* 公告类型Id
|
||||
*/
|
||||
@TableField("type_id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
@@ -60,6 +64,7 @@ public class Notice implements Serializable {
|
||||
* 发布者id
|
||||
*/
|
||||
@TableField("sender_id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
@@ -108,6 +113,7 @@ public class Notice implements Serializable {
|
||||
* 源ID
|
||||
*/
|
||||
@TableField("origin_id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long originId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.annotation.Version;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -29,12 +31,14 @@ public class NoticeReceive implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId("id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
@@ -47,6 +51,7 @@ public class NoticeReceive implements Serializable {
|
||||
* 公告Id
|
||||
*/
|
||||
@TableField("notice_id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long noticeId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.annotation.Version;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -29,6 +32,7 @@ public class NoticeType implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId("id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,7 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
noticeReceives) {
|
||||
noticeReceiveMapper.deleteById(nrc.getId());
|
||||
}
|
||||
return noticeMapper.deleteById(nid)==0;
|
||||
return noticeMapper.deleteById(nid)>0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,17 +20,54 @@
|
||||
|
||||
<!-- 查询所有公告 -->
|
||||
<select id="selectAllNotice" resultMap="NoticeAllResultMap">
|
||||
select *
|
||||
select u.id uid,
|
||||
username,
|
||||
passwd,
|
||||
department_id,
|
||||
u.deleted ude,
|
||||
u.version uve,
|
||||
n.id nid,
|
||||
title,
|
||||
content,
|
||||
type_id,
|
||||
sender_id,
|
||||
create_time,
|
||||
send_time,
|
||||
end_time,
|
||||
priority,
|
||||
top,
|
||||
modify_time,
|
||||
origin_id,
|
||||
old,
|
||||
n.deleted nde,
|
||||
n.version nve,
|
||||
type.id typeId,
|
||||
name,
|
||||
enable,
|
||||
type.deleted typeDe,
|
||||
type.version typeVe
|
||||
from t_user u,
|
||||
t_notice n,
|
||||
t_notice_type type
|
||||
where u.id = n.sender_id
|
||||
and type.id=n.type_id
|
||||
and type.id = n.type_id
|
||||
and n.deleted = 0
|
||||
and n.old=0
|
||||
and n.old = 0
|
||||
|
||||
</select>
|
||||
<resultMap id="NoticeAllResultMap" type="notice" autoMapping="true">
|
||||
<association property="sender" javaType="user" autoMapping="true"/>
|
||||
<association property="noticeType" javaType="noticeType" autoMapping="true"/>
|
||||
<id property="id" column="nid"/>
|
||||
<result property="deleted" column="nde"/>
|
||||
<result property="version" column="nve"/>
|
||||
<association property="sender" javaType="user" autoMapping="true">
|
||||
<id property="id" column="uid"/>
|
||||
<result property="deleted" column="ude"/>
|
||||
<result property="version" column="uve"/>
|
||||
</association>
|
||||
<association property="noticeType" javaType="noticeType" autoMapping="true">
|
||||
<id property="id" column="typeId"/>
|
||||
<result property="deleted" column="typeDe"/>
|
||||
<result property="version" column="typeVe"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user