瀏覽代碼

修改bug记录SZTZ-070

大数据与最优化研究所 1 年之前
父節點
當前提交
324439272a
共有 1 個文件被更改,包括 36 次插入28 次删除
  1. 36 28
      src/main/resources/mapper/textbook/TextbookMapper.xml

+ 36 - 28
src/main/resources/mapper/textbook/TextbookMapper.xml

@@ -23,13 +23,13 @@
         <if test="dto.textbookType != null and dto.textbookType != ''">
             and t1.textbook_type = #{dto.textbookType}
         </if>
-        <if test="dto.baseSemesterId != null">
+        <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
             and t1.base_semester_id = #{dto.baseSemesterId}
         </if>
-        <if test="dto.subjectGroupId != null">
+        <if test="dto.subjectGroupId != null and dto.subjectGroupId > 0">
             and t1.subject_group_id = #{dto.subjectGroupId}
         </if>
-        <if test="dto.courseSubjectId != null">
+        <if test="dto.courseSubjectId != null and dto.courseSubjectId > 0">
             and t1.course_subject_id = #{dto.courseSubjectId}
         </if>
         <if test="dto.bookName != null and dto.bookName != ''">
@@ -186,13 +186,13 @@
         <if test="dto.textbookType != null and dto.textbookType != ''">
             and t1.textbook_type = #{dto.textbookType}
         </if>
-        <if test="dto.baseSemesterId != null">
+        <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
             and t1.base_semester_id = #{dto.baseSemesterId}
         </if>
-        <if test="dto.subjectGroupId != null">
+        <if test="dto.subjectGroupId != null and dto.subjectGroupId > 0">
             and t1.subject_group_id = #{dto.subjectGroupId}
         </if>
-        <if test="dto.courseSubjectId != null">
+        <if test="dto.courseSubjectId != null and dto.courseSubjectId > 0">
             and t1.course_subject_id = #{dto.courseSubjectId}
         </if>
         <if test="dto.bookName != null and dto.bookName != ''">
@@ -238,13 +238,13 @@
         <if test="dto.textbookType != null and dto.textbookType != ''">
             and t8.textbook_type = #{dto.textbookType}
         </if>
-        <if test="dto.baseSemesterId != null">
+        <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
             and t8.base_semester_id = #{dto.baseSemesterId}
         </if>
-        <if test="dto.subjectGroupId != null">
+        <if test="dto.subjectGroupId != null and dto.subjectGroupId > 0">
             and t8.subject_group_id = #{dto.subjectGroupId}
         </if>
-        <if test="dto.courseSubjectId != null">
+        <if test="dto.courseSubjectId != null and dto.courseSubjectId > 0">
             and t8.course_subject_id = #{dto.courseSubjectId}
         </if>
         <if test="dto.bookName != null and dto.bookName != ''">
@@ -271,41 +271,49 @@
                 left join wf_textbook_claim_item t1 on t1.wf_textbook_claim_id = t.id
                 left join textbook t2 on t2.id = t1.textbook_id
             where claim_type = 'claim_student'
-            <if test="dto.baseSemesterId != null">
+            <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
                 amd t.base_semester_id = #{dto.baseSemesterId}
             </if>
-            <if test="dto.classId != null">
+            <if test="dto.classId != null and dto.classId > 0">
                 and t.class_id = #{dto.classId}
             </if>
-            <if test="dto.textbookId != null">
+            <if test="dto.textbookId != null and dto.textbookId > 0">
                 and t1.textbook_id = #{dto.textbookId}
             </if>
             group by t.base_semester_id, t.class_id, t1.textbook_id
         )
         select
-            t.base_semester_id,
-            t.class_id,
-            t.textbook_id,
-            t2.name as textbookTypeCn,
-            t1.book_name,
-            t1.editor_in_chief,
-            t1.publishing_house,
-            t1.issn,
-            t1.appraisal_price,
-            t1.subtotal,
-            t.num,
-            t.claimNum
+        t.base_semester_id,
+        t3.name as baseSemesterIdCn,
+        t.class_id,
+        t4.name as classIdCn,
+        t5.name as headTeacherName,
+        t6.name as classRoomName,
+        t.textbook_id,
+        t2.name as textbookTypeCn,
+        t1.book_name,
+        t1.editor_in_chief,
+        t1.publishing_house,
+        t1.issn,
+        t1.appraisal_price,
+        t1.subtotal,
+        t.num,
+        t.claimNum
         from textbook_class t
-            left join textbook t1 on t1.id = t.textbook_id
-            left join xjr_dictionary_detail t2 on t2.code = t1.textbook_type
+        left join textbook t1 on t1.id = t.textbook_id
+        left join xjr_dictionary_detail t2 on t2.code = t1.textbook_type
+        left join base_semester t3 on t3.id = t.base_semester_id
+        left join base_class t4 on t4.id = t.class_id
+        left join xjr_user t5 on t5.id = t4.teacher_id
+        left join base_classroom t6 on t6.id = t4.classroom_id
         <where>
             <if test="dto.textbookType != null and dto.textbookType != ''">
                 and t1.textbook_type = #{dto.textbookType}
             </if>
-            <if test="dto.subjectGroupId != null">
+            <if test="dto.subjectGroupId != null and dto.subjectGroupId > 0">
                 and t1.subject_group_id = #{dto.subjectGroupId}
             </if>
-            <if test="dto.courseSubjectId != null">
+            <if test="dto.courseSubjectId != null and dto.courseSubjectId > 0">
                 and t1.course_subject_id = #{dto.courseSubjectId}
             </if>
             <if test="dto.bookName != null and dto.bookName != ''">