Explorar o código

Merge branch 'teacher_client_salary'

Joburgess %!s(int64=4) %!d(string=hai) anos
pai
achega
b0462892a8

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java

@@ -547,6 +547,11 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
 													@Param("courseStatus") CourseStatusEnum courseStatus,
 													@Param("courseStatus") CourseStatusEnum courseStatus,
 													@Param("teachIncomeType") String teachIncomeType);
 													@Param("teachIncomeType") String teachIncomeType);
 
 
+
+	List<LocalDateBigDecimalMapDto> teacherIncomeStatOld(@Param("teacherId") Integer teacherId,
+													  @Param("year") Integer year,
+													  @Param("month") Integer month);
+
 	/**
 	/**
 	 * @describe 教师年度收入统计
 	 * @describe 教师年度收入统计
 	 * @author Joburgess
 	 * @author Joburgess

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -2321,7 +2321,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             return result;
             return result;
         }
         }
 
 
-        List<LocalDateBigDecimalMapDto> monthIncomeMapList = courseScheduleTeacherSalaryDao.teacherIncomeStat(teacherId, year, month);
+        List<LocalDateBigDecimalMapDto> monthIncomeMapList = courseScheduleTeacherSalaryDao.teacherIncomeStatOld(teacherId, year, month);
 
 
         if(CollectionUtils.isEmpty(monthIncomeMapList)){
         if(CollectionUtils.isEmpty(monthIncomeMapList)){
             return result;
             return result;

+ 37 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml

@@ -1110,6 +1110,43 @@
 			</if>
 			</if>
 	</select>
 	</select>
 
 
+	<select id="teacherIncomeStatOld" resultType="com.ym.mec.biz.dal.dto.LocalDateBigDecimalMapDto">
+		SELECT
+		<if test="month==null">
+			CONCAT(DATE_FORMAT( cs.class_date_, '%Y-%m' ), '-01') date,
+			CONCAT(DATE_FORMAT( cs.class_date_, '%Y-%m' )) dateStr,
+		</if>
+		<if test="month!=null">
+			DATE_FORMAT( cs.class_date_, '%Y-%m-%d' ) date,
+			DATE_FORMAT( cs.class_date_, '%Y-%m-%d' ) dateStr,
+		</if>
+		SUM( csts.subsidy_ ) amount
+		FROM
+		course_schedule_teacher_salary csts
+		LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
+		WHERE
+		( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
+		AND ( cs.is_lock_ = 0 OR cs.is_lock_ IS NULL )
+		AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ )
+		AND csts.user_id_ = #{teacherId}
+		<if test="year!=null">
+			AND YEAR ( cs.class_date_ ) = #{year}
+		</if>
+		AND csts.actual_salary_ &gt; 0
+		<if test="month!=null">
+			AND MONTH(cs.class_date_) = #{month}
+		</if>
+		AND cs.class_date_ &gt;= '2021-03-01'
+		AND csts.settlement_time_ IS NOT NULL
+		GROUP BY
+		<if test="month==null">
+			MONTH(cs.class_date_)
+		</if>
+		<if test="month!=null">
+			DATE_FORMAT( cs.class_date_, '%Y-%m-%d' )
+		</if>
+	</select>
+
 	<select id="teacherIncomeStat" resultType="com.ym.mec.biz.dal.dto.LocalDateBigDecimalMapDto">
 	<select id="teacherIncomeStat" resultType="com.ym.mec.biz.dal.dto.LocalDateBigDecimalMapDto">
 		SELECT
 		SELECT
 			<if test="month==null">
 			<if test="month==null">