Skip to content

Commit 6d978f1

Browse files
committed
fix: Modify block group
1 parent 4ba0818 commit 6d978f1

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

base/src/main/java/com/tinyengine/it/service/material/impl/BlockGroupServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public List<BlockGroup> getBlockGroupByIdsOrAppId(List<Integer> ids, Integer app
183183
blockGroupsListResult = blockGroupMapper.queryAllBlockGroupAndBlock( blockCreatedBy, groupCreatedBy);
184184
}
185185

186-
if (blockGroupsListResult.isEmpty()) {
186+
if (blockGroupsListResult.get(0).getId() == null) {
187187
return blockGroupsListResult;
188188
}
189189
// 对查询的结果的区块赋值current_version

base/src/main/java/com/tinyengine/it/service/material/impl/BlockServiceImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ public Result<BlockDto> deploy(BlockBuildDto blockBuildDto) {
555555
blockParam.setLatestHistoryId(blockHistory);
556556
blockParam.setLatestVersion(blockHistory.getVersion());
557557
blockParam.setId(blockDto.getId());
558-
559558
return updateBlockById(blockParam, blockDto.getAppId());
560559
} catch (Exception e) {
561560
return Result.failed(ExceptionEnum.CM001);

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,14 @@
311311
r_block_group_block rbg ON rbg.block_group_id = bg.id
312312
LEFT JOIN
313313
t_block b ON b.id = rbg.block_id
314-
<if test="blockCreatedBy != null">
315-
AND b.created_by = #{blockCreatedBy}
316-
</if>
317-
<if test="blockCreatedBy == null">
318-
AND b.last_build_info is not null and b.content is not null and b.assets is not null
319-
</if>
314+
<choose>
315+
<when test="blockCreatedBy != null">
316+
AND b.created_by = #{blockCreatedBy}
317+
</when>
318+
<otherwise>
319+
AND b.last_build_info is not null and b.content is not null
320+
</otherwise>
321+
</choose>
320322
<where>
321323
<if test="id != null">
322324
AND bg.id = #{id}
@@ -327,6 +329,7 @@
327329
</where>
328330
</select>
329331

332+
330333
<!-- 根据条件查询表t_block_group数据 -->
331334
<select id="queryBlockGroupByCondition" resultMap="BlockGroupMap">
332335
SELECT

0 commit comments

Comments
 (0)