sql修改
This commit is contained in:
parent
76780e2eda
commit
d2c3f885ed
|
@ -705,7 +705,7 @@
|
||||||
IFNULL( COUNT( taa.apply_price ), 0 ) AS "applyPrice",
|
IFNULL( COUNT( taa.apply_price ), 0 ) AS "applyPrice",
|
||||||
srg.sort
|
srg.sort
|
||||||
FROM
|
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_dept sd ON sd.district = srg.id
|
||||||
LEFT JOIN sys_user su ON su.dept_id = sd.id
|
LEFT JOIN sys_user su ON su.dept_id = sd.id
|
||||||
LEFT JOIN t_ability_application taa ON taa.user_id = su.id
|
LEFT JOIN t_ability_application taa ON taa.user_id = su.id
|
||||||
|
@ -729,7 +729,7 @@
|
||||||
SELECT
|
SELECT
|
||||||
srg.id
|
srg.id
|
||||||
FROM
|
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_dept sd ON sd.district = srg.id
|
||||||
LEFT JOIN sys_user su ON su.dept_id = sd.id
|
LEFT JOIN sys_user su ON su.dept_id = sd.id
|
||||||
LEFT JOIN t_ability_application taa ON taa.user_id = su.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",
|
IFNULL( SUM( taa.apply_price ), 0 ) AS "applyPrice",
|
||||||
srg.sort
|
srg.sort
|
||||||
FROM
|
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_dept sd ON sd.district = srg.id
|
||||||
LEFT JOIN sys_user su ON su.dept_id = sd.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
|
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",
|
IFNULL( SUM(taa.apply_price ), 0 ) AS "applyPrice",
|
||||||
srg.sort
|
srg.sort
|
||||||
FROM
|
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_dept sd ON sd.district = srg.id
|
||||||
LEFT JOIN tb_data_resource tdr ON tdr.dept_id = sd.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
|
LEFT JOIN (SELECT resource_id, SUM(apply_price) AS "apply_price", COUNT(id) AS "applyCount" FROM t_ability_application taa WHERE
|
||||||
|
|
Loading…
Reference in New Issue