|
@@ -513,7 +513,7 @@
|
|
|
LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
|
WHERE
|
|
|
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'
|
|
|
<if test="organIds!=null and organIds.size()>0">
|
|
|
AND mg.organ_id_ IN
|
|
@@ -532,7 +532,7 @@
|
|
|
LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
|
WHERE
|
|
|
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'
|
|
|
<if test="organIds!=null and organIds.size()>0">
|
|
|
AND mg.organ_id_ IN
|
|
@@ -557,18 +557,19 @@
|
|
|
|
|
|
<select id="queryStudentAttendanceInfo" resultType="java.lang.Long">
|
|
|
SELECT
|
|
|
- DISTINCT cssp.user_id_
|
|
|
+ DISTINCT cssp.id_
|
|
|
FROM
|
|
|
course_schedule_student_payment cssp
|
|
|
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_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')
|
|
@@ -583,7 +584,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})
|
|
@@ -595,7 +596,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>
|
|
@@ -648,7 +649,7 @@
|
|
|
FROM
|
|
|
inspection_item_plan
|
|
|
WHERE
|
|
|
- conclusion_status_ = 0
|
|
|
+ conclusion_status_ = 1
|
|
|
<if test="organIds!=null and organIds.size()>0">
|
|
|
AND organ_id_ IN
|
|
|
<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
|
|
@@ -656,4 +657,25 @@
|
|
|
</foreach>
|
|
|
</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>
|