|
@@ -61,9 +61,10 @@
|
61
|
61
|
</select>
|
62
|
62
|
<!-- 用户通知列表 -->
|
63
|
63
|
<select id="listMy" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
|
64
|
|
- select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,u.username createname,IFNULL(nt.readed,0) as readed
|
|
64
|
+ select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,n.subjectname,u.username createname,IFNULL(nt.readed,0) as readed
|
65
|
65
|
from t_notice n left join t_user u on n.createid=u.userid
|
66
|
66
|
left join t_notice_user nt on n.noticeid = nt.noticeid
|
|
67
|
+ left join t_subject s on n.subjectid=s.subjectid
|
67
|
68
|
where nt.userid=#{notice.createid}
|
68
|
69
|
<if test="notice.readed!=null"> and nt.readed=#{notice.readed}</if>
|
69
|
70
|
<if test="notice.noticetitle!=null and notice.noticetitle!=''">
|
|
@@ -76,6 +77,9 @@
|
76
|
77
|
<if test="notice.stoptime!=null and notice.stoptime!=0">
|
77
|
78
|
and n.createtime <=#{notice.stoptime}
|
78
|
79
|
</if>
|
|
80
|
+ <if test="notice.subjectid!=null and notice.subjectid!='' and notice.subjectid!='0'.toString()">
|
|
81
|
+ and n.subjectid=#{notice.subjectid}
|
|
82
|
+ </if>
|
79
|
83
|
|
80
|
84
|
group by n.noticeid order by nt.readed,n.createtime desc
|
81
|
85
|
<if test="notice.page==null">
|
|
@@ -88,7 +92,7 @@
|
88
|
92
|
</select>
|
89
|
93
|
<!--学生通知列表-->
|
90
|
94
|
<select id="listStudent" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
|
91
|
|
- select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,u.username createname
|
|
95
|
+ select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,n.subjectid,u.username createname
|
92
|
96
|
from t_notice n left join t_user u on n.createid=u.userid
|
93
|
97
|
left join t_notice_class nc on n.noticeid = nc.noticeid
|
94
|
98
|
left join t_class_student cs on nc.classid=cs.classid
|
|
@@ -102,10 +106,11 @@
|
102
|
106
|
<!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->
|
103
|
107
|
<!--学生通知列表-->
|
104
|
108
|
<select id="listNoticeForStuWeb" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
|
105
|
|
- select n.noticeid,n.noticetitle,n.noticecontent,n.noticetxt,n.createtime,u.username createname
|
|
109
|
+ select n.noticeid,n.noticetitle,n.noticecontent,n.noticetxt,s.subjectname,n.createtime,u.username createname
|
106
|
110
|
from t_notice n left join t_user u on n.createid=u.userid
|
107
|
111
|
left join t_notice_class nc on n.noticeid = nc.noticeid
|
108
|
112
|
left join t_class_student cs on nc.classid=cs.classid
|
|
113
|
+ left join t_subject s on n.subjectid=s.subjectid
|
109
|
114
|
where ((cs.studentid=#{notice.createid} and n.noticetype=1) or (n.noticetype=3 and nc.classid=#{notice.createid}))
|
110
|
115
|
<if test="notice.noticetitle!=null and notice.noticetitle!=''">
|
111
|
116
|
and (n.noticetitle like concat('%', #{notice.noticetitle}, '%')
|
|
@@ -117,6 +122,9 @@
|
117
|
122
|
<if test="notice.stoptime!=null and notice.stoptime!=0">
|
118
|
123
|
and n.createtime<=#{notice.stoptime}
|
119
|
124
|
</if>
|
|
125
|
+ <if test="notice.subjectid!=null and notice.subjectid!='' and notice.subjectid!='0'.toString()">
|
|
126
|
+ and n.subjectid=#{notice.subjectid}
|
|
127
|
+ </if>
|
120
|
128
|
group by n.noticeid order by n.createtime desc
|
121
|
129
|
</select>
|
122
|
130
|
<!--根据班级删除通知-->
|
|
@@ -132,4 +140,9 @@
|
132
|
140
|
<select id="getNoticeid" resultType="java.lang.Integer">
|
133
|
141
|
select noticeid from t_notice where noticeid=#{noticeid}
|
134
|
142
|
</select>
|
|
143
|
+
|
|
144
|
+ <!--根据用户ID获取用户所属科目-->
|
|
145
|
+ <select id="getUserSubjectByUserid" resultType="java.lang.String">
|
|
146
|
+ select subjectid from t_teacher_powersb where teacherid=#{userid} group by subjectid limit 1
|
|
147
|
+ </select>
|
135
|
148
|
</mapper>
|