| 
					
				 | 
			
			
				@@ -562,11 +562,11 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			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_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			LEFT JOIN student_visit sv ON cssp.id_ = sv.object_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		WHERE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				cs.status_ = 'OVER' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				cs.status_ = 'OVER' AND sv.id_ IS NULL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="type!=null and type=='LEAVE'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				AND (sa.status_ = 'LEAVE' AND sa.remark_ IS NOT NULL AND sv.id_ IS NULL) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				AND sa.status_ = 'LEAVE' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="type!=null and type=='TRUANT'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				AND (sa.status_ = 'TRUANT' OR sa.id_ IS NULL) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -658,24 +658,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') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		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 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_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			   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') = DATE_FORMAT(NOW(),'%Y-%m-%d') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = #{dayStr} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		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_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			   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') = DATE_FORMAT(NOW(),'%Y-%m-%d') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = #{dayStr} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		GROUP BY spo.organ_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |