1.添加员工完成率接口

This commit is contained in:
2025-08-06 19:53:30 +08:00
parent e4827a8b15
commit 62299502dd
6 changed files with 57 additions and 0 deletions

View File

@@ -326,4 +326,18 @@
</foreach>
</update>
<select id="selectEmployeeHostsWithOperationStatus"
resultType="cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO">
SELECT
user_id AS userId,
SUM(CASE WHEN operation_status = 1 THEN 1 ELSE 0 END) AS finishedNum,
SUM(CASE WHEN operation_status = 0 THEN 1 ELSE 0 END) AS unfinishedNum,
COUNT(*) AS totalNum
FROM server_employee_hosts
WHERE deleted = 0
<if test="userId != null">
AND user_id = #{userId}
</if>
GROUP BY user_id
</select>
</mapper>