Commit 232e04dc authored by tianbo's avatar tianbo

perf(amos-boot): 使用 STRING_AGG 替代 GROUP_CONCAT- 将 GROUP_CONCAT 函数替换为 STRING_AGG…

perf(amos-boot): 使用 STRING_AGG 替代 GROUP_CONCAT- 将 GROUP_CONCAT 函数替换为 STRING_AGG 函数- 优化查询性能,特别是在处理大量数据时
parent 3cc1add8
......@@ -499,17 +499,17 @@
fu.project_contraption_id AS projectContraptionId,
(select company_name from privilege_company where org_code = fu.supervision_org_code and is_deleted = false limit 1) AS orgBranchName,
COALESCE(GROUP_CONCAT(DISTINCT re.equ_id), '') AS equipId,
COALESCE(GROUP_CONCAT(DISTINCT other.supervisory_code), '') AS supervisoryCode,
COALESCE(GROUP_CONCAT(DISTINCT other.CODE96333), '') AS code96333,
COALESCE(GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME), '') AS productName,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_CODE), '') AS equCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_LIST), '') AS equListCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY), '') AS equCategoryCode,
COALESCE(GROUP_CONCAT(DISTINCT jri.EQU_DEFINE), '') AS equDefineCode,
COALESCE(GROUP_CONCAT(DISTINCT c_list.name), '') AS equListName,
COALESCE(GROUP_CONCAT(DISTINCT c_cate.name), '') AS equCategory,
COALESCE(GROUP_CONCAT(DISTINCT c_def.name), '') AS equDefine
COALESCE(STRING_AGG(DISTINCT re.equ_id), '') AS equipId,
COALESCE(STRING_AGG(DISTINCT other.supervisory_code), '') AS supervisoryCode,
COALESCE(STRING_AGG(DISTINCT other.CODE96333), '') AS code96333,
COALESCE(STRING_AGG(DISTINCT jri.PRODUCT_NAME), '') AS productName,
COALESCE(STRING_AGG(DISTINCT jri.EQU_CODE), '') AS equCode,
COALESCE(STRING_AGG(DISTINCT jri.EQU_LIST), '') AS equListCode,
COALESCE(STRING_AGG(DISTINCT jri.EQU_CATEGORY), '') AS equCategoryCode,
COALESCE(STRING_AGG(DISTINCT jri.EQU_DEFINE), '') AS equDefineCode,
COALESCE(STRING_AGG(DISTINCT c_list.name), '') AS equListName,
COALESCE(STRING_AGG(DISTINCT c_cate.name), '') AS equCategory,
COALESCE(STRING_AGG(DISTINCT c_def.name), '') AS equDefine
FROM filtered_main_ids fm
JOIN tzs_jg_use_registration fu ON fm.sequence_nbr = fu.sequence_nbr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment