Skip to content

Commit e757b29

Browse files
committed
fix: Modify block group
1 parent 9717200 commit e757b29

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

base/src/main/resources/mappers/BlockGroupMapper.xml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,14 @@
183183
r_block_group_block rbg ON rbg.block_group_id = bg.id
184184
LEFT JOIN
185185
t_block b ON b.id = rbg.block_id
186-
<if test="blockCreatedBy != null">
187-
AND b.created_by = #{blockCreatedBy}
188-
</if>
189-
<if test="blockCreatedBy == null">
190-
AND b.last_build_info is not null and b.content is not null and b.assets is not null
191-
</if>
186+
<choose>
187+
<when test="blockCreatedBy != null">
188+
AND b.created_by = #{blockCreatedBy}
189+
</when>
190+
<otherwise>
191+
AND b.last_build_info is not null and b.content is not null
192+
</otherwise>
193+
</choose>
192194
<where>
193195
<if test="groupCreatedBy != null">
194196
AND bg.created_by = #{groupCreatedBy}
@@ -246,12 +248,14 @@
246248
r_block_group_block rbg ON rbg.block_group_id = bg.id
247249
LEFT JOIN
248250
t_block b ON b.id = rbg.block_id
249-
<if test="blockCreatedBy != null">
250-
AND b.created_by = #{blockCreatedBy}
251-
</if>
252-
<if test="blockCreatedBy == null">
253-
AND b.last_build_info is not null and b.content is not null and b.assets is not null
254-
</if>
251+
<choose>
252+
<when test="blockCreatedBy != null">
253+
AND b.created_by = #{blockCreatedBy}
254+
</when>
255+
<otherwise>
256+
AND b.last_build_info is not null and b.content is not null
257+
</otherwise>
258+
</choose>
255259
<where>
256260
<if test="appId != null">
257261
AND bg.app_id = #{appId}

0 commit comments

Comments
 (0)