Browse Source

登录日志、作业学生完善

tags/正式3.10.0
雍文秀 1 year ago
parent
commit
776d36356c

+ 115
- 113
sstudy/src/main/resources/mapper/paper/PaperMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.xhkjedu.sstudy.mapper.paper.PaperMapper">
3
 <mapper namespace="com.xhkjedu.sstudy.mapper.paper.PaperMapper">
4
     <resultMap id="typeResult" type="com.xhkjedu.sstudy.vo.paper.PaperQtypeVo">
4
     <resultMap id="typeResult" type="com.xhkjedu.sstudy.vo.paper.PaperQtypeVo">
5
-        <result property="qtypeid" column="qtypeid"></result>
6
-        <result property="qtypename" column="qtypename"></result>
7
-        <result property="ptorder" column="ptorder"></result>
8
-        <result property="ptscore" column="ptscore"></result>
9
-        <result property="ptnum" column="ptnum"></result>
10
-        <result property="ctype" column="pctype"></result>
5
+        <result property="qtypeid" column="qtypeid"/>
6
+        <result property="qtypename" column="qtypename"/>
7
+        <result property="ptorder" column="ptorder"/>
8
+        <result property="ptscore" column="ptscore"/>
9
+        <result property="ptnum" column="ptnum"/>
10
+        <result property="ctype" column="pctype"/>
11
         <collection property="questions" ofType="com.xhkjedu.sstudy.vo.question.QuestionVo">
11
         <collection property="questions" ofType="com.xhkjedu.sstudy.vo.question.QuestionVo">
12
-            <result property="questionid" column="questionid"></result>
13
-            <result property="questionpid" column="questionpid"></result>
14
-            <result property="qlevel" column="qlevel"></result>
15
-            <result property="score" column="score"></result>
16
-            <result property="ptqorder" column="ptqorder"></result>
17
-            <result property="ctype" column="ctype"></result>
18
-            <result property="qstem" column="qstem"></result>
19
-            <result property="qoption" column="qoption"></result>
20
-            <result property="qanswer" column="qanswer"></result>
21
-            <result property="qanalyze" column="qanalyze"></result>
22
-            <result property="hashear" column="hashear"></result>
23
-            <result property="hearfile" column="hearfile"></result>
24
-            <result property="qn" column="qn"></result>
25
-            <result property="complexity" column="complexity"></result>
26
-            <result property="qtypename" column="typename"></result>
12
+            <result property="questionid" column="questionid"/>
13
+            <result property="questionpid" column="questionpid"/>
14
+            <result property="qlevel" column="qlevel"/>
15
+            <result property="score" column="score"/>
16
+            <result property="ptqorder" column="ptqorder"/>
17
+            <result property="ctype" column="ctype"/>
18
+            <result property="qstem" column="qstem"/>
19
+            <result property="qoption" column="qoption"/>
20
+            <result property="qanswer" column="qanswer"/>
21
+            <result property="qanalyze" column="qanalyze"/>
22
+            <result property="hashear" column="hashear"/>
23
+            <result property="hearfile" column="hearfile"/>
24
+            <result property="qn" column="qn"/>
25
+            <result property="complexity" column="complexity"/>
26
+            <result property="qtypename" column="typename"/>
27
         </collection>
27
         </collection>
28
     </resultMap>
28
     </resultMap>
29
     <!--获取作业题型列表-->
29
     <!--获取作业题型列表-->
30
     <select id="listPaperType" resultMap="typeResult">
30
     <select id="listPaperType" resultMap="typeResult">
31
-        select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore score,ptq.ptqorder,ptq.qn
32
-        ,q.questionid,ifnull(q.questionpid,q.questionid)questionpid,q.qlevel,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze
31
+        select pt.qtypeid,pt.qtypename,pt.ptorder,pt.ptscore,pt.ptnum,ptq.questionid,ptq.ptqscore as score,ptq.ptqorder,ptq.qn
32
+        ,q.questionid,ifnull(q.questionpid,q.questionid)as questionpid,q.qlevel,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze
33
         ,q.hashear,q.hearfile,q.complexity,q.qtypename typename,pt.ctype pctype
33
         ,q.hashear,q.hearfile,q.complexity,q.qtypename typename,pt.ctype pctype
34
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid
34
         from t_paper_qtype pt left join t_paper_qtype_question ptq on pt.ptid = ptq.ptid
35
         left join t_question q on ptq.questionid = q.questionid
35
         left join t_question q on ptq.questionid = q.questionid
61
 
61
 
62
     <!--作业列表-->
62
     <!--作业列表-->
63
     <resultMap id="paperResult" type="com.xhkjedu.sstudy.vo.paper.PaperListVo">
63
     <resultMap id="paperResult" type="com.xhkjedu.sstudy.vo.paper.PaperListVo">
64
-        <result property="paperid" column="paperid"></result>
65
-        <result property="papername" column="papername"></result>
66
-        <result property="papertype" column="papertype"></result>
67
-        <result property="paperclass" column="paperclass"></result>
68
-        <result property="paperstate" column="paperstate"></result>
69
-        <result property="checktype" column="checktype"></result>
70
-        <result property="createid" column="createid"></result>
71
-        <result property="createtime" column="createtime"></result>
72
-        <result property="createname" column="createname"></result>
73
-        <result property="starttime" column="starttime"></result>
74
-        <result property="stoptime" column="stoptime"></result>
75
-        <result property="papernum" column="papernum"></result>
76
-        <result property="timetype" column="timetype"></result>
77
-        <result property="showtype" column="showtype"></result>
78
-        <result property="schoolid" column="schoolid"></result>
79
-        <result property="logschoolid" column="logschoolid"></result>
80
-        <result property="classnum" column="classnum"></result>
81
-        <result property="ytjnum" column="ytjnum"></result>
82
-        <result property="ypgnum" column="ypgnum"></result>
64
+        <result property="paperid" column="paperid"/>
65
+        <result property="papername" column="papername"/>
66
+        <result property="papertype" column="papertype"/>
67
+        <result property="paperclass" column="paperclass"/>
68
+        <result property="paperstate" column="paperstate"/>
69
+        <result property="checktype" column="checktype"/>
70
+        <result property="createid" column="createid"/>
71
+        <result property="createtime" column="createtime"/>
72
+        <result property="createname" column="createname"/>
73
+        <result property="starttime" column="starttime"/>
74
+        <result property="stoptime" column="stoptime"/>
75
+        <result property="papernum" column="papernum"/>
76
+        <result property="timetype" column="timetype"/>
77
+        <result property="showtype" column="showtype"/>
78
+        <result property="schoolid" column="schoolid"/>
79
+        <result property="logschoolid" column="logschoolid"/>
80
+        <result property="classnum" column="classnum"/>
81
+        <result property="ytjnum" column="ytjnum"/>
82
+        <result property="ypgnum" column="ypgnum"/>
83
         <collection property="schools" ofType="java.util.Map" javaType="java.util.List"
83
         <collection property="schools" ofType="java.util.Map" javaType="java.util.List"
84
                     select="listClass" column="{paperid=paperid,createid=createid,checkid=checkid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
84
                     select="listClass" column="{paperid=paperid,createid=createid,checkid=checkid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
85
         </collection>
85
         </collection>
86
         <collection property="checklist" ofType="java.util.Map" javaType="java.util.List"
86
         <collection property="checklist" ofType="java.util.Map" javaType="java.util.List"
87
                     select="listPaperCheckStu" column="{paperid=paperid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
87
                     select="listPaperCheckStu" column="{paperid=paperid,checktype=checktype,logschoolid=logschoolid,classids=classids}">
88
-            <result property="userid" column="userid"></result>
89
-            <result property="username" column="username"></result>
90
-            <result property="classid" column="classid"></result>
91
-            <result property="classname" column="classname"></result>
92
-            <result property="gradeid" column="gradeid"></result>
88
+            <result property="userid" column="userid"/>
89
+            <result property="username" column="username"/>
90
+            <result property="classid" column="classid"/>
91
+            <result property="classname" column="classname"/>
92
+            <result property="gradeid" column="gradeid"/>
93
         </collection>
93
         </collection>
94
     </resultMap>
94
     </resultMap>
95
     <resultMap id="classResult" type="java.util.Map">
95
     <resultMap id="classResult" type="java.util.Map">
96
-        <result property="schoolid" column="schoolid"></result>
97
-        <result property="schoolname" column="schoolname"></result>
96
+        <result property="schoolid" column="schoolid"/>
97
+        <result property="schoolname" column="schoolname"/>
98
         <collection property="classes" ofType="com.xhkjedu.sstudy.vo.paper.PaperClassVo" javaType="java.util.List">
98
         <collection property="classes" ofType="com.xhkjedu.sstudy.vo.paper.PaperClassVo" javaType="java.util.List">
99
-            <result property="schoolid" column="schoolid"></result>
100
-            <result property="classid" column="classid"></result>
101
-            <result property="classname" column="classname"></result>
102
-            <result property="gradeid" column="gradeid"></result>
103
-            <result property="classnum" column="classnum"></result>
104
-            <result property="ytjnum" column="ytjnum"></result>
105
-            <result property="ypgnum" column="ypgnum"></result>
106
-            <result property="studentname" column="studentname"></result>
107
-            <result property="checkid" column="checkid"></result>
108
-            <result property="teachername" column="teachername"></result>
109
-            <result property="checked" column="checked"></result>
99
+            <result property="schoolid" column="schoolid"/>
100
+            <result property="classid" column="classid"/>
101
+            <result property="classname" column="classname"/>
102
+            <result property="gradeid" column="gradeid"/>
103
+            <result property="classnum" column="classnum"/>
104
+            <result property="ytjnum" column="ytjnum"/>
105
+            <result property="ypgnum" column="ypgnum"/>
106
+            <result property="studentname" column="studentname"/>
107
+            <result property="checkid" column="checkid"/>
108
+            <result property="teachername" column="teachername"/>
109
+            <result property="checked" column="checked"/>
110
         </collection>
110
         </collection>
111
     </resultMap>
111
     </resultMap>
112
     <!--<select id="listClass" resultMap="classResult">
112
     <!--<select id="listClass" resultMap="classResult">
130
     </select>-->
130
     </select>-->
131
     <!--本校作业班级-->
131
     <!--本校作业班级-->
132
     <select id="listClass" resultMap="classResult">
132
     <select id="listClass" resultMap="classResult">
133
-        select count(*) classnum,ps.classid,c.classname,c.gradeid,c.schoolid,s.schoolname
134
-        ,count(distinct case when ps.psstate in (1,2) then ps.psid else null end)ytjnum
135
-        ,count(distinct case when ps.pschecked=1 then ps.psid else null end)ypgnum
133
+        select count(*) as classnum,ps.classid,c.classname,c.gradeid,c.schoolid,s.schoolname
134
+        ,count(distinct if(ps.psstate in (1,2), ps.psid, null))ytjnum
135
+        ,count(distinct if(ps.pschecked=1, ps.psid, null))ypgnum
136
         from t_paper_student ps left join t_class c on ps.classid=c.classid
136
         from t_paper_student ps left join t_class c on ps.classid=c.classid
137
         left join t_school s on c.schoolid = s.schoolid
137
         left join t_school s on c.schoolid = s.schoolid
138
         where ps.paperid=#{paperid}
138
         where ps.paperid=#{paperid}
140
             and ps.classid in(${classids})
140
             and ps.classid in(${classids})
141
         </if>
141
         </if>
142
         group by ps.classid
142
         group by ps.classid
143
-        order by case c.schoolid when #{logschoolid} then 0 else c.schoolid end,c.gradeid,c.classtype,c.classorder
143
+        order by if(c.schoolid = #{logschoolid}, 0, c.schoolid)
144
+        ,c.gradeid,c.classtype,c.classorder
144
     </select>
145
     </select>
145
     <!--本校作业班级批阅人-->
146
     <!--本校作业班级批阅人-->
146
     <resultMap id="checkUserResult" type="java.util.Map">
147
     <resultMap id="checkUserResult" type="java.util.Map">
147
-        <result property="schoolid" column="schoolid"></result>
148
-        <result property="schoolname" column="schoolname"></result>
149
-        <result property="checktype" column="checktype"></result>
148
+        <result property="schoolid" column="schoolid"/>
149
+        <result property="schoolname" column="schoolname"/>
150
+        <result property="checktype" column="checktype"/>
150
         <collection property="classes" ofType="java.util.Map" javaType="java.util.List">
151
         <collection property="classes" ofType="java.util.Map" javaType="java.util.List">
151
-            <result property="schoolid" column="schoolid"></result>
152
-            <result property="classid" column="classid"></result>
153
-            <result property="classname" column="classname"></result>
154
-            <result property="gradeid" column="gradeid"></result>
152
+            <result property="schoolid" column="schoolid"/>
153
+            <result property="classid" column="classid"/>
154
+            <result property="classname" column="classname"/>
155
+            <result property="gradeid" column="gradeid"/>
155
             <collection property="users" ofType="java.util.Map" javaType="java.util.List">
156
             <collection property="users" ofType="java.util.Map" javaType="java.util.List">
156
-                <result property="userid" column="userid"></result>
157
-                <result property="username" column="username"></result>
157
+                <result property="userid" column="userid"/>
158
+                <result property="username" column="username"/>
158
             </collection>
159
             </collection>
159
         </collection>
160
         </collection>
160
     </resultMap>
161
     </resultMap>
161
     <select id="listPaperCheckStu" resultMap="checkUserResult">
162
     <select id="listPaperCheckStu" resultMap="checkUserResult">
162
          <if test="checktype==1">
163
          <if test="checktype==1">
163
-           select pg.checkid userid,u.username,c.classid,c.classname,c.gradeid,pg.schoolid,s.schoolname
164
+           select pg.checkid as userid,u.username,c.classid,c.classname,c.gradeid,pg.schoolid,s.schoolname
164
            from t_paper_class pg left join t_school s on pg.schoolid=s.schoolid
165
            from t_paper_class pg left join t_school s on pg.schoolid=s.schoolid
165
            left join t_user u on pg.checkid=u.userid
166
            left join t_user u on pg.checkid=u.userid
166
            left join t_class c on pg.classid=c.classid
167
            left join t_class c on pg.classid=c.classid
168
              <if test="classids!=null and classids!=''">
169
              <if test="classids!=null and classids!=''">
169
                  and pg.classid in(${classids})
170
                  and pg.classid in(${classids})
170
              </if>
171
              </if>
171
-             order by case c.schoolid when #{logschoolid} then 0 else c.schoolid end,
172
+             order by if(c.schoolid = #{logschoolid}, 0, c.schoolid),
172
              c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
173
              c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
173
-       </if>
174
+         </if>
174
        <if test="checktype==3">
175
        <if test="checktype==3">
175
-           select ps.checkid userid,u.username,c.classid,c.classname,c.gradeid,ps.schoolid,s.schoolname
176
+           select ps.checkid as userid,u.username,c.classid,c.classname,c.gradeid,ps.schoolid,s.schoolname
176
            from t_paper_student ps left join t_school s on ps.schoolid=s.schoolid
177
            from t_paper_student ps left join t_school s on ps.schoolid=s.schoolid
177
            left join t_user u on ps.checkid=u.userid
178
            left join t_user u on ps.checkid=u.userid
178
            left join t_class c on ps.classid=c.classid
179
            left join t_class c on ps.classid=c.classid
181
                and ps.classid in(${classids})
182
                and ps.classid in(${classids})
182
            </if>
183
            </if>
183
            group by ps.classid,ps.checkid
184
            group by ps.classid,ps.checkid
184
-           order by case c.schoolid when #{logschoolid} then 0 else c.schoolid end,
185
+           order by IF(c.schoolid = #{logschoolid}, 0, c.schoolid),
185
            c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
186
            c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
186
        </if>
187
        </if>
187
         <if test="checktype!=1 and checktype!=3">
188
         <if test="checktype!=1 and checktype!=3">
192
     <!--教师作业列表-->
193
     <!--教师作业列表-->
193
     <select id="listAll" resultMap="paperResult">
194
     <select id="listAll" resultMap="paperResult">
194
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,
195
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.schoolid,p.hasreport,p.timetype,
195
-        #{paper.schoolid} logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{paper.createid} checkid
196
+        #{paper.schoolid} logschoolid,u.username createname,pg.starttime,pg.stoptime,pg.showtype,p.papernum,p.createid,#{paper.createid} as checkid
196
         ,group_concat(pg.classid) classids
197
         ,group_concat(pg.classid) classids
197
         from t_paper p left join t_user u on p.createid=u.userid
198
         from t_paper p left join t_user u on p.createid=u.userid
198
         left join t_paper_class pg on p.paperid=pg.paperid
199
         left join t_paper_class pg on p.paperid=pg.paperid
244
     </select>
245
     </select>
245
     <!--教师批阅列表-->
246
     <!--教师批阅列表-->
246
     <select id="correctList" resultMap="paperResult">
247
     <select id="correctList" resultMap="paperResult">
247
-        select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.createid,#{checkid} checkid,p.schoolid as logschoolid
248
+        select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.createid,#{checkid} as checkid,p.schoolid as logschoolid
248
         ,u.username createname,pg.starttime,pg.stoptime,p.papernum
249
         ,u.username createname,pg.starttime,pg.stoptime,p.papernum
249
         ,group_concat(pg.classid) classids
250
         ,group_concat(pg.classid) classids
250
         from t_paper p left join t_user u on p.createid=u.userid
251
         from t_paper p left join t_user u on p.createid=u.userid
259
     </update>
260
     </update>
260
     <!--获取批改学生列表-->
261
     <!--获取批改学生列表-->
261
     <resultMap id="checkResult" type="com.xhkjedu.sstudy.vo.paper.CheckClassVo">
262
     <resultMap id="checkResult" type="com.xhkjedu.sstudy.vo.paper.CheckClassVo">
262
-        <result property="classid" column="classid"></result>
263
-        <result property="classname" column="classname"></result>
264
-        <result property="classnum" column="classnum"></result>
265
-        <result property="ytjnum" column="ytjnum"></result>
266
-        <result property="ypynum" column="ypynum"></result>
263
+        <result property="classid" column="classid"/>
264
+        <result property="classname" column="classname"/>
265
+        <result property="classnum" column="classnum"/>
266
+        <result property="ytjnum" column="ytjnum"/>
267
+        <result property="ypynum" column="ypynum"/>
267
         <collection property="students" ofType="com.xhkjedu.sstudy.vo.paperstudent.StudentVo"
268
         <collection property="students" ofType="com.xhkjedu.sstudy.vo.paperstudent.StudentVo"
268
                     javaType="java.util.List" select="listStudent" column="{paperid=paperid,classid=classid}">
269
                     javaType="java.util.List" select="listStudent" column="{paperid=paperid,classid=classid}">
269
         </collection>
270
         </collection>
270
     </resultMap>
271
     </resultMap>
271
     <resultMap id="studentResult" type="com.xhkjedu.sstudy.vo.paperstudent.StudentVo">
272
     <resultMap id="studentResult" type="com.xhkjedu.sstudy.vo.paperstudent.StudentVo">
272
-        <result property="psid" column="psid"></result>
273
-        <result property="studentid" column="studentid"></result>
274
-        <result property="studentname" column="studentname"></result>
275
-        <result property="pschecked" column="pschecked"></result>
273
+        <result property="psid" column="psid"/>
274
+        <result property="studentid" column="studentid"/>
275
+        <result property="studentname" column="studentname"/>
276
+        <result property="pschecked" column="pschecked"/>
276
     </resultMap>
277
     </resultMap>
277
     <select id="listStudent" resultMap="studentResult">
278
     <select id="listStudent" resultMap="studentResult">
278
         select ps.psid,ps.studentid,u.username studentname,ps.pschecked
279
         select ps.psid,ps.studentid,u.username studentname,ps.pschecked
281
         order by ps.pschecked,convert(u.username using gbk),u.userid
282
         order by ps.pschecked,convert(u.username using gbk),u.userid
282
     </select>
283
     </select>
283
     <select id="listStudentsByPaperIdCheckId" resultMap="checkResult">
284
     <select id="listStudentsByPaperIdCheckId" resultMap="checkResult">
284
-        select ps.classid,c.classname,c.gradeid,count(*)classnum,ps.paperid
285
-        ,count(distinct case when ps.psstate in(1,2) then ps.psid else null end)ytjnum
286
-        ,count(distinct case when ps.pschecked=1 then ps.psid else null end)ypynum
287
-        from t_paper_student ps left join t_class c on ps.classid=c.classid
288
-        where ps.paperid=#{paperid} and ps.classid=#{classid}
285
+        select ps.classid,c.classname,c.gradeid,count(*) as classnum,ps.paperid
286
+        ,count(distinct IF(ps.psstate in (1, 2), ps.psid, null)) ytjnum
287
+        ,count(distinct IF(ps.pschecked = 1, ps.psid, null)) ypynum
288
+        from t_paper_student ps left join t_class c on ps.classid = c.classid
289
+        where ps.paperid = #{paperid} and ps.classid = #{classid}
289
     </select>
290
     </select>
290
     <!--作业附件列表-->
291
     <!--作业附件列表-->
291
     <select id="listPaperFile" resultType="com.xhkjedu.sstudy.model.paper.TPaperFile">
292
     <select id="listPaperFile" resultType="com.xhkjedu.sstudy.model.paper.TPaperFile">
298
     <!--获取年级下教师发布作业列表-->
299
     <!--获取年级下教师发布作业列表-->
299
     <select id="listPaper" resultMap="paperResult">
300
     <select id="listPaper" resultMap="paperResult">
300
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.timetype
301
         select p.paperid,p.papername,p.papertype,p.paperclass,p.paperstate,p.checktype,p.createtime,p.timetype
301
-        ,pg.starttime,pg.stoptime,p.papernum,p.createid,#{paper.teacherid} checkid,p.schoolid,#{paper.schoolid} logschoolid
302
+        ,pg.starttime,pg.stoptime,p.papernum,p.createid,#{paper.teacherid} as checkid,p.schoolid,#{paper.schoolid} as logschoolid
302
         ,pg.showtype,p.hasreport,group_concat(pg.classid) classids
303
         ,pg.showtype,p.hasreport,group_concat(pg.classid) classids
303
         ,(select u.username from t_user u where u.userid=p.createid)createname
304
         ,(select u.username from t_user u where u.userid=p.createid)createname
304
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
305
         from t_paper p left join t_paper_class pg on p.paperid=pg.paperid
347
 
348
 
348
     <!--获取批阅班级-->
349
     <!--获取批阅班级-->
349
     <resultMap id="schoolMap" type="java.util.Map">
350
     <resultMap id="schoolMap" type="java.util.Map">
350
-        <result property="schoolid" column="schoolid"></result>
351
-        <result property="schoolname" column="schoolname"></result>
351
+        <result property="schoolid" column="schoolid"/>
352
+        <result property="schoolname" column="schoolname"/>
352
         <collection property="classes" ofType="java.util.Map" javaType="java.util.List">
353
         <collection property="classes" ofType="java.util.Map" javaType="java.util.List">
353
-            <result property="classid" column="classid"></result>
354
-            <result property="classname" column="classname"></result>
355
-            <result property="gradeid" column="gradeid"></result>
356
-            <result property="schoolid" column="schoolid"></result>
357
-            <result property="checked" column="checked"></result>
354
+            <result property="classid" column="classid"/>
355
+            <result property="classname" column="classname"/>
356
+            <result property="gradeid" column="gradeid"/>
357
+            <result property="schoolid" column="schoolid"/>
358
+            <result property="checked" column="checked"/>
358
         </collection>
359
         </collection>
359
     </resultMap>
360
     </resultMap>
360
     <select id="listPaperClass" resultMap="schoolMap">
361
     <select id="listPaperClass" resultMap="schoolMap">
367
             and pg.checkid=#{checkid}
368
             and pg.checkid=#{checkid}
368
         </if>
369
         </if>
369
         group by pg.classid
370
         group by pg.classid
370
-        order by ps.pschecked,case c.schoolid when #{schoolid} then 0 else c.schoolid end,c.gradeid,c.classtype,c.classorder
371
+        order by ps.pschecked,if(c.schoolid = #{schoolid}, 0, c.schoolid)
372
+        ,c.gradeid,c.classtype,c.classorder
371
     </select>
373
     </select>
372
     <!--根据作业id获取作业分类-->
374
     <!--根据作业id获取作业分类-->
373
     <select id="getPaperTypeById" resultType="java.lang.Integer">
375
     <select id="getPaperTypeById" resultType="java.lang.Integer">
440
         group by ct.teacherid order by c.classtype,c.classorder, convert(u.username using gbk)
442
         group by ct.teacherid order by c.classtype,c.classorder, convert(u.username using gbk)
441
     </select>
443
     </select>
442
     <resultMap id="paperStudentList" type="java.util.Map">
444
     <resultMap id="paperStudentList" type="java.util.Map">
443
-        <result property="schoolid" column="schoolid"></result>
444
-        <result property="schoolname" column="schoolname"></result>
445
+        <result property="schoolid" column="schoolid"/>
446
+        <result property="schoolname" column="schoolname"/>
445
         <collection property="classlist" ofType="java.util.Map" javaType="java.util.List">
447
         <collection property="classlist" ofType="java.util.Map" javaType="java.util.List">
446
-            <result property="classid" column="classid"></result>
447
-            <result property="classname" column="classname"></result>
448
-            <result property="gradeid" column="gradeid"></result>
449
-            <result property="classnum" column="classnum"></result>
448
+            <result property="classid" column="classid"/>
449
+            <result property="classname" column="classname"/>
450
+            <result property="gradeid" column="gradeid"/>
451
+            <result property="classnum" column="classnum"/>
450
             <collection property="students" ofType="java.util.Map" javaType="java.util.List">
452
             <collection property="students" ofType="java.util.Map" javaType="java.util.List">
451
-                <result property="studentid" column="studentid"></result>
452
-                <result property="studentname" column="studentname"></result>
453
-                <result property="headpic" column="headpic"></result>
453
+                <result property="studentid" column="studentid"/>
454
+                <result property="studentname" column="studentname"/>
455
+                <result property="headpic" column="headpic"/>
454
             </collection>
456
             </collection>
455
         </collection>
457
         </collection>
456
     </resultMap>
458
     </resultMap>
458
     <select id="listPaperStudentsByPaperid" resultMap="paperStudentList">
460
     <select id="listPaperStudentsByPaperid" resultMap="paperStudentList">
459
         select u.schoolid,s.schoolname, pg.classid,c.classname,c.gradeid,c.classnum,cs.studentid,u.username studentname
461
         select u.schoolid,s.schoolname, pg.classid,c.classname,c.gradeid,c.classnum,cs.studentid,u.username studentname
460
         from t_paper_class pg left join t_class c on pg.classid=c.classid
462
         from t_paper_class pg left join t_class c on pg.classid=c.classid
461
-        left join t_class_student cs on c.classid = cs.classid
463
+        left join t_paper_student cs on pg.paperid=cs.paperid and pg.classid=cs.classid
462
         left join t_user u on cs.studentid=u.userid
464
         left join t_user u on cs.studentid=u.userid
463
         left join t_school s on s.schoolid=u.schoolid
465
         left join t_school s on s.schoolid=u.schoolid
464
         where pg.paperid=#{paperid} order by s.createtime desc, c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
466
         where pg.paperid=#{paperid} order by s.createtime desc, c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)

+ 4
- 0
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java View File

414
         } else {
414
         } else {
415
             if(N_Utils.isNotEmpty(result.getObj())){
415
             if(N_Utils.isNotEmpty(result.getObj())){
416
                 userVo = (UserVo) result.getObj();
416
                 userVo = (UserVo) result.getObj();
417
+            } else {
418
+                userVo = new UserVo();
419
+                userVo.setLoginname(user.getLoginname());
420
+                userVo.setLoginpwd(loginpwd);
417
             }
421
             }
418
             userLog.setLoginstate(2);
422
             userLog.setLoginstate(2);
419
             if(result.getMsg().contains("密码错误")){
423
             if(result.getMsg().contains("密码错误")){

Loading…
Cancel
Save