|
|
@@ -54,15 +54,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
54
|
54
|
record_date AS recordDate,
|
|
55
|
55
|
<!-- 动态分组名称:小组>班组>部门 -->
|
|
56
|
56
|
<choose>
|
|
57
|
|
- <when test="groupId != null">
|
|
58
|
|
- group_name AS groupName
|
|
59
|
|
- </when>
|
|
60
|
|
- <when test="teamId != null">
|
|
61
|
|
- team_name AS groupName
|
|
62
|
|
- </when>
|
|
63
|
|
- <when test="deptId != null">
|
|
64
|
|
- dept_name AS groupName
|
|
65
|
|
- </when>
|
|
|
57
|
+ <when test="groupId != null">group_name AS groupName</when>
|
|
|
58
|
+ <when test="teamId != null">team_name AS groupName</when>
|
|
|
59
|
+ <when test="deptId != null">dept_name AS groupName</when>
|
|
66
|
60
|
</choose>,
|
|
67
|
61
|
SUM(throughput) AS totalThroughput,
|
|
68
|
62
|
COUNT(*) AS totalRecord,
|
|
|
@@ -75,27 +69,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
75
|
69
|
AND record_date >= DATE_SUB(CURDATE(), INTERVAL 29 DAY)
|
|
76
|
70
|
AND record_date <= CURDATE()
|
|
77
|
71
|
<!-- 三级联动动态筛选 -->
|
|
78
|
|
- <if test="deptId != null">
|
|
79
|
|
- AND dept_id = #{deptId}
|
|
80
|
|
- </if>
|
|
81
|
|
- <if test="teamId != null">
|
|
82
|
|
- AND team_id = #{teamId}
|
|
83
|
|
- </if>
|
|
84
|
|
- <if test="groupId != null">
|
|
85
|
|
- AND group_id = #{groupId}
|
|
86
|
|
- </if>
|
|
|
72
|
+ <if test="deptId != null">AND dept_id = #{deptId}</if>
|
|
|
73
|
+ <if test="teamId != null">AND team_id = #{teamId}</if>
|
|
|
74
|
+ <if test="groupId != null">AND group_id = #{groupId}</if>
|
|
87
|
75
|
<!-- 动态分组:按选中层级+日期分组 -->
|
|
88
|
76
|
GROUP BY
|
|
89
|
77
|
<choose>
|
|
90
|
|
- <when test="groupId != null">
|
|
91
|
|
- group_id, record_date
|
|
92
|
|
- </when>
|
|
93
|
|
- <when test="teamId != null">
|
|
94
|
|
- team_id, record_date
|
|
95
|
|
- </when>
|
|
96
|
|
- <when test="deptId != null">
|
|
97
|
|
- dept_id, record_date
|
|
98
|
|
- </when>
|
|
|
78
|
+ <when test="groupId != null">group_id, record_date, group_name</when>
|
|
|
79
|
+ <when test="teamId != null">team_id, record_date, team_name</when>
|
|
|
80
|
+ <when test="deptId != null">dept_id, record_date, dept_name</when>
|
|
99
|
81
|
</choose>
|
|
100
|
82
|
<!-- 按日期升序,大屏展示顺序 -->
|
|
101
|
83
|
ORDER BY record_date ASC
|