|
@@ -141,16 +141,39 @@
|
|
<select id="getStudentSignUpData" resultMap="IndexBaseMonthData">
|
|
<select id="getStudentSignUpData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
organ_id_,
|
|
organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( id_ ) total_num_,
|
|
COUNT( id_ ) total_num_,
|
|
COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END) activate_num_,
|
|
COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END) activate_num_,
|
|
TRUNCATE(COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END)/COUNT( id_ )*100, 2) percent_
|
|
TRUNCATE(COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END)/COUNT( id_ )*100, 2) percent_
|
|
- FROM sys_user
|
|
|
|
|
|
+ FROM
|
|
|
|
+ ((
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ sr.user_id_
|
|
|
|
+ FROM
|
|
|
|
+ student_registration sr
|
|
|
|
+ LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
|
|
|
|
+ WHERE
|
|
|
|
+ mg.status_ IN ( 'PREPARE', 'PROGRESS' )
|
|
|
|
+ AND sr.music_group_status_ = 'NORMAL'
|
|
|
|
+ ) UNION
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ cssp.user_id_
|
|
|
|
+ FROM
|
|
|
|
+ course_schedule_student_payment cssp
|
|
|
|
+ LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
|
|
|
|
+ WHERE
|
|
|
|
+ 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 cs.organ_id_ IS NOT NULL
|
|
|
|
+ )) u
|
|
|
|
+ LEFT JOIN sys_user su ON u.user_id_ = su.id_
|
|
WHERE
|
|
WHERE
|
|
del_flag_=0
|
|
del_flag_=0
|
|
AND organ_id_ IS NOT NULL
|
|
AND organ_id_ IS NOT NULL
|
|
AND user_type_ LIKE '%STUDENT%'
|
|
AND user_type_ LIKE '%STUDENT%'
|
|
- AND DATE_FORMAT(create_time_, '%Y-%m')<=#{month}
|
|
|
|
|
|
+ AND DATE_FORMAT(create_time_, '%Y-%m-%d')<=#{dayStr}
|
|
GROUP BY organ_id_
|
|
GROUP BY organ_id_
|
|
ORDER BY organ_id_;
|
|
ORDER BY organ_id_;
|
|
</select>
|
|
</select>
|
|
@@ -158,7 +181,7 @@
|
|
<select id="getHomeworkData" resultMap="IndexBaseMonthData">
|
|
<select id="getHomeworkData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
su.organ_id_,
|
|
su.organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
<choose>
|
|
<choose>
|
|
<when test="type == 'submit'">
|
|
<when test="type == 'submit'">
|
|
SUM(sees.actual_exercises_num_) total_num_,
|
|
SUM(sees.actual_exercises_num_) total_num_,
|
|
@@ -180,8 +203,7 @@
|
|
LEFT JOIN sys_user su ON sees.student_id_=su.id_
|
|
LEFT JOIN sys_user su ON sees.student_id_=su.id_
|
|
WHERE su.del_flag_=0
|
|
WHERE su.del_flag_=0
|
|
AND su.organ_id_ IS NOT NULL
|
|
AND su.organ_id_ IS NOT NULL
|
|
- AND YEAR(sees.monday_)=YEAR(CONCAT(#{month}, '-01'))
|
|
|
|
- AND MONTH(sees.monday_)=MONTH(CONCAT(#{month}, '-01'))
|
|
|
|
|
|
+ AND sees.monday_<=#{dayStr}
|
|
GROUP BY su.organ_id_
|
|
GROUP BY su.organ_id_
|
|
ORDER BY su.organ_id_
|
|
ORDER BY su.organ_id_
|
|
</select>
|
|
</select>
|
|
@@ -189,7 +211,7 @@
|
|
<select id="getSchoolData" resultMap="IndexBaseMonthData">
|
|
<select id="getSchoolData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
mg.organ_id_,
|
|
mg.organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( DISTINCT mg.cooperation_organ_id_ ) total_num_,
|
|
COUNT( DISTINCT mg.cooperation_organ_id_ ) total_num_,
|
|
COUNT( DISTINCT mg.cooperation_organ_id_ ) activate_num_,
|
|
COUNT( DISTINCT mg.cooperation_organ_id_ ) activate_num_,
|
|
COUNT( DISTINCT mg.cooperation_organ_id_ ) percent_
|
|
COUNT( DISTINCT mg.cooperation_organ_id_ ) percent_
|
|
@@ -197,8 +219,9 @@
|
|
music_group mg
|
|
music_group mg
|
|
WHERE
|
|
WHERE
|
|
mg.del_flag_ = 0
|
|
mg.del_flag_ = 0
|
|
- AND mg.organ_id_ IS NOT NULL
|
|
|
|
- AND mg.status_ = 'PROGRESS'
|
|
|
|
|
|
+ AND mg.organ_id_ IS NOT NULL
|
|
|
|
+ AND mg.status_ = 'PROGRESS'
|
|
|
|
+ AND DATE_FORMAT(mg.create_time_, '%Y-%m-%d')<=#{dayStr}
|
|
GROUP BY
|
|
GROUP BY
|
|
mg.organ_id_
|
|
mg.organ_id_
|
|
ORDER BY
|
|
ORDER BY
|
|
@@ -207,7 +230,7 @@
|
|
<select id="getMusicData" resultMap="IndexBaseMonthData">
|
|
<select id="getMusicData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
organ_id_,
|
|
organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( id_ ) total_num_,
|
|
COUNT( id_ ) total_num_,
|
|
COUNT( id_ ) activate_num_,
|
|
COUNT( id_ ) activate_num_,
|
|
COUNT( id_ ) percent_
|
|
COUNT( id_ ) percent_
|
|
@@ -217,8 +240,8 @@
|
|
del_flag_ = 0
|
|
del_flag_ = 0
|
|
AND status_ = 'PROGRESS'
|
|
AND status_ = 'PROGRESS'
|
|
AND organ_id_ IS NOT NULL
|
|
AND organ_id_ IS NOT NULL
|
|
- <if test="month!=null and month!=''">
|
|
|
|
- AND DATE_FORMAT(create_time_, '%Y-%m') <= #{month}
|
|
|
|
|
|
+ <if test="dayStr!=null and dayStr!=''">
|
|
|
|
+ AND DATE_FORMAT(create_time_, '%Y-%m-%d') <= #{dayStr}
|
|
</if>
|
|
</if>
|
|
GROUP BY
|
|
GROUP BY
|
|
organ_id_
|
|
organ_id_
|
|
@@ -228,7 +251,7 @@
|
|
<select id="getMusicStudentData" resultMap="IndexBaseMonthData">
|
|
<select id="getMusicStudentData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
mg.organ_id_,
|
|
mg.organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( DISTINCT sr.user_id_ ) total_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) total_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) percent_
|
|
COUNT( DISTINCT sr.user_id_ ) percent_
|
|
@@ -249,8 +272,8 @@
|
|
AND sr.music_group_status_='NORMAL'
|
|
AND sr.music_group_status_='NORMAL'
|
|
AND DATE_FORMAT(sr.create_time_, '%Y-%m') >= CONCAT(DATE_FORMAT(NOW(), '%Y'), '-01')
|
|
AND DATE_FORMAT(sr.create_time_, '%Y-%m') >= CONCAT(DATE_FORMAT(NOW(), '%Y'), '-01')
|
|
</if>
|
|
</if>
|
|
- <if test="month!=null and month!=''">
|
|
|
|
- AND DATE_FORMAT(sr.create_time_, '%Y-%m') <= #{month}
|
|
|
|
|
|
+ <if test="dayStr!=null and dayStr!=''">
|
|
|
|
+ AND DATE_FORMAT(sr.create_time_, '%Y-%m-%d') <= #{dayStr}
|
|
</if>
|
|
</if>
|
|
GROUP BY
|
|
GROUP BY
|
|
mg.organ_id_
|
|
mg.organ_id_
|
|
@@ -261,7 +284,7 @@
|
|
<select id="getTeacherData" resultMap="IndexBaseMonthData">
|
|
<select id="getTeacherData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
t.organ_id_,
|
|
t.organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( t.id_ ) total_num_,
|
|
COUNT( t.id_ ) total_num_,
|
|
COUNT( t.id_ ) activate_num_,
|
|
COUNT( t.id_ ) activate_num_,
|
|
COUNT( t.id_ ) percent_
|
|
COUNT( t.id_ ) percent_
|
|
@@ -280,6 +303,9 @@
|
|
<if test="jobNature!=null">
|
|
<if test="jobNature!=null">
|
|
AND t.job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
AND t.job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="dayStr!=null and dayStr!=''">
|
|
|
|
+ AND DATE_FORMAT(#{dayStr}, '%Y-%m-%d') <= #{dayStr}
|
|
|
|
+ </if>
|
|
GROUP BY
|
|
GROUP BY
|
|
t.organ_id_
|
|
t.organ_id_
|
|
ORDER BY
|
|
ORDER BY
|
|
@@ -289,7 +315,7 @@
|
|
<select id="getGroupCourseData" resultMap="IndexBaseMonthData">
|
|
<select id="getGroupCourseData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
m.organ_id_,
|
|
m.organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( m.id_ ) total_num_,
|
|
COUNT( m.id_ ) total_num_,
|
|
COUNT( m.id_ ) activate_num_,
|
|
COUNT( m.id_ ) activate_num_,
|
|
COUNT( m.id_ ) percent_
|
|
COUNT( m.id_ ) percent_
|
|
@@ -304,8 +330,8 @@
|
|
<if test="groupType!=null">
|
|
<if test="groupType!=null">
|
|
AND m.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
AND m.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
</if>
|
|
</if>
|
|
- <if test="month!=null and month!=''">
|
|
|
|
- AND DATE_FORMAT(m.class_date_, '%Y-%m') <= #{month}
|
|
|
|
|
|
+ <if test="dayStr!=null and dayStr!=''">
|
|
|
|
+ AND DATE_FORMAT(m.class_date_, '%Y-%m-%d') <= #{dayStr}
|
|
</if>
|
|
</if>
|
|
GROUP BY
|
|
GROUP BY
|
|
m.organ_id_
|
|
m.organ_id_
|
|
@@ -316,7 +342,7 @@
|
|
<select id="getOtherStudentData" resultMap="IndexBaseMonthData">
|
|
<select id="getOtherStudentData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
su.organ_id_,
|
|
su.organ_id_,
|
|
- CONCAT(#{month}, '-01') month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( DISTINCT s.user_id_ ) total_num_,
|
|
COUNT( DISTINCT s.user_id_ ) total_num_,
|
|
COUNT( DISTINCT s.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT s.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT s.user_id_ ) percent_
|
|
COUNT( DISTINCT s.user_id_ ) percent_
|
|
@@ -330,8 +356,8 @@
|
|
AND su.organ_id_ IS NOT NULL
|
|
AND su.organ_id_ IS NOT NULL
|
|
AND m.group_type_ IN ('VIP', 'PRACTICE')
|
|
AND m.group_type_ IN ('VIP', 'PRACTICE')
|
|
AND m.status_ = 'NOT_START'
|
|
AND m.status_ = 'NOT_START'
|
|
- <if test="month!=null and month!=''">
|
|
|
|
- AND (DATE_FORMAT(m.create_time_, '%Y-%m') <= #{month} OR YEAR(m.create_time_)=3000)
|
|
|
|
|
|
+ <if test="dayStr!=null and dayStr!=''">
|
|
|
|
+ AND (DATE_FORMAT(m.create_time_, '%Y-%m-%d') <= #{dayStr} OR YEAR(m.create_time_)=3000)
|
|
</if>
|
|
</if>
|
|
GROUP BY
|
|
GROUP BY
|
|
su.organ_id_
|
|
su.organ_id_
|
|
@@ -342,7 +368,7 @@
|
|
<select id="getStudentConversionData" resultMap="IndexBaseMonthData">
|
|
<select id="getStudentConversionData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
cs.organ_id_,
|
|
cs.organ_id_,
|
|
- CONCAT( #{month}, '-01' ) month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( DISTINCT m.user_id_ ) total_num_,
|
|
COUNT( DISTINCT m.user_id_ ) total_num_,
|
|
COUNT( DISTINCT m.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT m.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT m.user_id_ ) percent_
|
|
COUNT( DISTINCT m.user_id_ ) percent_
|
|
@@ -360,6 +386,7 @@
|
|
<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
|
|
<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
|
|
#{studentId}
|
|
#{studentId}
|
|
</foreach>
|
|
</foreach>
|
|
|
|
+ AND DATE_FORMAT(m.create_time_, '%Y-%m-%d')<=#{dayStr}
|
|
GROUP BY
|
|
GROUP BY
|
|
cs.organ_id_
|
|
cs.organ_id_
|
|
ORDER BY
|
|
ORDER BY
|
|
@@ -369,7 +396,7 @@
|
|
<select id="getMusicGroupPreRegistrationStudentData" resultMap="IndexBaseMonthData">
|
|
<select id="getMusicGroupPreRegistrationStudentData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
mg.organ_id_,
|
|
mg.organ_id_,
|
|
- CONCAT( #{month}, '-01' ) month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( DISTINCT spr.user_id_ ) total_num_,
|
|
COUNT( DISTINCT spr.user_id_ ) total_num_,
|
|
COUNT( DISTINCT spr.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT spr.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT spr.user_id_ ) percent_
|
|
COUNT( DISTINCT spr.user_id_ ) percent_
|
|
@@ -380,7 +407,7 @@
|
|
mg.del_flag_ = 0
|
|
mg.del_flag_ = 0
|
|
AND mg.organ_id_ IS NOT NULL
|
|
AND mg.organ_id_ IS NOT NULL
|
|
AND mg.status_ = 'PROGRESS'
|
|
AND mg.status_ = 'PROGRESS'
|
|
- AND DATE_FORMAT( spr.create_time_, '%Y-%m' ) <= #{month}
|
|
|
|
|
|
+ AND DATE_FORMAT( spr.create_time_, '%Y-%m-%d' ) <= #{dayStr}
|
|
GROUP BY
|
|
GROUP BY
|
|
mg.organ_id_
|
|
mg.organ_id_
|
|
ORDER BY
|
|
ORDER BY
|
|
@@ -390,7 +417,7 @@
|
|
<select id="getMusicGroupStudentFromPreData" resultMap="IndexBaseMonthData">
|
|
<select id="getMusicGroupStudentFromPreData" resultMap="IndexBaseMonthData">
|
|
SELECT
|
|
SELECT
|
|
mg.organ_id_,
|
|
mg.organ_id_,
|
|
- CONCAT( #{month}, '-01' ) month_,
|
|
|
|
|
|
+ #{dayStr} month_,
|
|
COUNT( DISTINCT sr.user_id_ ) total_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) total_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) activate_num_,
|
|
COUNT( DISTINCT sr.user_id_ ) percent_
|
|
COUNT( DISTINCT sr.user_id_ ) percent_
|
|
@@ -409,7 +436,7 @@
|
|
AND sr.music_group_status_ IN ('NORMAL')
|
|
AND sr.music_group_status_ IN ('NORMAL')
|
|
AND sr.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
AND sr.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
</if>
|
|
</if>
|
|
- AND DATE_FORMAT( sr.create_time_, '%Y-%m' ) <= #{month}
|
|
|
|
|
|
+ AND DATE_FORMAT( sr.create_time_, '%Y-%m-%d' ) <= #{dayStr}
|
|
GROUP BY
|
|
GROUP BY
|
|
mg.organ_id_
|
|
mg.organ_id_
|
|
ORDER BY
|
|
ORDER BY
|
|
@@ -434,7 +461,7 @@
|
|
AND sr.music_group_status_ IN ('NORMAL')
|
|
AND sr.music_group_status_ IN ('NORMAL')
|
|
AND sr.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
AND sr.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
</if>
|
|
</if>
|
|
- AND DATE_FORMAT( sr.create_time_, '%Y-%m' ) <= #{month}
|
|
|
|
|
|
+ AND DATE_FORMAT( sr.create_time_, '%Y-%m-%d' ) <= #{dayStr}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="countLessThenThreeClassGroupNum" resultType="int">
|
|
<select id="countLessThenThreeClassGroupNum" resultType="int">
|
|
@@ -486,7 +513,7 @@
|
|
LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
WHERE
|
|
WHERE
|
|
mg.status_ = 'PROGRESS'
|
|
mg.status_ = 'PROGRESS'
|
|
- AND mgpc.payment_valid_end_date_ < NOW()
|
|
|
|
|
|
+ AND DATE_FORMAT(NOW(),'%Y-%m-%d') >= DATE_FORMAT(mgpc.payment_valid_start_date_,'%Y-%m-%d')
|
|
AND mgpcd.payment_status_ = 'NON_PAYMENT'
|
|
AND mgpcd.payment_status_ = 'NON_PAYMENT'
|
|
<if test="organIds!=null and organIds.size()>0">
|
|
<if test="organIds!=null and organIds.size()>0">
|
|
AND mg.organ_id_ IN
|
|
AND mg.organ_id_ IN
|
|
@@ -505,7 +532,7 @@
|
|
LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
WHERE
|
|
WHERE
|
|
mg.status_ = 'PROGRESS'
|
|
mg.status_ = 'PROGRESS'
|
|
- AND mgpc.payment_valid_end_date_ < NOW()
|
|
|
|
|
|
+ AND DATE_FORMAT(NOW(),'%Y-%m-%d') >= DATE_FORMAT(mgpc.payment_valid_start_date_,'%Y-%m-%d')
|
|
AND mgpcd.payment_status_ = 'NON_PAYMENT'
|
|
AND mgpcd.payment_status_ = 'NON_PAYMENT'
|
|
<if test="organIds!=null and organIds.size()>0">
|
|
<if test="organIds!=null and organIds.size()>0">
|
|
AND mg.organ_id_ IN
|
|
AND mg.organ_id_ IN
|
|
@@ -530,18 +557,19 @@
|
|
|
|
|
|
<select id="queryStudentAttendanceInfo" resultType="java.lang.Long">
|
|
<select id="queryStudentAttendanceInfo" resultType="java.lang.Long">
|
|
SELECT
|
|
SELECT
|
|
- DISTINCT cssp.user_id_
|
|
|
|
|
|
+ DISTINCT cssp.id_
|
|
FROM
|
|
FROM
|
|
course_schedule_student_payment cssp
|
|
course_schedule_student_payment cssp
|
|
LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
|
|
LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
|
|
LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
|
|
LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
|
|
- LEFT JOIN student_visit sv ON cssp.id_=sv.object_id_
|
|
|
|
|
|
+ LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_
|
|
WHERE
|
|
WHERE
|
|
|
|
+ cs.status_ = 'OVER' AND sv.id_ IS NULL
|
|
<if test="type!=null and type=='LEAVE'">
|
|
<if test="type!=null and type=='LEAVE'">
|
|
- (sa.status_ = 'LEAVE' AND sa.remark_ IS NOT NULL AND sv.id_ IS NULL)
|
|
|
|
|
|
+ AND sa.status_ = 'LEAVE'
|
|
</if>
|
|
</if>
|
|
<if test="type!=null and type=='TRUANT'">
|
|
<if test="type!=null and type=='TRUANT'">
|
|
- (sa.status_ = 'TRUANT' OR sa.id_ IS NULL)
|
|
|
|
|
|
+ AND (sa.status_ = 'TRUANT' OR sa.id_ IS NULL)
|
|
</if>
|
|
</if>
|
|
<if test="firstDayOfMonth != null">
|
|
<if test="firstDayOfMonth != null">
|
|
AND cs.class_date_ >= DATE_FORMAT(#{firstDayOfMonth},'%Y-%m-%d')
|
|
AND cs.class_date_ >= DATE_FORMAT(#{firstDayOfMonth},'%Y-%m-%d')
|
|
@@ -556,7 +584,7 @@
|
|
<select id="getAttendanceError" resultType="java.lang.Long">
|
|
<select id="getAttendanceError" resultType="java.lang.Long">
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
LEFT JOIN course_schedule cs ON ta.course_schedule_id_ = cs.id_
|
|
LEFT JOIN course_schedule cs ON ta.course_schedule_id_ = cs.id_
|
|
- WHERE (ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0)
|
|
|
|
|
|
+ WHERE (ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND cs.status_ = 'OVER'
|
|
AND (ta.sign_in_time_ IS NOT NULL OR ta.sign_out_time_ IS NOT NULL) AND ta.dispose_content_ IS NULL
|
|
AND (ta.sign_in_time_ IS NOT NULL OR ta.sign_out_time_ IS NOT NULL) AND ta.dispose_content_ IS NULL
|
|
<if test="organIds != null and organIds != ''">
|
|
<if test="organIds != null and organIds != ''">
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
@@ -568,7 +596,7 @@
|
|
<select id="getNoAttendance" resultType="java.lang.Long">
|
|
<select id="getNoAttendance" resultType="java.lang.Long">
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
LEFT JOIN course_schedule cs ON ta.course_schedule_id_ = cs.id_
|
|
LEFT JOIN course_schedule cs ON ta.course_schedule_id_ = cs.id_
|
|
- WHERE ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
|
|
|
|
|
|
+ WHERE ta.sign_in_time_ IS NULL AND cs.status_ = 'OVER' AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
|
|
<if test="organIds != null and organIds != ''">
|
|
<if test="organIds != null and organIds != ''">
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
</if>
|
|
</if>
|
|
@@ -630,12 +658,24 @@
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="getFinancePayData" resultMap="IndexBaseMonthData">
|
|
<select id="getFinancePayData" resultMap="IndexBaseMonthData">
|
|
-
|
|
|
|
|
|
+ SELECT SUM(fe.amount_) total_num_,SUM(fe.amount_) activate_num_,SUM(fe.amount_) percent_,fe.organ_id_,#{dayStr} month_ FROM financial_expenditure fe
|
|
|
|
+ WHERE DATE_FORMAT(fe.create_time_,'%Y-%m-%d') = #{dayStr}
|
|
|
|
+ AND del_flag_ = 0 GROUP BY fe.organ_id_
|
|
</select>
|
|
</select>
|
|
<select id="getFinanceBalanceData" resultMap="IndexBaseMonthData">
|
|
<select id="getFinanceBalanceData" resultMap="IndexBaseMonthData">
|
|
-
|
|
|
|
|
|
+ SELECT spo.organ_id_,SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN spo.balance_payment_amount_ ELSE 0 END) total_num_,
|
|
|
|
+ SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN spo.balance_payment_amount_ ELSE 0 END) activate_num_,
|
|
|
|
+ SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN spo.balance_payment_amount_ ELSE 0 END) percent_,#{dayStr} month_
|
|
|
|
+ FROM student_payment_order spo
|
|
|
|
+ WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = #{dayStr}
|
|
|
|
+ GROUP BY spo.organ_id_
|
|
</select>
|
|
</select>
|
|
<select id="getFinanceActualData" resultMap="IndexBaseMonthData">
|
|
<select id="getFinanceActualData" resultMap="IndexBaseMonthData">
|
|
-
|
|
|
|
|
|
+ SELECT spo.organ_id_,SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN 0 ELSE spo.actual_amount_ END) total_num_,
|
|
|
|
+ SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN 0 ELSE spo.actual_amount_ END) activate_num_,
|
|
|
|
+ SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN 0 ELSE spo.actual_amount_ END) percent_,#{dayStr} month_
|
|
|
|
+ FROM student_payment_order spo
|
|
|
|
+ WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = #{dayStr}
|
|
|
|
+ GROUP BY spo.organ_id_
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|