zouxuan há 4 anos atrás
pai
commit
d89a56a18c

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExportStudentAttendanceQueryInfo.java

@@ -7,6 +7,26 @@ public class ExportStudentAttendanceQueryInfo extends QueryInfo {
 
     private String groupType = "MUSIC";
 
+    private String classStartDate;
+
+    private String classEndDate;
+
+    public String getClassStartDate() {
+        return classStartDate;
+    }
+
+    public void setClassStartDate(String classStartDate) {
+        this.classStartDate = classStartDate;
+    }
+
+    public String getClassEndDate() {
+        return classEndDate;
+    }
+
+    public void setClassEndDate(String classEndDate) {
+        this.classEndDate = classEndDate;
+    }
+
     public String getOrganId() {
         return organId;
     }

+ 11 - 9
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -538,6 +538,9 @@
         SELECT COUNT(cssp.id_)
         FROM course_schedule_student_payment cssp
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        <include refid="exportStudentAttendancesQueryPageSql"/>
+    </select>
+    <sql id="exportStudentAttendancesQueryPageSql">
         <where>
             <if test="organId != null">
                 AND FIND_IN_SET(cs.organ_id_,#{organId})
@@ -545,8 +548,14 @@
             <if test="groupType != null">
                 AND cssp.group_type_ = #{groupType}
             </if>
+            <if test="classStartDate != null and classStartDate != ''">
+                AND cs.class_date_ >= #{classStartDate}
+            </if>
+            <if test="classEndDate != null and classEndDate != ''">
+                AND cs.class_date_ &lt;= #{classEndDate}
+            </if>
         </where>
-    </select>
+    </sql>
     <select id="exportStudentAttendancesQueryPage"
             resultMap="ExportStudentAttendanceDtoMap">
         SELECT o.name_ organ_name_,o.id_ organ_id_,cs.music_group_id_,mg.name_ music_group_name_,su.username_,cssp.user_id_,
@@ -571,14 +580,7 @@
         LEFT JOIN student st ON st.user_id_ = cssp.user_id_
         LEFT JOIN sys_user su ON su.id_ = cssp.user_id_
         LEFT JOIN sys_user su2 ON su2.id_ = st.teacher_id_
-        <where>
-            <if test="organId != null">
-                AND FIND_IN_SET(cs.organ_id_,#{organId})
-            </if>
-            <if test="groupType != null">
-                AND cssp.group_type_ = #{groupType}
-            </if>
-        </where>
+        <include refid="exportStudentAttendancesQueryPageSql"/>
         ORDER BY cssp.music_group_id_ DESC,cssp.id_ DESC
         <include refid="global.limit"/>
     </select>