Browse Source

通知管理

tags/正式3.13.3
雍文秀 1 year ago
parent
commit
240e0172bd

+ 6
- 6
sapi/src/main/java/com/xhkjedu/sapi/controller/notice/NoticeController.java View File

@@ -73,9 +73,9 @@ public class NoticeController {
73 73
         Integer pageSize = tNotice.getPageSize();
74 74
         Integer createid = tNotice.getCreateid();
75 75
         Integer schoolid = tNotice.getSchoolid();
76
-        N_Utils.validation(new Object[]{pageSize,"显示条数",1,createid,"教师id",1,schoolid,"学校id",1});
76
+        N_Utils.validation(new Object[]{pageSize,"显示条数",1,createid,"用户id",1,schoolid,"学校id",1});
77 77
         List<NoticeVo> list = noticeService.listMy(tNotice);
78
-        return new ResultVo(0,"获取教师通知列表成功",list);
78
+        return new ResultVo(0,"获取用户通知列表成功",list);
79 79
     }
80 80
 
81 81
     @PostMapping("/list_my_all")
@@ -84,7 +84,7 @@ public class NoticeController {
84 84
         Integer pageSize = tNotice.getPageSize();
85 85
         Integer createid = tNotice.getCreateid();
86 86
         Integer schoolid = tNotice.getSchoolid();
87
-        N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1,createid,"教师id",1,schoolid,"学校id",1});
87
+        N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1,createid,"用户id",1,schoolid,"学校id",1});
88 88
         PageHelper.startPage(page, pageSize);
89 89
         List<NoticeVo> list = noticeService.listMy(tNotice);
90 90
         PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
@@ -110,7 +110,7 @@ public class NoticeController {
110 110
         Integer createid = tNotice.getCreateid();
111 111
         N_Utils.validation(new Object[]{noticeid,"通知id",1,createid,"用户id",1});
112 112
         TNotice notice = noticeService.reade(noticeid, createid);
113
-        return new ResultVo(0,"教师查看成功", notice);
113
+        return new ResultVo(0,"用户查看成功", notice);
114 114
     }
115 115
 
116 116
     @PostMapping("/student_readed")
@@ -124,9 +124,9 @@ public class NoticeController {
124 124
     @PostMapping("/no_read_num")
125 125
     public ResultVo noReadNum(@RequestBody TNotice tNotice) {
126 126
         Integer createid = tNotice.getCreateid();
127
-        N_Utils.validation(new Object[]{createid,"教师id",1});
127
+        N_Utils.validation(new Object[]{createid,"用户id",1});
128 128
         Integer num = noticeService.noReadNum(createid);
129
-        return new ResultVo(0,"获取教师未看通知数量成功",num);
129
+        return new ResultVo(0,"获取用户未看通知数量成功",num);
130 130
     }
131 131
 
132 132
     /**

+ 12
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/notice/NoticeFileMapper.java View File

@@ -0,0 +1,12 @@
1
+package com.xhkjedu.sapi.mapper.notice;
2
+
3
+import com.xhkjedu.base.TkMapper;
4
+import com.xhkjedu.sapi.model.notice.TNoticeFile;
5
+
6
+/**
7
+ * @Description
8
+ * @Author ywx
9
+ * Date 2023/12/18 14:08
10
+ **/
11
+public interface NoticeFileMapper extends TkMapper<TNoticeFile> {
12
+}

+ 8
- 8
sapi/src/main/java/com/xhkjedu/sapi/mapper/notice/NoticeMapper.java View File

@@ -4,7 +4,7 @@ import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.sapi.model.system.TSchool;
5 5
 import com.xhkjedu.sapi.model.notice.TNotice;
6 6
 import com.xhkjedu.sapi.vo.gradeclass.ClassVo;
7
-import com.xhkjedu.sapi.vo.notice.NoticeTeacherVo;
7
+import com.xhkjedu.sapi.vo.notice.NoticeUserVo;
8 8
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
9 9
 import org.apache.ibatis.annotations.Param;
10 10
 
@@ -18,7 +18,7 @@ public interface NoticeMapper extends TkMapper<TNotice> {
18 18
     TNotice findById(@Param("noticeid") Integer noticeid);
19 19
 
20 20
     /**
21
-     * 教师通知列表
21
+     * 用户通知列表
22 22
      * @Param [notice]
23 23
      * @Author ywx
24 24
      * @Date 2020/6/13 9:57
@@ -36,7 +36,7 @@ public interface NoticeMapper extends TkMapper<TNotice> {
36 36
     List<NoticeVo> listStudent(@Param("notice") TNotice notice);
37 37
 
38 38
     /**
39
-     * 教师、学生查看详情
39
+     * 用户查看详情
40 40
      * @Param [noticeid]
41 41
      * @Author ywx
42 42
      * @Date 2020/6/13 11:50
@@ -45,13 +45,13 @@ public interface NoticeMapper extends TkMapper<TNotice> {
45 45
     TNotice findById2(@Param("noticeid") Integer noticeid);
46 46
 
47 47
     /**
48
-     * 教师未看通知数量
49
-     * @Param [teacherid]
48
+     * 用户未看通知数量
49
+     * @Param [userid]
50 50
      * @Author ywx
51 51
      * @Date 2020/7/24 10:39
52 52
      * @return java.lang.Integer
53 53
      **/
54
-    Integer noReadNum(@Param("teacherid") Integer teacherid);
54
+    Integer noReadNum(@Param("userid") Integer userid);
55 55
 
56 56
 
57 57
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
@@ -70,8 +70,8 @@ public interface NoticeMapper extends TkMapper<TNotice> {
70 70
     //通知班级列表
71 71
     List<ClassVo> listClass(Integer noticeid);
72 72
 
73
-    //通知教师列表
74
-    List<NoticeTeacherVo> listTeacher(Integer noticeid);
73
+    //通知用户列表
74
+    List<NoticeUserVo> listUser(Integer noticeid);
75 75
 
76 76
     //通知学校列表
77 77
     List<TSchool> listSchool(Integer noticeid);

sapi/src/main/java/com/xhkjedu/sapi/mapper/notice/NoticeTeacherMapper.java → sapi/src/main/java/com/xhkjedu/sapi/mapper/notice/NoticeUserMapper.java View File

@@ -2,10 +2,10 @@ package com.xhkjedu.sapi.mapper.notice;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.sapi.model.notice.TNotice;
5
-import com.xhkjedu.sapi.model.notice.TNoticeTeacher;
5
+import com.xhkjedu.sapi.model.notice.TNoticeUser;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
8
-public interface NoticeTeacherMapper extends TkMapper<TNoticeTeacher> {
8
+public interface NoticeUserMapper extends TkMapper<TNoticeUser> {
9 9
     /**
10 10
      * 批量添加
11 11
      * @Param [notice]
@@ -15,22 +15,13 @@ public interface NoticeTeacherMapper extends TkMapper<TNoticeTeacher> {
15 15
      **/
16 16
     Integer batchSave(@Param("notice") TNotice notice);
17 17
 
18
-    /**
19
-     * 删除通知对象
20
-     * @Param [noticeid]
21
-     * @Author ywx
22
-     * @Date 2020/6/13 10:00
23
-     * @return java.lang.Integer
24
-     **/
25
-    Integer deleteByNoticeId(@Param("noticeid") Integer noticeid);
26
-
27 18
     /**
28 19
      * 查看
29
-     * @Param [noticeid, teacherid]
20
+     * @Param [noticeid, userid]
30 21
      * @Author ywx
31 22
      * @Date 2020/6/13 11:17
32 23
      * @return java.lang.Integer
33 24
      **/
34
-    Integer reade(@Param("noticeid") Integer noticeid, @Param("teacherid") Integer teacherid
25
+    Integer reade(@Param("noticeid") Integer noticeid, @Param("userid") Integer userid
35 26
             , @Param("timestamp") int timestamp);
36 27
 }

+ 6
- 2
sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNotice.java View File

@@ -3,7 +3,7 @@ package com.xhkjedu.sapi.model.notice;
3 3
 import com.xhkjedu.model.BaseBean;
4 4
 import com.xhkjedu.sapi.model.system.TSchool;
5 5
 import com.xhkjedu.sapi.vo.gradeclass.ClassVo;
6
-import com.xhkjedu.sapi.vo.notice.NoticeTeacherVo;
6
+import com.xhkjedu.sapi.vo.notice.NoticeUserVo;
7 7
 import lombok.Data;
8 8
 
9 9
 import javax.persistence.Id;
@@ -45,7 +45,7 @@ public class TNotice extends BaseBean {
45 45
 
46 46
     @Transient
47 47
     //教师id集合
48
-    private List<NoticeTeacherVo> teachers;
48
+    private List<NoticeUserVo> users;
49 49
 
50 50
     @Transient
51 51
     //开始时间
@@ -61,4 +61,8 @@ public class TNotice extends BaseBean {
61 61
     @Transient
62 62
     //学校id集合
63 63
     private List<TSchool> schools;
64
+
65
+    @Transient
66
+    //通知附件
67
+    private List<TNoticeFile> files;
64 68
 }

+ 51
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNoticeFile.java View File

@@ -0,0 +1,51 @@
1
+package com.xhkjedu.sapi.model.notice;
2
+
3
+import com.xhkjedu.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+
9
+@Table(name = "t_notice_file")
10
+@Data
11
+public class TNoticeFile extends BaseBean {
12
+    @Id
13
+    //通知附件表
14
+    private Integer nfid;
15
+
16
+    //通知id
17
+    private String noticeid;
18
+
19
+    //资源名称
20
+    private String resourcename;
21
+
22
+    //资源分类1word,2ppt,3pdf,4图片,5视频,6音频,7压缩包,10其他
23
+    private Integer resourceclass;
24
+
25
+    //资源地址
26
+    private String resourceurl;
27
+
28
+    //封面图地址
29
+    private String resourcecover;
30
+
31
+    //是否转换0未转换1已转换2转换失败3加密
32
+    private Integer converted;
33
+
34
+    //转换失败原因
35
+    private String convertmsg;
36
+
37
+    //转换后的pdf文件地址
38
+    private String pdfurl;
39
+
40
+    //文件后缀
41
+    private String suffix;
42
+
43
+    //文件大小
44
+    private Integer resourcesize;
45
+
46
+    //视频时长(秒)
47
+    private Integer duration;
48
+
49
+    //创建时间
50
+    private Integer createtime;
51
+}

sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNoticeTeacher.java → sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNoticeUser.java View File

@@ -6,9 +6,9 @@ import lombok.Data;
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8 8
 
9
-@Table(name = "t_notice_teacher")
9
+@Table(name = "t_notice_user")
10 10
 @Data
11
-public class TNoticeTeacher extends BaseBean {
11
+public class TNoticeUser extends BaseBean {
12 12
     @Id
13 13
     //通知用户表
14 14
     private Integer nuid;
@@ -17,7 +17,7 @@ public class TNoticeTeacher extends BaseBean {
17 17
     private Integer noticeid;
18 18
 
19 19
     //用户id
20
-    private Integer teacherid;
20
+    private Integer userid;
21 21
 
22 22
     //是否查看0未查看1已查看
23 23
     private Integer readed;

+ 15
- 19
sapi/src/main/java/com/xhkjedu/sapi/service/notice/NoticeService.java View File

@@ -3,12 +3,12 @@ package com.xhkjedu.sapi.service.notice;
3 3
 import com.xhkjedu.sapi.mapper.notice.NoticeClassMapper;
4 4
 import com.xhkjedu.sapi.mapper.notice.NoticeMapper;
5 5
 import com.xhkjedu.sapi.mapper.notice.NoticeSchoolMapper;
6
-import com.xhkjedu.sapi.mapper.notice.NoticeTeacherMapper;
6
+import com.xhkjedu.sapi.mapper.notice.NoticeUserMapper;
7 7
 import com.xhkjedu.sapi.model.system.TSchool;
8 8
 import com.xhkjedu.sapi.model.notice.TNotice;
9 9
 import com.xhkjedu.utils.N_Utils;
10 10
 import com.xhkjedu.sapi.vo.gradeclass.ClassVo;
11
-import com.xhkjedu.sapi.vo.notice.NoticeTeacherVo;
11
+import com.xhkjedu.sapi.vo.notice.NoticeUserVo;
12 12
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
13 13
 import org.springframework.stereotype.Service;
14 14
 
@@ -29,7 +29,7 @@ public class NoticeService {
29 29
     @Resource
30 30
     private NoticeClassMapper noticeClassMapper;
31 31
     @Resource
32
-    private NoticeTeacherMapper noticeTeacherMapper;
32
+    private NoticeUserMapper noticeUserMapper;
33 33
     @Resource
34 34
     private NoticeSchoolMapper noticeSchoolMapper;
35 35
 
@@ -58,11 +58,12 @@ public class NoticeService {
58 58
 
59 59
     //添加通知对象
60 60
     private void saveNoticeObj(TNotice model) {
61
-        if (model.getNoticetype() == 1) {//通知对象1班级
61
+        Integer noticetype = model.getNoticetype();
62
+        if (noticetype == 1) {//通知对象1班级
62 63
             noticeClassMapper.batchSave(model);
63
-        } else if (model.getNoticetype() == 2) {//通知对象2老师
64
-            model.setTeachers(N_Utils.listDistinct(model.getTeachers()));//通知对象去重
65
-            noticeTeacherMapper.batchSave(model);
64
+        } else if (noticetype == 2 || noticetype == 3) {//通知对象2老师3单个学生
65
+            model.setUsers(N_Utils.listDistinct(model.getUsers()));//通知对象去重
66
+            noticeUserMapper.batchSave(model);
66 67
         }
67 68
 
68 69
         if (N_Utils.isListEmpty(model.getSchools())) {//兼容以前添加单个学校模式
@@ -82,9 +83,9 @@ public class NoticeService {
82 83
         if (noticetype == 1) {
83 84
             List<ClassVo> classes = noticeMapper.listClass(noticeid);
84 85
             notice.setClasses(classes);
85
-        } else if (noticetype == 2) {
86
-            List<NoticeTeacherVo> teachers = noticeMapper.listTeacher(noticeid);
87
-            notice.setTeachers(teachers);
86
+        } else if (noticetype == 2 || noticetype == 3) {
87
+            List<NoticeUserVo> users = noticeMapper.listUser(noticeid);
88
+            notice.setUsers(users);
88 89
         } else {
89 90
             List<TSchool> schools = noticeMapper.listSchool(noticeid);
90 91
             notice.setSchools(schools);
@@ -98,7 +99,7 @@ public class NoticeService {
98 99
     }
99 100
 
100 101
     /**
101
-     * 教师通知列表
102
+     * 用户通知列表
102 103
      * @Param [notice]
103 104
      * @Author ywx
104 105
      * @Date 2020/6/13 9:55
@@ -120,7 +121,7 @@ public class NoticeService {
120 121
     }
121 122
 
122 123
     /**
123
-     * 教师查看
124
+     * 用户查看
124 125
      * @Param [noticeid, createid]
125 126
      * @Author ywx
126 127
      * @Date 2020/6/13 11:21
@@ -128,7 +129,7 @@ public class NoticeService {
128 129
      **/
129 130
     public TNotice reade(Integer noticeid, Integer createid) {
130 131
         TNotice notice = noticeMapper.findById2(noticeid);
131
-        noticeTeacherMapper.reade(noticeid, createid, N_Utils.getSecondTimestamp());
132
+        noticeUserMapper.reade(noticeid, createid, N_Utils.getSecondTimestamp());
132 133
         return notice;
133 134
     }
134 135
 
@@ -144,7 +145,7 @@ public class NoticeService {
144 145
     }
145 146
 
146 147
     /**
147
-     * 教师未看通知数量
148
+     * 用户未看通知数量
148 149
      * @Param [teacherid]
149 150
      * @Author ywx
150 151
      * @Date 2020/7/24 10:37
@@ -154,11 +155,6 @@ public class NoticeService {
154 155
         return noticeMapper.noReadNum(teacherid);
155 156
     }
156 157
 
157
-    //根据班级删除通知
158
-    public void deleteByClassId(Integer classid) {
159
-        noticeMapper.deleteByClassId(classid);
160
-    }
161
-
162 158
     //通知学生--网页--列表
163 159
     public List<NoticeVo> listNoticeStuWeb(TNotice notice) {
164 160
         return noticeMapper.listNoticeForStuWeb(notice);

+ 3
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchService.java View File

@@ -9,7 +9,7 @@ import com.xhkjedu.sapi.model.research.TResearch;
9 9
 import com.xhkjedu.sapi.model.research.TResearchUser;
10 10
 import com.xhkjedu.sapi.service.notice.NoticeService;
11 11
 import com.xhkjedu.utils.N_Utils;
12
-import com.xhkjedu.sapi.vo.notice.NoticeTeacherVo;
12
+import com.xhkjedu.sapi.vo.notice.NoticeUserVo;
13 13
 import lombok.extern.slf4j.Slf4j;
14 14
 import org.springframework.stereotype.Service;
15 15
 import org.springframework.transaction.annotation.Transactional;
@@ -88,7 +88,7 @@ public class ResearchService {
88 88
 
89 89
 
90 90
         if( research.getNotice() == 1){//发送通知
91
-            List<NoticeTeacherVo> teachers = new ArrayList<>();
91
+            List<NoticeUserVo> teachers = new ArrayList<>();
92 92
             TNotice notice = new TNotice();
93 93
             notice.setNoticetitle(research.getResearchname());
94 94
             notice.setNoticecontent(research.getResearchcontent());
@@ -97,7 +97,7 @@ public class ResearchService {
97 97
             notice.setCreateid(research.getCreateid());
98 98
             notice.setSchoolid(research.getSchoolid());
99 99
             userids.forEach(uid->{
100
-                NoticeTeacherVo nt = new NoticeTeacherVo();
100
+                NoticeUserVo nt = new NoticeUserVo();
101 101
                 nt.setTeacherid(uid);
102 102
                 teachers.add(nt);
103 103
             });

sapi/src/main/java/com/xhkjedu/sapi/vo/notice/NoticeTeacherVo.java → sapi/src/main/java/com/xhkjedu/sapi/vo/notice/NoticeUserVo.java View File

@@ -3,12 +3,12 @@ package com.xhkjedu.sapi.vo.notice;
3 3
 import lombok.Data;
4 4
 
5 5
 @Data
6
-public class NoticeTeacherVo {
7
-    //教师id
8
-    private Integer teacherid;
6
+public class NoticeUserVo {
7
+    //用户id
8
+    private Integer userid;
9 9
 
10
-    //教师名称
11
-    private String teachername;
10
+    //用户名称
11
+    private String username;
12 12
 
13 13
     //是否查看0未查看1已查看
14 14
     private Integer readed;

+ 12
- 12
sapi/src/main/resources/mapper/notice/NoticeMapper.xml View File

@@ -39,10 +39,10 @@
39 39
         where nc.noticeid=#{noticeid}
40 40
         order by c.gradeid,c.classtype,c.classorder
41 41
     </select>
42
-    <!--通知教师列表-->
43
-    <select id="listTeacher" resultType="com.xhkjedu.sapi.vo.notice.NoticeTeacherVo">
44
-        select t.teacherid,tu.username teachername,t.readed
45
-        from t_notice_teacher t left join t_user tu on t.teacherid = tu.userid
42
+    <!--通知用户列表-->
43
+    <select id="listUser" resultType="com.xhkjedu.sapi.vo.notice.NoticeUserVo">
44
+        select t.userid,tu.username teachername,t.readed
45
+        from t_notice_user t left join t_user tu on t.userid = tu.userid
46 46
         where t.noticeid=#{noticeid}
47 47
     </select>
48 48
     <!--通知学校列表-->
@@ -56,18 +56,18 @@
56 56
         from t_notice n left join t_user u on n.createid=u.userid
57 57
         where n.noticeid=#{noticeid} limit 1
58 58
     </select>
59
-    <!--教师、学生查看详情-->
59
+    <!--用户查看详情-->
60 60
     <select id="findById2" resultType="com.xhkjedu.sapi.model.notice.TNotice">
61 61
         select n.*,u.username createname
62 62
         from t_notice n left join t_user u on n.createid=u.userid
63 63
         where n.noticeid=#{noticeid} limit 1
64 64
     </select>
65
-    <!-- 教师通知列表 -->
65
+    <!-- 用户通知列表 -->
66 66
     <select id="listMy" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
67
-        select n.noticeid,n.noticetitle,n.createtime,u.username createname,IFNULL(nt.readed,0)readed
67
+        select n.noticeid,n.noticetitle,n.createtime,u.username createname,IFNULL(nt.readed,0) as readed
68 68
         from t_notice n left join t_user u on n.createid=u.userid
69
-        left join t_notice_teacher nt on n.noticeid = nt.noticeid
70
-        where nt.teacherid=#{notice.createid}
69
+        left join t_notice_user nt on n.noticeid = nt.noticeid
70
+        where nt.userid=#{notice.createid}
71 71
         <if test="notice.readed!=null"> and nt.readed=#{notice.readed}</if>
72 72
         <if test="notice.noticetitle!=null and notice.noticetitle!=''">
73 73
             and (n.noticetitle like concat('%', #{notice.noticetitle}, '%')
@@ -80,14 +80,14 @@
80 80
             and n.createtime &lt;=#{notice.stoptime}
81 81
         </if>
82 82
 
83
-        group by n.noticeid order by nt.readed asc,n.createtime desc
83
+        group by n.noticeid order by nt.readed,n.createtime desc
84 84
         <if test="notice.page==null">
85 85
             limit #{notice.pageSize}
86 86
         </if>
87 87
     </select>
88
-    <!--教师未看通知数量-->
88
+    <!--用户未看通知数量-->
89 89
     <select id="noReadNum" resultType="java.lang.Integer">
90
-        select count(*) from t_notice_teacher t where t.teacherid=#{teacherid} and t.readed=0
90
+        select count(*) from t_notice_user t where t.userid=#{userid} and t.readed=0
91 91
     </select>
92 92
     <!--学生通知列表-->
93 93
     <select id="listStudent" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">

+ 0
- 21
sapi/src/main/resources/mapper/notice/NoticeTeacherMapper.xml View File

@@ -1,21 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
-<mapper namespace="com.xhkjedu.sapi.mapper.notice.NoticeTeacherMapper">
4
-    <!--批量添加-->
5
-    <insert id="batchSave" parameterType="com.xhkjedu.sapi.model.notice.TNotice">
6
-        INSERT INTO t_notice_teacher (noticeid,teacherid,createtime,schoolid)
7
-        VALUES
8
-        <foreach collection ="notice.teachers" item="t" index= "index" separator =",">
9
-            (#{notice.noticeid},#{t.teacherid},#{notice.createtime},#{notice.schoolid})
10
-        </foreach>
11
-    </insert>
12
-    <!--删除通知对象-->
13
-    <delete id="deleteByNoticeId">
14
-        delete from t_notice_teacher where noticeid=#{noticeid}
15
-    </delete>
16
-    <!--查看-->
17
-    <update id="reade">
18
-        update t_notice_teacher nt set nt.readed=1,nt.readtime=#{timestamp}
19
-        where nt.noticeid=#{noticeid} and nt.teacherid=#{teacherid}
20
-    </update>
21
-</mapper>

+ 17
- 0
sapi/src/main/resources/mapper/notice/NoticeUserMapper.xml View File

@@ -0,0 +1,17 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.xhkjedu.sapi.mapper.notice.NoticeUserMapper">
4
+    <!--批量添加-->
5
+    <insert id="batchSave" parameterType="com.xhkjedu.sapi.model.notice.TNotice">
6
+        INSERT INTO t_notice_user (noticeid,userid,createtime,schoolid)
7
+        VALUES
8
+        <foreach collection ="notice.teachers" item="t" index= "index" separator =",">
9
+            (#{notice.noticeid},#{t.userid},#{notice.createtime},#{notice.schoolid})
10
+        </foreach>
11
+    </insert>
12
+    <!--查看-->
13
+    <update id="reade">
14
+        update t_notice_user nt set nt.readed=1,nt.readtime=#{timestamp}
15
+        where nt.noticeid=#{noticeid} and nt.userid=#{userid}
16
+    </update>
17
+</mapper>

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/model/notice/TNoticeTeacher.java View File

@@ -6,7 +6,7 @@ import lombok.Data;
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8 8
 
9
-@Table(name = "t_notice_teacher")
9
+@Table(name = "t_notice_user")
10 10
 @Data
11 11
 public class TNoticeTeacher extends BaseBean {
12 12
     @Id

+ 1
- 1
sexam/src/main/resources/mapper/notice/NoticeTeacherMapper.xml View File

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sexam.mapper.notice.NoticeTeacherMapper">
4 4
     <!--批量添加-->
5 5
     <insert id="batchSave" parameterType="com.xhkjedu.sexam.model.notice.TNotice">
6
-        INSERT INTO t_notice_teacher (noticeid,teacherid,createtime,schoolid)
6
+        INSERT INTO t_notice_user (noticeid,teacherid,createtime,schoolid)
7 7
         VALUES
8 8
         <foreach collection ="notice.teachers" item="t" index= "index" separator =",">
9 9
             (#{notice.noticeid},#{t.teacherid},#{notice.createtime},#{notice.schoolid})

Loading…
Cancel
Save