sql修改

This commit is contained in:
dinggang 2022-11-28 09:36:44 +08:00
parent 76780e2eda
commit d2c3f885ed
1 changed files with 4 additions and 4 deletions

View File

@ -705,7 +705,7 @@
IFNULL( COUNT( taa.apply_price ), 0 ) AS "applyPrice",
srg.sort
FROM
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND sort <= 9 ) srg
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg
LEFT JOIN sys_dept sd ON sd.district = srg.id
LEFT JOIN sys_user su ON su.dept_id = sd.id
LEFT JOIN t_ability_application taa ON taa.user_id = su.id
@ -729,7 +729,7 @@
SELECT
srg.id
FROM
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND sort <= 9 ) srg
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg
LEFT JOIN sys_dept sd ON sd.district = srg.id
LEFT JOIN sys_user su ON su.dept_id = sd.id
LEFT JOIN t_ability_application taa ON taa.user_id = su.id
@ -887,7 +887,7 @@
IFNULL( SUM( taa.apply_price ), 0 ) AS "applyPrice",
srg.sort
FROM
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND sort <= 9 ) srg
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg
LEFT JOIN sys_dept sd ON sd.district = srg.id
LEFT JOIN sys_user su ON su.dept_id = sd.id
LEFT JOIN (SELECT user_id, SUM(apply_price) AS "apply_price", COUNT(id) AS "applyCount" FROM t_ability_application taa WHERE
@ -906,7 +906,7 @@
IFNULL( SUM(taa.apply_price ), 0 ) AS "applyPrice",
srg.sort
FROM
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND sort <= 9 ) srg
( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg
LEFT JOIN sys_dept sd ON sd.district = srg.id
LEFT JOIN tb_data_resource tdr ON tdr.dept_id = sd.id
LEFT JOIN (SELECT resource_id, SUM(apply_price) AS "apply_price", COUNT(id) AS "applyCount" FROM t_ability_application taa WHERE