Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-07-22 17:21:58 +08:00
commit 488b42719f
2 changed files with 15 additions and 5 deletions

View File

@ -94,6 +94,8 @@ public class ResourceDTO extends AuditingBaseDTO implements Serializable {
private List<Long> deptIds;
@ApiModelProperty(value = "是否在申购车内")
private Boolean isInShoppingCart;
@ApiModelProperty(value = "审核状态:通过,不通过")
private String approveStatus;
@ApiModelProperty(value = "属性信息")

View File

@ -105,14 +105,16 @@
IFNULL(trc.collectCount, 0) AS "collectCount",
IFNULL(sd.name, '暂无部门单位信息') AS "deptName",
IFNULL(trc2.isCollect, 'false') AS "isCollect",
(IFNULL(tdr.visits / 100, 0) + IFNULL(trs.score, 0) + IFNULL(taa.applyCount, 0)+ IFNULL(trc.collectCount, 0)) AS total,
(IFNULL(tdr.visits / 100, 0) + IFNULL(trs.score, 0) + IFNULL(taa.applyCount, 0)+ IFNULL(trc.collectCount, 0)) AS
total,
IF ( IFNULL( trcar.car, 0 ) &gt; 0, TRUE, FALSE ) AS "isInShoppingCart"
FROM
tb_data_resource tdr
LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id
LEFT JOIN ( SELECT resource_id, AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP
BY resource_id ) trs ON tdr.id = trs.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY resource_id ) trcar
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 AND
user_id = #{dto.creator} GROUP BY resource_id ) trcar
ON tdr.id = trcar.resource_id
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag =
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
@ -294,7 +296,8 @@
sd.NAME AS "deptName",
IFNULL( trc2.isCollect, 'false' ) AS "isCollect",
IF( IFNULL(taa2.approve_status, 0) &lt; 1, '未申请', '已申请' ) AS "applyState",
IF ( IFNULL( trcar.car, 0 ) &gt; 0, TRUE, FALSE ) AS "isInShoppingCart"
IF ( IFNULL( trcar.car, 0 ) &gt; 0, TRUE, FALSE ) AS "isInShoppingCart",
IF( IFNULL(taa3.approve_status, 0) &lt; 1, '未通过', '通过' ) AS "approveStatus",
FROM
tb_data_resource tdr
LEFT JOIN ( SELECT resource_id, AVG( score ) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0
@ -303,7 +306,8 @@
= 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND
del_flag = 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY resource_id ) trcar
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 AND
user_id = #{dto.creator} GROUP BY resource_id ) trcar
ON tdr.id = trcar.resource_id
LEFT JOIN (
SELECT
@ -321,6 +325,9 @@
) trc2 ON tdr.id = trc2.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
AND del_flag = 0 AND user_id = #{userId} GROUP BY resource_id ) taa2 ON tdr.id = taa2.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
AND del_flag = 0 AND user_id = #{userId} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id =
taa3.resource_id
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
WHERE
1 = 1
@ -371,7 +378,8 @@
tb_data_resource tdr
LEFT JOIN ( SELECT resource_id, AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP
BY resource_id ) trs ON tdr.id = trs.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY resource_id ) trcar
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "car" FROM tb_resource_car WHERE 1 = 1 AND del_flag = 0 AND
user_id = #{dto.creator} GROUP BY resource_id ) trcar
ON tdr.id = trcar.resource_id
LEFT JOIN ( SELECT resource_id, COUNT(id) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag =
0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id