sql修改
This commit is contained in:
parent
64398d8926
commit
e090c4fd8a
|
@ -897,20 +897,18 @@
|
|||
SELECT
|
||||
tdr.id AS "resourceId",
|
||||
tdr.NAME AS "name",
|
||||
COUNT( taa.id ) AS "applyCount"
|
||||
IFNULL(COUNT( taa.id ), 0) AS "count"
|
||||
FROM
|
||||
tb_data_resource tdr,
|
||||
t_ability_application taa
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN t_ability_application taa ON tdr.id = taa.resource_id AND taa.del_flag = 0
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND taa.del_flag = 0
|
||||
AND tdr.id = taa.resource_id
|
||||
AND tdr.type = '组件服务'
|
||||
GROUP BY
|
||||
tdr.id
|
||||
ORDER BY
|
||||
applyCount DESC
|
||||
count DESC
|
||||
LIMIT 5
|
||||
</select>
|
||||
|
||||
|
@ -918,15 +916,14 @@
|
|||
SELECT
|
||||
tdr.id AS "resourceId",
|
||||
tdr.NAME AS "name",
|
||||
SUM(trs.score) AS "score"
|
||||
IFNULL( SUM( trs.score ), 0 ) AS "score"
|
||||
FROM
|
||||
tb_data_resource tdr,
|
||||
tb_resource_score trs
|
||||
tb_data_resource tdr
|
||||
LEFT JOIN tb_resource_score trs ON tdr.id = trs.resource_id
|
||||
AND trs.del_flag = 0
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
AND trs.del_flag = 0
|
||||
AND tdr.id = trs.resource_id
|
||||
AND tdr.type = '组件服务'
|
||||
GROUP BY
|
||||
tdr.id
|
||||
|
|
Loading…
Reference in New Issue