ow
This commit is contained in:
1 parent
9b01c4a57a
commit
6417562c4f
37 files changed
+2767
-202
No files matched your search
@@ -553,3 +553,16 @@ left join dms_folder_delete_log dd with(nolock) on dms.file_path=dd.folder_name
|
||||
GO
|
||||
|
||||
|
||||
-- ==============================================================================================
|
||||
-- [备案] dms_file_usage_view —— 按用户(ower_id)分组统计网盘已用容量(dashboard 用量卡片 / 上传额度闸门)
|
||||
-- 真源在线上 MySQL(nas.youjiala.com:3307/Furion);上方为 SQL Server 建表脚本,此段仅归档留底,勿在此执行。
|
||||
-- 口径:ower_id=登录用户(=security_user.user_name),仅计非目录行(is_directory_indc='N'),file_size 单位 KB,SUM 转 SIGNED 防 int 溢出。
|
||||
-- MySQL DDL:
|
||||
-- CREATE OR REPLACE VIEW dms_file_usage_view AS
|
||||
-- SELECT ower_id,
|
||||
-- COUNT(*) AS file_count,
|
||||
-- CAST(SUM(CASE WHEN is_directory_indc='N' THEN file_size ELSE 0 END) AS SIGNED) AS used_kb
|
||||
-- FROM dms_file GROUP BY ower_id;
|
||||
-- ==============================================================================================
|
||||
|
||||
|
||||
Reference in new issue
Block a user