1、指令新建时插入日志表增加uuid
This commit is contained in:
@@ -53,7 +53,7 @@ public interface CommandMapper {
|
|||||||
|
|
||||||
void updateCommandHistoryExpireTime(@Param("command_id") String commandUUID);
|
void updateCommandHistoryExpireTime(@Param("command_id") String commandUUID);
|
||||||
|
|
||||||
void insertCommandHistory(@Param("command_id") String commandUUID);
|
void insertCommandHistory(@Param("command_id") String commandUUID, @Param("log_id") String logUUID);
|
||||||
|
|
||||||
void updateCommandHistoryExpireTimeBatch(@Param("commandIds")List<String> commandIds);
|
void updateCommandHistoryExpireTimeBatch(@Param("commandIds")List<String> commandIds);
|
||||||
|
|
||||||
|
|||||||
@@ -238,15 +238,23 @@ public class CommandService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void insertCommandHistory(String commandUUID) {
|
public void insertCommandHistory(String commandUUID) {
|
||||||
commandMapper.updateCommandHistoryExpireTime(commandUUID);
|
//todo: 不update, insert加入uuid
|
||||||
commandMapper.insertCommandHistory(commandUUID);
|
// commandMapper.updateCommandHistoryExpireTime(commandUUID);
|
||||||
|
String logId = UUID.randomUUID().toString();
|
||||||
|
commandMapper.insertCommandHistory(commandUUID, logId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertCommandHistoryBatch(List<TaskCommandInfo> commandIdList) {
|
public void insertCommandHistoryBatch(List<TaskCommandInfo> commandIdList) {
|
||||||
List<String> commandIds = ListUtils.newArrayListWithExpectedSize(commandIdList.size());
|
List<String> commandIds = ListUtils.newArrayListWithExpectedSize(commandIdList.size());
|
||||||
commandIdList.forEach(item -> commandIds.add(item.getUUID()));
|
commandIdList.forEach(item -> commandIds.add(item.getUUID()));
|
||||||
|
//todo: 不update, insert加入uuid
|
||||||
commandMapper.updateCommandHistoryExpireTimeBatch(commandIds);
|
// commandMapper.updateCommandHistoryExpireTimeBatch(commandIds);
|
||||||
|
// List<String> logIds;
|
||||||
|
// logIds = ListUtils.newArrayListWithExpectedSize(commandIds.size());
|
||||||
|
// for (int i = 0; i < commandIds.size(); i++) {
|
||||||
|
// logIds.add(UUID.randomUUID().toString());
|
||||||
|
// }
|
||||||
|
//新建的loguuid拿commannd_id来定顶一会吧
|
||||||
commandMapper.insertCommandHistoryBatch(commandIds);
|
commandMapper.insertCommandHistoryBatch(commandIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,7 +165,8 @@
|
|||||||
session_num,
|
session_num,
|
||||||
first_effect_time,
|
first_effect_time,
|
||||||
last_rcp_query_time,
|
last_rcp_query_time,
|
||||||
last_traffic_query_time
|
last_traffic_query_time,
|
||||||
|
log_uuid
|
||||||
)
|
)
|
||||||
select
|
select
|
||||||
NOW(),
|
NOW(),
|
||||||
@@ -218,7 +219,8 @@
|
|||||||
session_num,
|
session_num,
|
||||||
first_effect_time,
|
first_effect_time,
|
||||||
last_rcp_query_time,
|
last_rcp_query_time,
|
||||||
last_traffic_query_time
|
last_traffic_query_time,
|
||||||
|
#{log_id}
|
||||||
from t_command
|
from t_command
|
||||||
where COMMAND_ID = #{command_id}
|
where COMMAND_ID = #{command_id}
|
||||||
</insert>
|
</insert>
|
||||||
@@ -274,7 +276,8 @@
|
|||||||
session_num,
|
session_num,
|
||||||
first_effect_time,
|
first_effect_time,
|
||||||
last_rcp_query_time,
|
last_rcp_query_time,
|
||||||
last_traffic_query_time
|
last_traffic_query_time,
|
||||||
|
log_uuid
|
||||||
)
|
)
|
||||||
select
|
select
|
||||||
NOW(),
|
NOW(),
|
||||||
@@ -327,7 +330,8 @@
|
|||||||
session_num,
|
session_num,
|
||||||
first_effect_time,
|
first_effect_time,
|
||||||
last_rcp_query_time,
|
last_rcp_query_time,
|
||||||
last_traffic_query_time
|
last_traffic_query_time,
|
||||||
|
COMMAND_ID
|
||||||
from t_command
|
from t_command
|
||||||
where COMMAND_ID IN
|
where COMMAND_ID IN
|
||||||
<foreach collection="commandIds" item="command_id" separator="," open="(" close=")">
|
<foreach collection="commandIds" item="command_id" separator="," open="(" close=")">
|
||||||
|
|||||||
Reference in New Issue
Block a user