Jelajahi Sumber

教研分析最新代码mapper合并

wangliang 3 tahun lalu
induk
melakukan
9c2247f3b3

+ 33 - 0
teachcloud-report-business/src/main/resources/mapper/TAExamCourseCollegeInspectMapper.xml

@@ -63,4 +63,37 @@
             </if>
         </where>
     </select>
+
+    <select id="findTeacherInspect" resultType="com.qmth.teachcloud.report.business.bean.result.TAExamCourseCollegeInspectResult">
+        select
+            tbe.exam_time as examTime,
+            taecci.course_code as courseCode,
+            taecci.course_name as courseName,
+            tbp.total_score as fullScore,
+            taecci.reality_count as realityCount,
+            taecci.absent_count as absentCount
+        from
+            t_a_exam_course_college_inspect taecci
+        join t_b_exam tbe
+            on tbe.id = taecci.exam_id
+        join t_b_paper tbp
+            on tbp.exam_id = tbe.id and tbp.course_code = taecci.course_code
+            <where>
+                <if test="examId != null and examId != ''">
+                    and taecci.exam_id = #{examId}
+                </if>
+                <if test="schoolId != null and schoolId != ''">
+                    and tbe.school_id = #{schoolId}
+                </if>
+                <if test="semester != null and semester != ''">
+                    and tbe.semester = #{semester}
+                </if>
+                <if test="courseCode != null and courseCode != ''">
+                    and taecci.course_code = #{courseCode}
+                </if>
+                <if test="inspectCollegeId != null and inspectCollegeId != ''">
+                    and taecci.college_id = #{inspectCollegeId}
+                </if>
+            </where>
+    </select>
 </mapper>

+ 8 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseCollegeTeacherMapper.xml

@@ -60,7 +60,8 @@
             a.teach_college_name teachCollegeName,
             round(a.avg_score_assign, 1) avgScore,
             a.teacher_count teacherCount,
-            a.teacher_rank `rank`
+            a.teacher_rank `rank`,
+            a.inspect_college_id as inspectCollegeId
         FROM
             t_a_exam_course_college_teacher a
                 LEFT JOIN
@@ -112,6 +113,7 @@
         LEFT JOIN
         t_b_exam b ON a.exam_id = b.id
         join t_b_exam_course tbec on
+            tbec.exam_id = a.exam_id and
             tbec.course_code = a.course_code
         <where>
             and b.school_id = #{schoolId}
@@ -202,6 +204,7 @@
         LEFT JOIN
         t_b_exam b ON a.exam_id = b.id
         join t_b_exam_course tbec on
+        tbec.exam_id = a.exam_id and
         tbec.course_code = a.course_code
         <where>
             and b.school_id = #{schoolId}
@@ -227,4 +230,8 @@
             </choose>
         </if>
     </select>
+
+    <select id="teacherView" resultType="com.qmth.teachcloud.report.business.bean.result.SurveyTeacherViewResult">
+
+    </select>
 </mapper>

+ 1 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseDifficultMapper.xml

@@ -9,7 +9,7 @@
             tik.count,
             tik.interpret,
             round(tik.sch_avg_score_rate * 100,2) as schAvgScoreRate,
-            round(tik.col_avg_score_rate * 100,2) as myAvgScoreRate
+            round(tik.col_avg_score_rate * 100,2) as colAvgScoreRate
         from t_a_exam_course_difficult tik
        <where>
            <if test="collegeId != null and collegeId != ''">

+ 38 - 0
teachcloud-report-business/src/main/resources/mapper/TAExamCourseRecordMapper.xml

@@ -151,6 +151,44 @@
             <if test="filter != null and filter == true">
                 and tbec.publish_status = 'PUBLISH'
             </if>
+            <if test="inspectCollegeId != null and inspectCollegeId != ''">
+                AND taecr.inspect_college_id = #{inspectCollegeId}
+            </if>
+        </where>
+    </select>
+
+    <select id="findTeacherInspect" resultType="com.qmth.teachcloud.report.business.bean.result.TeachCourseResult">
+        select
+            count(taecr.absent) as absentCount,
+            taecr.absent
+        from
+            t_a_exam_course_record taecr
+        join t_b_exam tbe
+            on
+            tbe.id = taecr.exam_id
+        <where>
+            <if test="inspectCollegeId != null and inspectCollegeId != ''">
+                AND taecr.inspect_college_id = #{inspectCollegeId}
+            </if>
+            <if test="examId != null and examId != ''">
+                AND taecr.exam_id = #{examId}
+            </if>
+            <if test="semester != null and semester != ''">
+                AND tbe.semester = #{semester}
+            </if>
+            <if test="schoolId != null and schoolId != ''">
+                AND tbe.school_id = #{schoolId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                AND taecr.course_code = #{courseCode}
+            </if>
+            <if test="teacherId != null and teacherId != ''">
+                AND taecr.teacher_id = #{teacherId}
+            </if>
         </where>
+        group by
+            taecr.absent
+        order by
+            taecr.absent
     </select>
 </mapper>

+ 1 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseTeacherDifficultMapper.xml

@@ -9,7 +9,7 @@
             tik.count,
             tik.interpret,
             round(tik.sch_avg_score_rate * 100,2) as schAvgScoreRate,
-            round(tik.tea_avg_score_rate * 100,2) as myAvgScoreRate
+            round(tik.tea_avg_score_rate * 100,2) as teaAvgScoreRate
         from t_a_exam_course_teacher_difficult tik
         <where>
             <if test="teacherId != null and teacherId != ''">

+ 2 - 0
teachcloud-report-business/src/main/resources/mapper/TBAnswerMapper.xml

@@ -38,6 +38,8 @@
             answer.sub_number AS subNumber,
             answer.score,
             record.id AS taExamRecordId,
+            record.inspect_college_id AS inspectCollegeId,
+            record.teacher_id AS teacherId,
             record.percent_grade AS percentGrade,
             record.paper_id AS paperId,
             record.paper_type AS paperType

+ 78 - 4
teachcloud-report-business/src/main/resources/mapper/TBDimensionMapper.xml

@@ -12,8 +12,8 @@
             name_primary AS dimensionName,
             interpretation,
             total_count AS totalCount,
-            round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS schScoreRate,
-            round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS colScoreRate,
+            round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS referenceScoreRate,
+            round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS myScoreRate,
             colDio.inspect_college_name AS collegeName,
             round(colDio.score_rate, 1) as degree
         FROM
@@ -69,8 +69,8 @@
         name_primary AS dimensionName,
         interpretation,
         total_count AS totalCount,
-        round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS schScoreRate,
-        round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS colScoreRate,
+        round(CONVERT( papDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS referenceScoreRate,
+        round(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),2) AS myScoreRate,
         colDio.teacher_name AS teacherName,
         round(colDio.score_rate, 1) as degree
         FROM
@@ -115,4 +115,78 @@
             </if>
         </where>
     </select>
+
+    <select id="findDimensionByTeacherCollegeInfo"
+            resultType="com.qmth.teachcloud.report.business.bean.result.CourseDimensionResult">
+        SELECT
+            tmp.exam_id AS examId,
+            (SELECT
+                 tbe.exam_code
+             FROM
+                 t_b_exam tbe
+             WHERE
+                 tbe.id = tmp.exam_id) AS examCode,
+            tmp.course_code AS courseCode,
+            tmp.dimension_type AS module,
+            code_primary AS dimensionCode,
+            name_primary AS dimensionName,
+            interpretation,
+            total_count AS totalCount,
+            ROUND(CONVERT( colDio.score_rate * 100 , DECIMAL (10 , 4 )),
+                  2) AS referenceScoreRate,
+            ROUND(CONVERT( myDio.score_rate * 100 , DECIMAL (10 , 4 )),
+                  2) AS myScoreRate,
+            myDio.teacher_name AS teacherName,
+            ROUND(myDio.score_rate, 1) AS degree
+        FROM
+            (SELECT
+                 exam_id,
+                 course_code,
+                 dimension_type,
+                 code_primary,
+                 name_primary,
+                 interpretation
+             FROM
+                 t_b_dimension
+             GROUP BY exam_id , course_code , dimension_type , code_primary , name_primary , interpretation) tmp
+                INNER JOIN
+            (SELECT
+                 exam_id,
+                 course_code,
+                 dimension_type,
+                 dimension_code,
+                 AVG(score_rate) AS score_rate,
+                 AVG(total_count) AS total_count
+             FROM
+                 t_a_exam_course_dio
+             GROUP BY exam_id , course_code , dimension_type , dimension_code) papDio ON tmp.code_primary = papDio.dimension_code
+                AND tmp.dimension_type = papDio.dimension_type
+                AND tmp.exam_id = papDio.exam_id
+                AND tmp.course_code = papDio.course_code
+                INNER JOIN
+            t_a_exam_course_teacher_college_dio myDio ON tmp.code_primary = myDio.dimension_code
+                AND tmp.dimension_type = myDio.dimension_type
+                AND papDio.exam_id = myDio.exam_id
+                AND papDio.course_code = myDio.course_code
+                INNER JOIN
+            t_a_exam_course_college_inspect_dio colDio ON tmp.dimension_type = colDio.dimension_type
+                AND tmp.code_primary = colDio.dimension_code
+                AND colDio.exam_id = myDio.exam_id
+                AND colDio.course_code = myDio.course_code
+                AND colDio.inspect_college_id = myDio.inspect_college_id
+        <where>
+            <if test="examId != null and examId != ''">
+                and papDio.exam_id = #{examId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and papDio.course_code = #{courseCode}
+            </if>
+            <if test="teacherId != null and teacherId > 0">
+                and myDio.teacher_id = #{teacherId}
+            </if>
+            <if test="inspectCollegeId != null and inspectCollegeId > 0">
+                and myDio.inspect_college_id = #{inspectCollegeId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 18 - 6
teachcloud-report-business/src/main/resources/mapper/TBExamStudentMapper.xml

@@ -118,8 +118,11 @@
             <if test="teacherId != null and teacherId != ''">
                 and tbes.teacher_id = #{teacherId}
             </if>
-            <if test="inspectCollegeId != null and inspectCollegeId != ''">
-                and tbes.inspect_college_id = #{inspectCollegeId}
+            <if test="inspectCollegeIdList != null and inspectCollegeIdList != ''">
+                and tbes.inspect_college_id in
+                <foreach collection="inspectCollegeIdList" item="inspectCollegeId" index="index" open="(" separator="," close=")">
+                    #{inspectCollegeId}
+                </foreach>
             </if>
         </where>
     </select>
@@ -194,9 +197,17 @@
                 </foreach>
             </if>
         </where> ) t
-        <if test="column != null and column != '' and order != null and order != ''">
-            order by t.${column} ${order}
-        </if>
+<!--        <if test="column != null and column != '' and order != null and order != ''">-->
+<!--            order by t.${column} ${order}-->
+<!--        </if>-->
+        <choose>
+            <when test="column != null and column != '' and order != null and order != ''">
+                order by t.${column} ${order}
+            </when>
+            <otherwise>
+                order by t.courseCode ASC,t.current DESC,t.studentCode ASC
+            </otherwise>
+        </choose>
     </select>
 
     <select id="listInspectCollegeResult"
@@ -323,7 +334,8 @@
             a.exam_id examId,
             b.exam_code examCode,
             b.exam_name examName,
-            b.exam_time createTime
+            b.exam_time createTime,
+            b.semester as semester
         FROM
             t_b_exam_student a
                 LEFT JOIN

+ 46 - 16
teachcloud-report-business/src/main/resources/mapper/TBPaperStructMapper.xml

@@ -4,27 +4,57 @@
 
     <select id="findQuestionInfo" resultType="com.qmth.teachcloud.report.business.bean.result.TBPaperStructResult">
         SELECT
-            tbp.paper_type AS paperType,
-            tbps.big_question_number AS mainNumber,
-            tbps.small_question_number AS subNumber,
-            tbps.full_score AS fullScore,
-            tbps.knowledge_dimension AS knowledgeDimension,
-            tbps.ability_dimension AS abilityDimension,
-            round(convert(taps.score_rate * 100,decimal(10,4)),2) AS scoreRate,
-            taps.difficult,
-            convert(taps.validity,decimal(10,4)) AS validity
+            paper_type AS paperType,
+            question_name AS questionName,
+            big_question_number AS mainNumber,
+            small_question_number AS subNumber,
+            full_score AS fullScore,
+            knowledge_dimension AS knowledgeDimension,
+            ability_dimension AS abilityDimension,
+            ROUND(CONVERT( score_rate * 100 , DECIMAL (10 , 4 )),
+            2) AS scoreRate,
+            difficult,
+            CONVERT( validity , DECIMAL (10 , 4 )) AS validity,
+            paper_struct_judge AS paperStructJudge
         FROM
-            t_b_paper_struct tbps
-            join t_a_paper_struct taps
-            on taps.paper_struct_id = tbps.id
-            join t_b_paper tbp
-            on tbp.id = tbps.paper_id
+            t_a_paper_struct
         <where>
             <if test="examId != null and examId != ''">
-                and tbp.exam_id = #{examId}
+                and exam_id = #{examId}
             </if>
             <if test="courseCode != null and courseCode != ''">
-                and tbp.course_code = #{courseCode}
+                and course_code = #{courseCode}
+            </if>
+        </where>
+    </select>
+    <select id="findQuestionInfoByTeacherCollege"
+            resultType="com.qmth.teachcloud.report.business.bean.result.TBPaperStructResult">
+        SELECT
+            paper_type AS paperType,
+            question_name AS questionName,
+            big_question_number AS mainNumber,
+            small_question_number AS subNumber,
+            full_score AS fullScore,
+            knowledge_dimension AS knowledgeDimension,
+            ability_dimension AS abilityDimension,
+            ROUND(CONVERT( score_rate * 100 , DECIMAL (10 , 4 )),
+                  2) AS scoreRate,
+            difficult,
+            paper_struct_judge AS paperStructJudge
+        FROM
+            t_a_exam_course_teacher_college_paper_struct
+        <where>
+            <if test="examId != null and examId > 0">
+                and exam_id = #{examId}
+            </if>
+            <if test="courseCode != null and courseCode.length > 0">
+                and course_code = #{courseCode}
+            </if>
+            <if test="inspectCollegeId != null and inspectCollegeId > 0">
+                and inspect_college_id = #{inspectCollegeId}
+            </if>
+            <if test="teacherId != null and teacherId > 0">
+                and teacher_id = #{teacherId}
             </if>
         </where>
     </select>