From 654ef21298e5a33d80826ecabd1b201ad0c3944f Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 3 Aug 2022 16:39:33 +0800 Subject: [PATCH] =?UTF-8?q?pageWithAttrs=E8=A1=A5=E5=85=85=E8=BF=94?= =?UTF-8?q?=E5=9B=9EapproveStatus=E5=AD=97=E6=AE=B5=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/resource/ResourceDao.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 31e2d6b1..66ab9b60 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -107,7 +107,8 @@ 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, - IF ( IFNULL( trcar.car, 0 ) > 0, TRUE, FALSE ) AS "isInShoppingCart" + IF ( IFNULL( trcar.car, 0 ) > 0, TRUE, FALSE ) AS "isInShoppingCart", + IF( IFNULL(taa3.approve_status, 0) < 1, '未通过', '通过' ) AS "approveStatus" FROM tb_data_resource tdr LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id @@ -126,6 +127,9 @@ LEFT JOIN ( SELECT resource_id, user_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY 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 AND tdr.del_flag = 0 @@ -373,7 +377,8 @@ sd.name AS "deptName", IFNULL(trc2.isCollect, 'false') AS "isCollect", IFNULL(taa2.approve_status, '未申请') AS "applyState", - IF ( IFNULL( trcar.car, 0 ) > 0, TRUE, FALSE ) AS "isInShoppingCart" + IF ( IFNULL( trcar.car, 0 ) > 0, TRUE, FALSE ) AS "isInShoppingCart", + IF( IFNULL(taa3.approve_status, 0) < 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 GROUP @@ -391,6 +396,9 @@ LEFT JOIN ( SELECT DISTINCT resource_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND user_id = #{dto.creator} GROUP BY 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 AND tdr.del_flag = 0