Browse Source

试题、资源列表返回学校id

资源详情返回分享集团校数量
tags/正式3.11.0
雍文秀 1 year ago
parent
commit
953f1b0497

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/resource/ResourceVo.java View File

@@ -106,4 +106,6 @@ public class ResourceVo {
106 106
 
107 107
     //资源关联章节
108 108
     private List<DirectorVo> directors;
109
+
110
+    private Integer sharenum;//分享集团校数量
109 111
 }

+ 2
- 2
sstudy/src/main/resources/mapper/question/QuestionMapper.xml View File

@@ -120,7 +120,7 @@
120 120
     </select>
121 121
     <!--管理端试题列表-->
122 122
     <select id="findAll" resultType="java.util.Map">
123
-        select q.questionid,q.score,q.complexity,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.belong,q.createid
123
+        select q.questionid,q.score,q.complexity,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.belong,q.createid,q.schoolid
124 124
         ,q.qtypeid,q.qtypename,q.createtime,q.count,q.qstate,q.source,q.year,q.region,q.schoolname,q.hashear,q.hearfile,q.qlevel
125 125
         ,(select count(*) from t_question q2 where q2.shareqid=q.questionid and q2.qstate=1 and q.schoolid=#{question.schoolid})sharenum
126 126
         from t_question q
@@ -194,7 +194,7 @@
194 194
     <select id="listForSelect" resultType="java.util.Map">
195 195
         select q.questionid,q.score,q.complexity,q.qstem,q.qstemtxt,q.qoption,q.qanswer,q.qanalyze
196 196
         ,q.qtypeid,q.qtypename,q.count,q.ctype,q.source,q.year,q.region,q.schoolname
197
-        ,q.qlevel,q.hearfile,q.hashear,q.belong,q.createid
197
+        ,q.qlevel,q.hearfile,q.hashear,q.belong,q.createid,q.schoolid
198 198
         ,(select count(*) from t_question q2 where q2.shareqid=q.questionid and q2.qstate=1 and q.schoolid=#{question.schoolid})sharenum
199 199
         from t_question q
200 200
         <if test="question.pointid!=null and question.pointid!='0'.toString() and question.pointid!=''">

+ 3
- 1
sstudy/src/main/resources/mapper/resource/ResourceMapper.xml View File

@@ -12,7 +12,7 @@
12 12
     <select id="findAll" resultType="java.util.Map">
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
-        ,r.comm,r.duration,r.resourcesize,r.mp4code,r.createid,r.belong
15
+        ,r.comm,r.duration,r.resourcesize,r.mp4code,r.createid,r.belong,r.schoolid
16 16
         ,r.resourcegrade,r.source,r.year,r.region,r.schoolname
17 17
         ,(select count(*) from t_resource r2 where r2.resourcepid=r.resourceid and r.resourcestate=1)sharenum
18 18
         from t_resource r left join t_user u on u.userid=r.createid
@@ -140,6 +140,7 @@
140 140
         <result property="lsbnum" column="lsbnum"/>
141 141
         <result property="directornum" column="directornum"/>
142 142
         <result property="areaall" column="areaall"/>
143
+        <result property="sharenum" column="sharenum"/>
143 144
         <collection property="directors" ofType="com.xhkjedu.sstudy.vo.subjectbook.DirectorVo" javaType="java.util.List">
144 145
             <result property="lsbid" column="lsbid"/>
145 146
             <result property="directorid" column="directorid"/>
@@ -155,6 +156,7 @@
155 156
         select r.*,u.username createname,rd.lsbid,rd.directorid,d.directorall as directorname
156 157
         ,sb.level,sb.subjectid,s.subjectname,v.versionname,sb.lsbname
157 158
         ,(select a.areaall from t_areazone a where a.areacode=r.region)areaall
159
+        ,(select count(*) from t_resource r2 where r2.resourcepid=r.resourceid and r.resourcestate=1)sharenum
158 160
         from t_resource r left join t_user u on u.userid=r.createid
159 161
         left join t_resource_director rd on r.resourceid = rd.resourceid
160 162
         left join t_director d on rd.directorid = d.directorid

Loading…
Cancel
Save