pageWithAttrs补充返回approveStatus字段值
This commit is contained in:
parent
d59ebd507b
commit
654ef21298
|
@ -107,7 +107,8 @@
|
||||||
IFNULL(trc2.isCollect, 'false') AS "isCollect",
|
IFNULL(trc2.isCollect, 'false') AS "isCollect",
|
||||||
(IFNULL(tdr.visits / 100, 0) + IFNULL(trs.score, 0) + IFNULL(taa.applyCount, 0)+ IFNULL(trc.collectCount, 0)) AS
|
(IFNULL(tdr.visits / 100, 0) + IFNULL(trs.score, 0) + IFNULL(taa.applyCount, 0)+ IFNULL(trc.collectCount, 0)) AS
|
||||||
total,
|
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
|
FROM
|
||||||
tb_data_resource tdr
|
tb_data_resource tdr
|
||||||
LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id
|
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
|
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}
|
AND user_id = #{dto.creator}
|
||||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
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
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
AND tdr.del_flag = 0
|
AND tdr.del_flag = 0
|
||||||
|
@ -373,7 +377,8 @@
|
||||||
sd.name AS "deptName",
|
sd.name AS "deptName",
|
||||||
IFNULL(trc2.isCollect, 'false') AS "isCollect",
|
IFNULL(trc2.isCollect, 'false') AS "isCollect",
|
||||||
IFNULL(taa2.approve_status, '未申请') AS "applyState",
|
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
|
FROM
|
||||||
tb_data_resource tdr
|
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
|
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
|
LEFT JOIN ( SELECT DISTINCT resource_id, approve_status FROM t_ability_application WHERE 1 = 1 AND del_flag = 0
|
||||||
AND user_id = #{dto.creator}
|
AND user_id = #{dto.creator}
|
||||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
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
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
AND tdr.del_flag = 0
|
AND tdr.del_flag = 0
|
||||||
|
|
Loading…
Reference in New Issue