|
@@ -102,12 +102,20 @@
|
|
|
) AS gdArea
|
|
|
FROM t_tdgy td
|
|
|
<where>
|
|
|
- <if test="projectType != null">
|
|
|
+ <choose>
|
|
|
+ <when test="projectType == null">
|
|
|
EXISTS (
|
|
|
- SELECT 1 FROM t_project p
|
|
|
- WHERE p.id = td.project_id AND p.project_type = #{projectType} and p.on_chain_num > 0
|
|
|
+ SELECT 1 FROM t_project p
|
|
|
+ WHERE p.id = td.project_id and p.on_chain_num > 0
|
|
|
)
|
|
|
- </if>
|
|
|
+ </when>
|
|
|
+ <when test="projectType != null">
|
|
|
+ EXISTS (
|
|
|
+ SELECT 1 FROM t_project p
|
|
|
+ WHERE p.id = td.project_id AND p.project_type = #{projectType} and p.on_chain_num > 0
|
|
|
+ )
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
</where>
|
|
|
GROUP BY COALESCE(NULLIF(TRIM(td.gd_type), ''), '其他')
|
|
|
</select>
|