sql修改

This commit is contained in:
dinggang 2022-06-19 18:41:07 +08:00
parent 64398d8926
commit e090c4fd8a
1 changed files with 9 additions and 12 deletions

View File

@ -89,7 +89,7 @@
<result property="note5" column="note5"/>
</collection>
</resultMap>
<update id="deleteByIds">
UPDATE tb_data_resource
SET del_flag = 1,
@ -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