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