Skip to content

Commit

Permalink
[ISSUE #67] Fix HealthCheckResultMapper which leads to application error
Browse files Browse the repository at this point in the history
  • Loading branch information
Lambert-Rao authored Mar 19, 2024
1 parent 7c7981d commit e750702
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,18 @@ List<HealthCheckResultEntity> selectByClusterIdAndCreateTimeRange(@Param("cluste

@Insert({
"<script>",
" INSERT INTO health_check_result(type, type_id, cluster_id, state, result_desc) VALUES ",
" <foreach collection='list' item='healthCheckResultEntity' index='index' separator=','>",
" (#{healthCheckResultEntity.type}, #{healthCheckResultEntity.typeId}, #{healthCheckResultEntity.clusterId},",
" #{healthCheckResultEntity.state}, #{healthCheckResultEntity.resultDesc})",
" </foreach>",
" <choose>",
" <when test='list.size() > 0'>",
" INSERT INTO health_check_result(type, type_id, cluster_id, state, result_desc) VALUES ",
" <foreach collection='list' item='healthCheckResultEntity' index='index' separator=','>",
" (#{healthCheckResultEntity.type}, #{healthCheckResultEntity.typeId}, #{healthCheckResultEntity.clusterId},",
" #{healthCheckResultEntity.state}, #{healthCheckResultEntity.resultDesc})",
" </foreach>",
" </when>",
" <otherwise>",
" SELECT 1 FROM DUAL WHERE FALSE",
" </otherwise>",
" </choose>",
"</script>"
})
void batchInsert(List<HealthCheckResultEntity> healthCheckResultEntityList);
Expand Down

0 comments on commit e750702

Please sign in to comment.