1.首页统计数量添加过去 7 天建联统计

This commit is contained in:
2025-10-17 15:13:08 +08:00
parent a7582cb558
commit 2145c51814
7 changed files with 29 additions and 15 deletions

View File

@@ -418,21 +418,20 @@
<select id="selectEmployeeHostsCompleteBarChart"
resultType="cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO">
SELECT
user_id as userId,
user_id AS userId,
COUNT(DISTINCT
CASE WHEN operation_status = 1 THEN hosts_id END) AS finishedNum
FROM
server_employee_hosts
WHERE
deleted = 0
FROM server_employee_hosts
WHERE deleted = 0
AND operation_status = 1
AND DATE(update_time) = CURDATE()
<if test="list != null and list.size() != 0">
<!-- 日期范围:今天或过去 7 天(含今天) -->
AND update_time >= DATE_SUB(CURDATE(), INTERVAL #{days,jdbcType=INTEGER} - 1 DAY)
<if test="list != null and list.size() > 0">
AND user_id IN
<foreach collection="list" item="user_id" open="(" separator="," close=")">
#{user_id}
</foreach>
</if>
group by user_id
GROUP BY user_id
</select>
</mapper>