diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 5db605b9..8afc0729 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -89,7 +89,7 @@ - + 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 @@ -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