Переглянути джерело

feat:报表中心异常导出

Joburgess 4 роки тому
батько
коміт
63375f77f0

+ 78 - 76
mec-biz/src/main/resources/config/mybatis/IndexErrDataRecordMapper.xml

@@ -327,10 +327,10 @@
 				AND iip.status_ = 0
 			</if>
 			<if test="startTime != null">
-				AND iip.plan_start_ >= #{startTime}
+				AND irdr.generate_time_ >= #{startTime}
 			</if>
 			<if test="endTime != null">
-				<![CDATA[AND iip.plan_start_ <= #{endTime}]]>
+				<![CDATA[AND irdr.generate_time_ <= #{endTime}]]>
 			</if>
 			<if test="search != null">
 				AND mg.name_ LIKE CONCAT('%', #{search}, '%')
@@ -379,10 +379,10 @@
 				AND FIND_IN_SET(ii.id_,#{ids})
 			</if>
 			<if test="startTime != null">
-				AND i.month_ >= #{startTime}
+				AND irdr.generate_time_ >= #{startTime}
 			</if>
 			<if test="endTime != null">
-				<![CDATA[AND i.month_ <= #{endTime}]]>
+				<![CDATA[AND irdr.generate_time_ <= #{endTime}]]>
 			</if>
 		</where>
 	</sql>
@@ -449,77 +449,79 @@
 	</select>
 
 	<sql id="endFindCourseSchedulesCondition">
-		cs.del_flag_ = 0
-		<if test="searchType == 'ERR_ATTENDANCE'">
-			AND irdr.data_type_ = 'TEACHER_EXCEPTION_ATTENDANCE'
-		</if>
-		<if test="searchType == 'NO_ATTENDANCE'">
-			AND irdr.data_type_ = 'TEACHER_NOT_A_CLASS'
-		</if>
-		<if test="mergeCourseType != null and mergeCourseType != ''">
-			<if test="mergeCourseType == 'MASTER'">
-				AND cs.new_course_id_ = cs.id_
-			</if>
-			<if test="mergeCourseType == 'ASSIST'">
-				AND cs.new_course_id_ > 0 AND cs.new_course_id_ != cs.id_
-			</if>
-			<if test="mergeCourseType == 'ALL'">
-				AND cs.new_course_id_ > 0
-			</if>
-		</if>
-		<if test="isCallNames != null and isCallNames == 1">
-			AND sa.id_ IS NOT NULL
-		</if>
-		<if test="isCallNames != null and isCallNames == 0">
-			AND sa.id_ IS NULL
-		</if>
-		<if test="startTime!=null">
-			AND cs.class_date_ &gt;= DATE_FORMAT(#{startTime},"%Y-%m-%d")
-		</if>
-		<if test="endTime!=null">
-			AND cs.class_date_ &lt;= DATE_FORMAT(#{endTime},"%Y-%m-%d")
-		</if>
-		<if test="courseStatus!=null">
-			AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-		</if>
-		<if test="createStartDate!=null">
-			AND date(cs.create_time_) &gt;= date(#{createStartDate})
-		</if>
-		<if test="createEndDate!=null">
-			AND date(cs.create_time_) &lt;= date(#{createEndDate})
-		</if>
-		<if test="courseType!=null">
-			AND cs.type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-		</if>
-		<if test="groupType!=null">
-			AND cs.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-		</if>
-		<if test="schoolId!=null">
-			AND cs.schoole_id_ = #{schoolId}
-		</if>
-		<if test="teachMode!=null">
-			AND cs.teach_mode_ = #{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-		</if>
-		<if test="teacherIdList != null">
-			AND csts.user_id_=#{teacherIdList}
-		</if>
-		<if test="teachType != null">
-			AND csts.teacher_role_ = #{teachType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-		</if>
-		<if test="organIdList!=null">
-			AND FIND_IN_SET(cs.organ_id_,#{organIdList})
-		</if>
-		<if test="search != null and search != ''">
-			AND (cs.music_group_id_ = #{search} OR cs.id_=#{search} OR cs.name_ LIKE CONCAT('%' ,#{search}, '%' ))
-		</if>
-		<if test="courseIdSearch != null">
-			AND cs.id_ = #{courseIdSearch}
-		</if>
-		<if test="classGroupIds != null and classGroupIds.size() > 0">
-			AND cs.class_group_id_ IN
-			<foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
-				#{classGroupId}
-			</foreach>
-		</if>
+		<where>
+			cs.del_flag_ = 0
+			<if test="searchType == 'ERR_ATTENDANCE'">
+				AND irdr.data_type_ = 'TEACHER_EXCEPTION_ATTENDANCE'
+			</if>
+			<if test="searchType == 'NO_ATTENDANCE'">
+				AND irdr.data_type_ = 'TEACHER_NOT_A_CLASS'
+			</if>
+			<if test="mergeCourseType != null and mergeCourseType != ''">
+				<if test="mergeCourseType == 'MASTER'">
+					AND cs.new_course_id_ = cs.id_
+				</if>
+				<if test="mergeCourseType == 'ASSIST'">
+					AND cs.new_course_id_ > 0 AND cs.new_course_id_ != cs.id_
+				</if>
+				<if test="mergeCourseType == 'ALL'">
+					AND cs.new_course_id_ > 0
+				</if>
+			</if>
+			<if test="isCallNames != null and isCallNames == 1">
+				AND sa.id_ IS NOT NULL
+			</if>
+			<if test="isCallNames != null and isCallNames == 0">
+				AND sa.id_ IS NULL
+			</if>
+			<if test="startTime!=null">
+				AND irdr.generate_time_ &gt;= DATE_FORMAT(#{startTime},"%Y-%m-%d")
+			</if>
+			<if test="endTime!=null">
+				AND irdr.generate_time_ &lt;= DATE_FORMAT(#{endTime},"%Y-%m-%d")
+			</if>
+			<if test="courseStatus!=null">
+				AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="createStartDate!=null">
+				AND date(cs.create_time_) &gt;= date(#{createStartDate})
+			</if>
+			<if test="createEndDate!=null">
+				AND date(cs.create_time_) &lt;= date(#{createEndDate})
+			</if>
+			<if test="courseType!=null">
+				AND cs.type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="groupType!=null">
+				AND cs.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="schoolId!=null">
+				AND cs.schoole_id_ = #{schoolId}
+			</if>
+			<if test="teachMode!=null">
+				AND cs.teach_mode_ = #{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="teacherIdList != null">
+				AND csts.user_id_=#{teacherIdList}
+			</if>
+			<if test="teachType != null">
+				AND csts.teacher_role_ = #{teachType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="organIdList!=null">
+				AND FIND_IN_SET(cs.organ_id_,#{organIdList})
+			</if>
+			<if test="search != null and search != ''">
+				AND (cs.music_group_id_ = #{search} OR cs.id_=#{search} OR cs.name_ LIKE CONCAT('%' ,#{search}, '%' ))
+			</if>
+			<if test="courseIdSearch != null">
+				AND cs.id_ = #{courseIdSearch}
+			</if>
+			<if test="classGroupIds != null and classGroupIds.size() > 0">
+				AND cs.class_group_id_ IN
+				<foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+					#{classGroupId}
+				</foreach>
+			</if>
+		</where>
 	</sql>
 </mapper>