优化分析:清理分析Mapper中的行尾空白字符
This commit is contained in:
1 parent
598ccb4d99
commit
956ad40663
1 file changed
+14
-14
@@ -60,19 +60,19 @@
|
||||
|
||||
<!-- 2. 驾驶舱图表 -->
|
||||
<select id="selectAttendanceTrend30Days" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
TO_CHAR(c.sign_in_time, 'YYYY-MM-DD') AS stat_date,
|
||||
SUM(CASE WHEN c.attendance_status = 1 THEN 1 ELSE 0 END) AS normal_count,
|
||||
SUM(CASE WHEN c.attendance_status != 1 THEN 1 ELSE 0 END) AS abnormal_count
|
||||
FROM train_student_checkin c
|
||||
WHERE c.sign_in_time IS NOT NULL
|
||||
WHERE c.sign_in_time IS NOT NULL
|
||||
AND c.sign_in_time >= CURRENT_DATE - INTERVAL '30 days'
|
||||
GROUP BY TO_CHAR(c.sign_in_time, 'YYYY-MM-DD')
|
||||
ORDER BY stat_date ASC
|
||||
</select>
|
||||
|
||||
<select id="selectPlanEnrollmentReportComparisonTop10" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
p.plan_id AS plan_id,
|
||||
p.plan_name AS plan_name,
|
||||
COUNT(DISTINCT e.enrollment_id) AS enrolled_count,
|
||||
@@ -87,7 +87,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectAttendanceStatusDistribution" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
CAST(attendance_status AS VARCHAR) AS status_code,
|
||||
COUNT(1) AS count_num
|
||||
FROM train_student_checkin
|
||||
@@ -104,7 +104,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectVenueUsageTop5" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
COALESCE(cr.room_name, ts.site_name, '未知场地') AS venue_name,
|
||||
count(1) AS usage_count,
|
||||
ROUND(SUM(EXTRACT(EPOCH FROM (l.end_time - l.start_time)) / 3600.0)::numeric, 1) AS total_hours
|
||||
@@ -197,7 +197,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectFilteredDailyTrend" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
TO_CHAR(c.sign_in_time, 'YYYY-MM-DD') AS stat_date,
|
||||
SUM(CASE WHEN c.attendance_status = 1 THEN 1 ELSE 0 END) AS normal_count,
|
||||
SUM(CASE WHEN c.attendance_status != 1 THEN 1 ELSE 0 END) AS abnormal_count
|
||||
@@ -222,7 +222,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectFilteredStatusDistribution" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
CAST(c.attendance_status AS VARCHAR) AS status_code,
|
||||
COUNT(1) AS count_num
|
||||
FROM train_student_checkin c
|
||||
@@ -246,7 +246,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectPlanAttendanceComparison" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
p.plan_id AS id,
|
||||
p.plan_name AS name,
|
||||
SUM(CASE WHEN c.attendance_status = 1 THEN 1 ELSE 0 END) AS normal_count,
|
||||
@@ -274,7 +274,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectCourseAttendanceComparison" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
crs.c_id AS id,
|
||||
crs.c_name AS name,
|
||||
SUM(CASE WHEN c.attendance_status = 1 THEN 1 ELSE 0 END) AS normal_count,
|
||||
@@ -302,7 +302,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectAbnormalStudentTop10" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
s.s_id AS student_id,
|
||||
s.s_name AS student_name,
|
||||
p.plan_id AS plan_id,
|
||||
@@ -338,7 +338,7 @@
|
||||
|
||||
<!-- 4. 学员 360 画像 SQL -->
|
||||
<select id="selectStudentBaseProfile" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
s.s_id AS student_id,
|
||||
s.s_name AS student_name,
|
||||
s.s_gender AS gender,
|
||||
@@ -354,7 +354,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectStudentEnrollmentTimeline" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
e.enrollment_id AS enrollment_id,
|
||||
p.plan_id AS plan_id,
|
||||
p.plan_name AS plan_name,
|
||||
@@ -371,7 +371,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectStudentAttendanceStats" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
CAST(c.attendance_status AS VARCHAR) AS status_code,
|
||||
COUNT(1) AS count_num
|
||||
FROM train_student_checkin c
|
||||
@@ -390,7 +390,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectStudentAccommodationAuth" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
SELECT
|
||||
a.accommodation_id AS accommodation_id,
|
||||
a.dorm_id AS dorm_id,
|
||||
d.dorm_name AS room_name,
|
||||
|
||||
Reference in new issue
Block a user