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