|
@@ -537,11 +537,12 @@
|
|
|
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_
|
|
|
WHERE
|
|
|
+ cs.status_ = 'OVER'
|
|
|
<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' AND sa.remark_ IS NOT NULL AND sv.id_ IS NULL)
|
|
|
</if>
|
|
|
<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 test="firstDayOfMonth != null">
|
|
|
AND cs.class_date_ >= DATE_FORMAT(#{firstDayOfMonth},'%Y-%m-%d')
|
|
@@ -556,7 +557,7 @@
|
|
|
<select id="getAttendanceError" resultType="java.lang.Long">
|
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
|
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
|
|
|
<if test="organIds != null and organIds != ''">
|
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
@@ -568,7 +569,7 @@
|
|
|
<select id="getNoAttendance" resultType="java.lang.Long">
|
|
|
SELECT DISTINCT ta.id_ FROM teacher_attendance ta
|
|
|
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 != ''">
|
|
|
AND FIND_IN_SET(cs.organ_id_,#{organIds})
|
|
|
</if>
|
|
@@ -630,12 +631,24 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getFinancePayData" resultMap="IndexBaseMonthData">
|
|
|
-
|
|
|
+ SELECT SUM(fe.amount_) total_num_,SUM(fe.amount_) activate_num_,SUM(fe.amount_) percent_,fe.organ_id_,DATE_FORMAT(NOW(),'%Y-%m-%d') month_ FROM financial_expenditure fe
|
|
|
+ WHERE DATE_FORMAT(fe.create_time_,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
|
|
|
+ AND del_flag_ = 0 GROUP BY fe.organ_id_
|
|
|
</select>
|
|
|
<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_,DATE_FORMAT(NOW(),'%Y-%m-%d') month_
|
|
|
+ FROM student_payment_order spo
|
|
|
+ WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
|
|
|
+ GROUP BY spo.organ_id_
|
|
|
</select>
|
|
|
<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_,DATE_FORMAT(NOW(),'%Y-%m-%d') month_
|
|
|
+ FROM student_payment_order spo
|
|
|
+ WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
|
|
|
+ GROUP BY spo.organ_id_
|
|
|
</select>
|
|
|
</mapper>
|