修改能力统计页申请次数统计不一致问题

This commit is contained in:
dinggang 2022-10-10 14:08:26 +08:00
parent d62484ba62
commit e217f56ca9
2 changed files with 48 additions and 33 deletions

View File

@ -84,46 +84,20 @@
SUM( amount )
FROM
(
<!-- SELECT
COUNT( 1 ) AS count
FROM
(
SELECT
COUNT( id )
FROM
t_ability_application
WHERE
resource_id != 8888888880000000001
AND instance_id != ''
AND instance_id IS NOT NULL
AND camera_list != ''
AND camera_list IS NOT NULL
GROUP BY
instance_id
) temp UNION
SELECT
COUNT( taa.id )
FROM
t_ability_application taa,
tb_data_resource tdr
WHERE
1 = 1
AND taa.resource_id = tdr.id
AND tdr.type != '赋能案例'
AND tdr.del_flag = 0
GROUP BY
tdr.type -->
SELECT
COUNT(taa.id) AS "amount",
'应用资源' AS "type"
FROM
t_ability_application taa
,tb_data_resource tdr
, tb_data_resource tdr
, sys_user su
WHERE
taa.resource_id = tdr.id
AND tdr.del_flag = 0
AND tdr.type = '应用资源'
AND taa.user_id = su.id
AND su.dept_id != ''
AND su.dept_id IS NOT NULL
UNION
SELECT
@ -131,15 +105,36 @@
tda.attr_value AS "type"
FROM
t_ability_application taa
,tb_data_resource tdr
,tb_data_attr tda
, tb_data_resource tdr
, tb_data_attr tda
, sys_user su
WHERE
taa.resource_id = tdr.id
AND tdr.id = tda.data_resource_id
AND tdr.del_flag = 0
AND tda.del_flag = 0
AND tdr.type = '组件服务'
AND tda.attr_type = '组件类型'
AND taa.user_id = su.id
AND su.dept_id != ''
AND su.dept_id IS NOT NULL
GROUP BY tda.attr_value
UNION
SELECT
COUNT( taa.apply_flag ) AS 'count',
'jcss' AS 'type'
FROM
t_ability_application taa,
sys_dept sd,
sys_user su
WHERE
1 = 1
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.camera_list != ''
AND taa.camera_list IS NOT NULL
GROUP BY
sd.id
) temp2
</select>

View File

@ -1012,6 +1012,26 @@
GROUP BY
sd.id,
tdr.type
UNION
SELECT
COUNT( taa.apply_flag ) AS 'count',
sd.NAME AS "deptName",
'jcss' AS 'type'
FROM
t_ability_application taa,
sys_dept sd,
sys_user su
WHERE
1 = 1
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.camera_list != ''
AND taa.camera_list IS NOT NULL
GROUP BY
sd.id
</select>
<!--
<select id="selectMaxType" resultType="java.lang.String">