Skip to content

Commit

Permalink
fix: compatible with mysql 5.7+
Browse files Browse the repository at this point in the history
Signed-off-by: tiny-x <[email protected]>
  • Loading branch information
tiny-x committed May 10, 2021
1 parent e960c6d commit e5fb42c
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Map<String, String> deserialize(JsonParser p, DeserializationContext ctxt
if (jsonNode.get("value") != null && !jsonNode.get("value").isNull()) {
String value = jsonNode.get("value").asText();
if (StrUtil.isBlank(value)) {
value = jsonNode.get("value").toString();
value = jsonNode.get("value").toString().replace("\"","");
}
if (StrUtil.isNotBlank(value)) {
map.put(jsonNode.get("name").asText(), value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface ExperimentTaskMapper extends BaseMapper<ExperimentTaskDO> {
/**
*
*/
@Select("select count(*) as taskCount , date_format(gmt_start,'%Y-%m-%d') as `date` from t_chaos_experiment_task group by date(gmt_start)")
@Select("select count(*) as taskCount , max(date_format(gmt_start,'%Y-%m-%d')) as `date` from t_chaos_experiment_task group by date(gmt_start)")
List<Map<Integer, Object>> queryTaskStatistics();

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Optional<SceneDO> selectByCodeAndVersion(String code, String version) {

public List<SceneDO> selectByCode(String code) {
QueryWrapper<SceneDO> queryWrapper = QueryWrapperBuilder.build();
queryWrapper.lambda().like(SceneDO::getSceneCode, code);
queryWrapper.lambda().likeRight(SceneDO::getSceneCode, code);
return sceneMapper.selectList(queryWrapper);
}

Expand Down
87 changes: 0 additions & 87 deletions chaosblade-box-dao/src/main/resources/generator/ClusterMapper.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,68 @@
[
{
"sceneCode": "chaosblade.cpu.fullload",
"sceneCode": "chaosblade",
"sceneParams": [
{
"name": "debug",
"alias": "",
"description": "",
"component": {
"type": "radio",
"required": false,
"values": [
{
"key": 0,
"label": "开启",
"value": "true"
},
{
"key": 1,
"label": "关闭",
"value": "false"
}
]
}
},
{
"name": "timeout",
"alias": "",
"description": "",
"component": {
"type": "number",
"required": false,
"values": []
}
},
{
"name": "time",
"alias": "",
"description": "",
"component": {
"type": "number",
"required": false,
"values": []
}
},
{
"name": "effect-percent",
"alias": "",
"description": "",
"component": {
"type": "number",
"required": false,
"values": []
}
},
{
"name": "effect-count",
"alias": "",
"description": "",
"component": {
"type": "number",
"required": false,
"values": []
}
},
{
"name": "cpu-count",
"alias": "",
Expand All @@ -22,13 +83,7 @@
"maxValue": "100",
"values": []
}
}
]
},
{
"sceneCode": "chaosblade.mem.load",
"sceneParams": [
{
},{
"name": "reserve",
"alias": "",
"description": "",
Expand Down Expand Up @@ -119,7 +174,7 @@
]
},
{
"sceneCode": "chaosblade.dubbo.delay",
"sceneCode": "chaosblade.dubbo",
"sceneParams": [
{
"name": "consumer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public KubernetesStatisticsResponse getKubernetesTotalStatistics() {
.type(DeviceType.POD.getCode())
.build()))
.namespaces(devicePodMapper.selectList(QueryWrapperBuilder.<DevicePodDO>build()
.groupBy("namespace")).size())
.groupBy("namespace").select("max(id)")).size())
.containers(devicePodRepository.selectList(DevicePodDO.builder().build()).stream().flatMap(devicePodDO ->
Optional.ofNullable(devicePodDO.getContainers()).map(
containers -> {
Expand Down

0 comments on commit e5fb42c

Please sign in to comment.