|
@@ -9,7 +9,7 @@
|
9
|
9
|
delete from t_resource where resourceid=#{resourceid}
|
10
|
10
|
</delete>
|
11
|
11
|
<!--列表-->
|
12
|
|
- <select id="findAll" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
|
|
12
|
+ <select id="findAll" resultType="com.xhkjedu.sstudy.model.resource.TResource">
|
13
|
13
|
select r.resourceid,r.resourcename,r.createtime,r.suffix,u.username createname,r.resourceurl,rd.lsbid,
|
14
|
14
|
rd.directorid,r.resourceclass,r.resourcetype,r.readcount,r.downcount,r.pdfurl,r.converted,r.resourcecover
|
15
|
15
|
,r.comm,r.duration,r.resourcesize,r.mp4code,r.createid,r.belong
|
|
@@ -79,40 +79,6 @@
|
79
|
79
|
</choose>
|
80
|
80
|
,r.resourcename asc,r.resourceid asc
|
81
|
81
|
</select>
|
82
|
|
- <!--教师备课、预习导学资源列表-->
|
83
|
|
- <!--2020.11.16 教师备课只获取自己上传到个人空间文件,不获取收藏的文件-->
|
84
|
|
- <select id="listMyResource" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
|
85
|
|
- select r.resourceid,r.resourcename,r.createtime,r.suffix,u.username createname,r.resourceurl,rd.lsbid,
|
86
|
|
- rd.directorid,r.resourceclass,r.resourcetype,r.readcount,r.downcount,r.pdfurl,r.converted,r.resourcecover
|
87
|
|
- ,r.comm,r.duration,r.resourcesize,r.mp4code
|
88
|
|
- from t_resource r left join t_user u on u.userid=r.createid
|
89
|
|
- left join t_resource_director rd on r.resourceid=rd.resourceid
|
90
|
|
- <!-- <if test="resource.level==2">
|
91
|
|
- left join t_resource_collect rc on r.resourceid = rc.resourceid
|
92
|
|
- </if>-->
|
93
|
|
- where r.resourcestate=1 and r.level=#{resource.level} and r.createid=#{resource.createid}
|
94
|
|
- <!-- and ((r.level=#{resource.level} and r.resourcetype=0 and r.createid=#{resource.createid})
|
95
|
|
- <if test="resource.level==2">
|
96
|
|
- or rc.userid=#{resource.createid}
|
97
|
|
- </if>
|
98
|
|
- )-->
|
99
|
|
- <if test="resource.resourcename!=null and resource.resourcename!=''">
|
100
|
|
- and r.resourcename like '%${resource.resourcename}%'
|
101
|
|
- </if>
|
102
|
|
- <if test="resource.resourceclass!=null and resource.resourceclass!=0">
|
103
|
|
- and r.resourceclass=#{resource.resourceclass}
|
104
|
|
- </if>
|
105
|
|
- <if test="resource.subjectid!=null and resource.subjectid!='0'.toString() and resource.subjectid!=''">
|
106
|
|
- and r.subjectid=#{resource.subjectid}
|
107
|
|
- </if>
|
108
|
|
- <if test="resource.lsbid!=null and resource.lsbid!='0'.toString() and resource.lsbid!=''">
|
109
|
|
- and rd.lsbid=#{resource.lsbid}
|
110
|
|
- </if>
|
111
|
|
- <if test="resource.directorid!=null and resource.directorid!='0'.toString() and resource.directorid!=''">
|
112
|
|
- and rd.directorid=#{resource.directorid}
|
113
|
|
- </if>
|
114
|
|
- order by r.createtime desc,r.resourcename asc,r.resourceid asc
|
115
|
|
- </select>
|
116
|
82
|
<!--详情-->
|
117
|
83
|
<resultMap id="resourceResult" type="com.xhkjedu.sstudy.vo.resource.ResourceVo">
|
118
|
84
|
<result property="resourceid" column="resourceid"></result>
|
|
@@ -196,14 +162,6 @@
|
196
|
162
|
group by r.resourceid order by r.createtime desc,r.resourcename asc,r.resourceid asc limit #{resource.page},#{resource.pageSize}
|
197
|
163
|
</select>
|
198
|
164
|
|
199
|
|
- <!-- 获取资源是否已经分享到校本 -->
|
200
|
|
- <select id="getLevelResourceForxb" resultType="java.lang.Integer">
|
201
|
|
- SELECT COUNT(*) FROM t_resource r left join t_resource_director rd on r.resourceid=rd.resourceid
|
202
|
|
- LEFT JOIN t_resource r2 ON r.resourceurl=r2.resourceurl
|
203
|
|
- left join t_resource_director rd2 on r2.resourceid=rd2.resourceid and rd.lsbid=rd2.lsbid
|
204
|
|
- WHERE r2.resourceid=#{resource.resourceid} AND r.level=1 AND rd.directorid=#{resource.directorid} and r.resourcestate=1
|
205
|
|
- AND (r.belong IN(1,2) OR r.schoolid=#{resource.schoolid})
|
206
|
|
- </select>
|
207
|
165
|
<!--更新阅读次数-->
|
208
|
166
|
<update id="updateReadCount">
|
209
|
167
|
update t_resource set readcount=readcount+1 where resourceid=#{resourceid}
|
|
@@ -220,7 +178,7 @@
|
220
|
178
|
|
221
|
179
|
<!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->
|
222
|
180
|
<!--学生同步视频资源列表-->
|
223
|
|
- <select id="studentVideoWebList" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
|
|
181
|
+ <select id="studentVideoWebList" resultType="com.xhkjedu.sstudy.model.resource.TResource">
|
224
|
182
|
select r.resourceid,r.resourcename,r.createtime,r.suffix,u.username createname
|
225
|
183
|
,r.readcount,r.comm,r.resourceurl,r.resourcecover,r.duration,r.resourcesize,r.mp4code
|
226
|
184
|
,r.resourcegrade,r.source,r.year,r.region,r.schoolname,r.converted
|