This commit is contained in:
guoshengxiong 2025-10-15 10:34:39 +08:00
parent efc4dca17e
commit b4dd77eb9e
41 changed files with 2289 additions and 24 deletions

View File

@ -1,24 +0,0 @@
package com.zhgd.xmgl.util;
import com.zhgd.jeecg.common.api.vo.Result;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
@RestController
@RequestMapping("/xmgl/mock")
public class MockUtil {
//@PostMapping(value = "/queryById")
//public Result queryById(@ApiIgnore @RequestBody HashMap<String ,Object> paramMap) {
// return Result.success(queryById(paramMap));
//}
}

View File

@ -0,0 +1,52 @@
package com.zhgd.xmgl.util.mock;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
public class MockConcreteMonitorCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`concrete_monitor_current_data` (`id`, `dev_sn`, `point_no`, `project_sn`, `receive_time`, `temperature`, `mock_time`) VALUES (%s, 'fyykhnt001', 8 , '77F2C55702E54741A6F42A03675C35A8', '%s', 29.00, '2023-11-23 14:37:28');";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
while (!currentDate.isAfter(endDate)) {
List<LocalDateTime> hoursInDay = MockUtil.get24HoursInDay(currentDate);
for (LocalDateTime dateTime : hoursInDay) {
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的唯一 ID
long newId = baseId + idCounter++;
String time = dateTime.format(formatter);
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId, time);
System.out.println(newSql);
}
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,43 @@
package com.zhgd.xmgl.util.mock.http;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
@Slf4j
public class MockAmmeterRecordDetailUtil {
public static void main(String[] args) {
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
List<Integer> addSteps = Arrays.asList(55, 100);
int degree = 5000;
ThreadLocalRandom random = ThreadLocalRandom.current();
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
JSONArray jsonArray = new JSONArray();
JSONObject jo = new JSONObject();
jo.put("ammeterNo", "fyykdb001");
degree += addSteps.get(random.nextInt(addSteps.size()));
jo.put("degree", degree);
jsonArray.add(jo);
String body = HttpRequest.post("http://jxj.zhgdyun.com:100/xmgl/callback/ammeterRecord/save")
.body(jsonArray.toJSONString())
.timeout(20000)//超时毫秒
.execute().body();
log.info("body:{}", body);
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
}
}

View File

@ -0,0 +1,44 @@
package com.zhgd.xmgl.util.mock.http;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
@Slf4j
public class MockWaterMeterRecordDetailUtil {
public static void main(String[] args) {
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
List<Integer> addSteps = Arrays.asList(14, 34);
int waterTonnage = 218;
ThreadLocalRandom random = ThreadLocalRandom.current();
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
JSONArray jsonArray = new JSONArray();
JSONObject jo = new JSONObject();
jo.put("waterMeterNo", "fyyksb001");
waterTonnage += addSteps.get(random.nextInt(addSteps.size()));
jo.put("waterTonnage", waterTonnage);
jo.put("gateStatus", 1);
jsonArray.add(jo);
String body = HttpRequest.post("http://jxj.zhgdyun.com:100/xmgl/callback/waterMeterRecord/save")
.body(jsonArray.toJSONString())
.timeout(20000)//超时毫秒
.execute().body();
log.info("body:{}", body);
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
}
}

View File

@ -0,0 +1,56 @@
package com.zhgd.xmgl.util.mock.random;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;
public class MockDustNoiseDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 80.00, 50.00, 68.20, 96.00, 23.60, 88.20, 0.80, '南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 75.00, 49.00, 65.10, 90.00, 23.60, 88.20, 0.90, '西南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 76.00, 50.00, 66.90, 92.00, 23.60, 88.40, 1.10, '西南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 74.00, 48.00, 66.70, 89.00, 23.60, 88.20, 1.30, '南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 73.00, 47.00, 66.10, 88.00, 23.60, 88.50, 1.60, '西南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 76.00, 49.00, 64.30, 92.00, 23.60, 88.40, 1.00, '南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
ThreadLocalRandom random = ThreadLocalRandom.current();
while (!currentDate.isAfter(endDate)) {
List<LocalDateTime> hoursInDays = MockUtil.get24HoursInDay(currentDate);
for (LocalDateTime dateTime : hoursInDays) {
// 构造新的唯一 ID
long newId = baseId + idCounter++;
String template = sqlTemplates.get(random.nextInt(sqlTemplates.size()));
String formatDateTime = dateTime.format(formatter);
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId, formatDateTime, formatDateTime);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,54 @@
package com.zhgd.xmgl.util.mock.random;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;
public class MockSewageDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`sewage_data` (`id`, `dev_sn`, `ph_value`, `turbidity_value`, `conductivity`, `dissolved_oxygen`, `water_temperature`, `flow_velocity`, `water_level`, `project_sn`, `create_date`, `update_date`, `mock_time`) VALUES (%s, '123', 6.9, 80.9, 120, 10.22, NULL, 0, 0.559, '77F2C55702E54741A6F42A03675C35A8', '%s','%s','%s');\n" +
"INSERT INTO `wisdomsite`.`sewage_data` (`id`, `dev_sn`, `ph_value`, `turbidity_value`, `conductivity`, `dissolved_oxygen`, `water_temperature`, `flow_velocity`, `water_level`, `project_sn`, `create_date`, `update_date`, `mock_time`) VALUES (%s, '123', 6.9, 64.9, 120, 10.12, NULL, 8.06, 0.572, '77F2C55702E54741A6F42A03675C35A8', '%s','%s','%s');\n" +
"INSERT INTO `wisdomsite`.`sewage_data` (`id`, `dev_sn`, `ph_value`, `turbidity_value`, `conductivity`, `dissolved_oxygen`, `water_temperature`, `flow_velocity`, `water_level`, `project_sn`, `create_date`, `update_date`, `mock_time`) VALUES (%s, '123', 6.89, 64, 120, 10.13, NULL, 4.77, 0.607, '77F2C55702E54741A6F42A03675C35A8', '%s','%s','%s');\n" +
"INSERT INTO `wisdomsite`.`sewage_data` (`id`, `dev_sn`, `ph_value`, `turbidity_value`, `conductivity`, `dissolved_oxygen`, `water_temperature`, `flow_velocity`, `water_level`, `project_sn`, `create_date`, `update_date`, `mock_time`) VALUES (%s, '123', 6.91, 57.5, 120, 10.14, NULL, 0, 0.578, '77F2C55702E54741A6F42A03675C35A8', '%s','%s','%s');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
ThreadLocalRandom random = ThreadLocalRandom.current();
while (!currentDate.isAfter(endDate)) {
List<LocalDateTime> hoursInDays = MockUtil.get24HoursInDay(currentDate);
for (LocalDateTime dateTime : hoursInDays) {
// 构造新的唯一 ID
long newId = baseId + idCounter++;
String template = sqlTemplates.get(random.nextInt(sqlTemplates.size()));
String formatDateTime = dateTime.format(formatter);
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId, formatDateTime, formatDateTime, formatDateTime);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,55 @@
package com.zhgd.xmgl.util.mock.random;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;
public class MockTowerCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`tower_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `recive_time`, `start_time`, `loading`, `load_ratio`, `torque`, `torque_ratio`, `angle`, `ranger`, `height`, `windspeed`, `obliguity`, `rate`, `vertical_deviation`, `driver_name`, `driver_id_card`, `obliguity_x`, `obliguity_y`, `real_flag`, `no_error`, `weight_error`, `wind_speed_error`, `range_error`, `height_error`, `angle_error`, `obliguity_error`, `gps_error`, `id_error`, `no_alarm`, `moment_alarm`, `wind_speed_alarm`, `height_alarm`, `height_lower_alarm`, `min_range_alarm`, `max_range_alarm`, `pos_angle_alarm`, `neg_angle_alarm`, `obliguity_alarm`, `forbid_entry_alarm`, `forbid_suspend2_alarm`, `forbid_suspend4_alarm`, `multi_alarm_all`, `forbid_entry_pos_alarm`, `forbid_entry_neg_alarm`, `forbid_suspend2_pos_alarm`, `forbid_suspend2_neg_alarm`, `forbid_suspend2_out_alarm`, `forbid_suspend4_pos_alarm`, `forbid_suspend4_neg_alarm`, `forbid_suspend4_out_alarm`, `forbid_suspend4_back_alarm`, `multi_pos_alarm`, `multi_neg_alarm`, `multi_out_alarm`, `multi_back_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `height_direction`, `range_direction`, `angle_direction`, `xiewen_id`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '%s', '%s', '0', '0', NULL, '0', '0', '37', '21', '3', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1785147, '2025-10-14 14:33:21');\n" +
"INSERT INTO `wisdomsite`.`tower_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `recive_time`, `start_time`, `loading`, `load_ratio`, `torque`, `torque_ratio`, `angle`, `ranger`, `height`, `windspeed`, `obliguity`, `rate`, `vertical_deviation`, `driver_name`, `driver_id_card`, `obliguity_x`, `obliguity_y`, `real_flag`, `no_error`, `weight_error`, `wind_speed_error`, `range_error`, `height_error`, `angle_error`, `obliguity_error`, `gps_error`, `id_error`, `no_alarm`, `moment_alarm`, `wind_speed_alarm`, `height_alarm`, `height_lower_alarm`, `min_range_alarm`, `max_range_alarm`, `pos_angle_alarm`, `neg_angle_alarm`, `obliguity_alarm`, `forbid_entry_alarm`, `forbid_suspend2_alarm`, `forbid_suspend4_alarm`, `multi_alarm_all`, `forbid_entry_pos_alarm`, `forbid_entry_neg_alarm`, `forbid_suspend2_pos_alarm`, `forbid_suspend2_neg_alarm`, `forbid_suspend2_out_alarm`, `forbid_suspend4_pos_alarm`, `forbid_suspend4_neg_alarm`, `forbid_suspend4_out_alarm`, `forbid_suspend4_back_alarm`, `multi_pos_alarm`, `multi_neg_alarm`, `multi_out_alarm`, `multi_back_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `height_direction`, `range_direction`, `angle_direction`, `xiewen_id`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '%s', '%s', '217', '8', NULL, '8', '0', '36', '23', '2', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1785146, '2025-10-14 14:33:21');\n" +
"INSERT INTO `wisdomsite`.`tower_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `recive_time`, `start_time`, `loading`, `load_ratio`, `torque`, `torque_ratio`, `angle`, `ranger`, `height`, `windspeed`, `obliguity`, `rate`, `vertical_deviation`, `driver_name`, `driver_id_card`, `obliguity_x`, `obliguity_y`, `real_flag`, `no_error`, `weight_error`, `wind_speed_error`, `range_error`, `height_error`, `angle_error`, `obliguity_error`, `gps_error`, `id_error`, `no_alarm`, `moment_alarm`, `wind_speed_alarm`, `height_alarm`, `height_lower_alarm`, `min_range_alarm`, `max_range_alarm`, `pos_angle_alarm`, `neg_angle_alarm`, `obliguity_alarm`, `forbid_entry_alarm`, `forbid_suspend2_alarm`, `forbid_suspend4_alarm`, `multi_alarm_all`, `forbid_entry_pos_alarm`, `forbid_entry_neg_alarm`, `forbid_suspend2_pos_alarm`, `forbid_suspend2_neg_alarm`, `forbid_suspend2_out_alarm`, `forbid_suspend4_pos_alarm`, `forbid_suspend4_neg_alarm`, `forbid_suspend4_out_alarm`, `forbid_suspend4_back_alarm`, `multi_pos_alarm`, `multi_neg_alarm`, `multi_out_alarm`, `multi_back_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `height_direction`, `range_direction`, `angle_direction`, `xiewen_id`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '%s', '%s', '217', '7', NULL, '7', '0', '34', '24', '3', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1785145, '2025-10-14 14:33:21');\n" +
"INSERT INTO `wisdomsite`.`tower_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `recive_time`, `start_time`, `loading`, `load_ratio`, `torque`, `torque_ratio`, `angle`, `ranger`, `height`, `windspeed`, `obliguity`, `rate`, `vertical_deviation`, `driver_name`, `driver_id_card`, `obliguity_x`, `obliguity_y`, `real_flag`, `no_error`, `weight_error`, `wind_speed_error`, `range_error`, `height_error`, `angle_error`, `obliguity_error`, `gps_error`, `id_error`, `no_alarm`, `moment_alarm`, `wind_speed_alarm`, `height_alarm`, `height_lower_alarm`, `min_range_alarm`, `max_range_alarm`, `pos_angle_alarm`, `neg_angle_alarm`, `obliguity_alarm`, `forbid_entry_alarm`, `forbid_suspend2_alarm`, `forbid_suspend4_alarm`, `multi_alarm_all`, `forbid_entry_pos_alarm`, `forbid_entry_neg_alarm`, `forbid_suspend2_pos_alarm`, `forbid_suspend2_neg_alarm`, `forbid_suspend2_out_alarm`, `forbid_suspend4_pos_alarm`, `forbid_suspend4_neg_alarm`, `forbid_suspend4_out_alarm`, `forbid_suspend4_back_alarm`, `multi_pos_alarm`, `multi_neg_alarm`, `multi_out_alarm`, `multi_back_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `height_direction`, `range_direction`, `angle_direction`, `xiewen_id`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '%s', '%s', '217', '7', NULL, '7', '0', '32', '26', '3', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1785144, '2025-10-14 14:33:21');\n" +
"INSERT INTO `wisdomsite`.`tower_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `recive_time`, `start_time`, `loading`, `load_ratio`, `torque`, `torque_ratio`, `angle`, `ranger`, `height`, `windspeed`, `obliguity`, `rate`, `vertical_deviation`, `driver_name`, `driver_id_card`, `obliguity_x`, `obliguity_y`, `real_flag`, `no_error`, `weight_error`, `wind_speed_error`, `range_error`, `height_error`, `angle_error`, `obliguity_error`, `gps_error`, `id_error`, `no_alarm`, `moment_alarm`, `wind_speed_alarm`, `height_alarm`, `height_lower_alarm`, `min_range_alarm`, `max_range_alarm`, `pos_angle_alarm`, `neg_angle_alarm`, `obliguity_alarm`, `forbid_entry_alarm`, `forbid_suspend2_alarm`, `forbid_suspend4_alarm`, `multi_alarm_all`, `forbid_entry_pos_alarm`, `forbid_entry_neg_alarm`, `forbid_suspend2_pos_alarm`, `forbid_suspend2_neg_alarm`, `forbid_suspend2_out_alarm`, `forbid_suspend4_pos_alarm`, `forbid_suspend4_neg_alarm`, `forbid_suspend4_out_alarm`, `forbid_suspend4_back_alarm`, `multi_pos_alarm`, `multi_neg_alarm`, `multi_out_alarm`, `multi_back_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `height_direction`, `range_direction`, `angle_direction`, `xiewen_id`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '%s', '%s', '217', '5', NULL, '5', '0', '26', '26', '3', '0', NULL, NULL, NULL, NULL, NULL, NULL, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1785143, '2025-10-14 14:33:21');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
ThreadLocalRandom random = ThreadLocalRandom.current();
while (!currentDate.isAfter(endDate)) {
List<LocalDateTime> hoursInDays = MockUtil.get24HoursInDay(currentDate);
for (LocalDateTime dateTime : hoursInDays) {
// 构造新的唯一 ID
long newId = baseId + idCounter++;
String template = sqlTemplates.get(random.nextInt(sqlTemplates.size()));
String formatDateTime = dateTime.format(formatter);
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId, formatDateTime,formatDateTime);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,53 @@
package com.zhgd.xmgl.util.mock.randomDateTimeInDay;
import cn.hutool.core.util.StrUtil;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
public class MockAiAnalyseHardWareAlarmRecordUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`ai_analyse_hard_ware_alarm_record` (`id`, `project_sn`, `hardware_name`, `hardware_id`, `image_url`, `alarm_type`, `location`, `create_time`, `rectification_person_id`, `push_person_ids`, `status`, `correct_image`, `correct_remark`, `correct_time`, `request_rectification_date`, `update_date`, `handle_result`, `desc`, `handle_done`, `deduct_score`, `alarm_video`, `alarm_desc`, `alarm_name`, `is_pushed`, `quality_region_id`, `handle_type`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811AI设备1', '20230811AI001', '334765_1760150334258_1.jpg', 6, NULL, '%s', NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-10-11 11:01:49', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL);\n" +
"INSERT INTO `wisdomsite`.`ai_analyse_hard_ware_alarm_record` (`id`, `project_sn`, `hardware_name`, `hardware_id`, `image_url`, `alarm_type`, `location`, `create_time`, `rectification_person_id`, `push_person_ids`, `status`, `correct_image`, `correct_remark`, `correct_time`, `request_rectification_date`, `update_date`, `handle_result`, `desc`, `handle_done`, `deduct_score`, `alarm_video`, `alarm_desc`, `alarm_name`, `is_pushed`, `quality_region_id`, `handle_type`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811AI设备1', '20230811AI001', '334723_1760149637385_1.jpg', 6, NULL, '%s', NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-10-11 10:50:12', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL);\n" +
"INSERT INTO `wisdomsite`.`ai_analyse_hard_ware_alarm_record` (`id`, `project_sn`, `hardware_name`, `hardware_id`, `image_url`, `alarm_type`, `location`, `create_time`, `rectification_person_id`, `push_person_ids`, `status`, `correct_image`, `correct_remark`, `correct_time`, `request_rectification_date`, `update_date`, `handle_result`, `desc`, `handle_done`, `deduct_score`, `alarm_video`, `alarm_desc`, `alarm_name`, `is_pushed`, `quality_region_id`, `handle_type`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811AI设备1', '20230811AI001', '334723_1760149636627_1.jpg', 6, NULL, '%s', NULL, NULL, 1, NULL, NULL, NULL, NULL, '2025-10-11 10:50:12', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL, NULL);\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
String newTime = MockUtil.getRandomDateTimeInDay(currentDate).format(formatter);
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId, newTime);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,54 @@
package com.zhgd.xmgl.util.mock.randomDateTimeInDay;
import cn.hutool.core.util.StrUtil;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
public class MockCarMeasureSpeedDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`car_measure_speed_data` (`id`, `dev_sn`, `car_number`, `is_exceed`, `current_speed`, `exceeding_threshold`, `snapshot_image`, `upload_time`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '粤J58345', 0, 51.00000, 0.00000, '6840f657b7e17b344a9d5a36.png', '%s', '77F2C55702E54741A6F42A03675C35A8', '2025-06-05 09:42:34', '2025-06-05 09:50:52');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`car_measure_speed_data` (`id`, `dev_sn`, `car_number`, `is_exceed`, `current_speed`, `exceeding_threshold`, `snapshot_image`, `upload_time`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '闽AH6X01', 0, 64.00000, 0.00000, '6840f74fb7e17b344a9d5a37.png', '%s', '77F2C55702E54741A6F42A03675C35A8', '2025-06-05 09:42:34', '2025-06-05 09:52:25');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`car_measure_speed_data` (`id`, `dev_sn`, `car_number`, `is_exceed`, `current_speed`, `exceeding_threshold`, `snapshot_image`, `upload_time`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '闽BA50159', 0, 70.00000, 0.00000, '6840f773b7e17b344a9d5a38.png', '%s', '77F2C55702E54741A6F42A03675C35A8', '2025-06-05 09:42:34', '2025-06-05 09:52:28');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`car_measure_speed_data` (`id`, `dev_sn`, `car_number`, `is_exceed`, `current_speed`, `exceeding_threshold`, `snapshot_image`, `upload_time`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '闽BDM525', 0, 63.00000, 0.00000, '6840f782b7e17b344a9d5a39.png', '%s', '77F2C55702E54741A6F42A03675C35A8', '2025-06-05 09:42:34', '2025-06-05 09:52:31');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
String newTime = MockUtil.getRandomDateTimeInDay(currentDate).format(formatter);
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId, newTime);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,78 @@
package com.zhgd.xmgl.util.mock.randomDateTimeInDay;
import cn.hutool.core.util.StrUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
public class MockUtil {
/**
* 获取指定 LocalDate 这一天内的随机 LocalDateTime
* 时间范围从该天的 00:00:00.000 23:59:59.999 (即精确到纳秒)
*
* @param date 指定的 LocalDate 对象 (例如 2025-10-10)
* @return 该日期内的一个随机 LocalDateTime 对象
*/
public static LocalDateTime getRandomDateTimeInDay(LocalDate date) {
// 1. 获取一天中的纳秒总数 (24小时 * 60分钟 * 60秒 * 10^9 纳秒)
long totalNanosOfDay = 24 * 60 * 60 * 1_000_000_000L;
// 2. 生成一个 0 totalNanosOfDay 之间的随机纳秒数
// ThreadLocalRandom.current().nextLong(min, max) 生成 [min, max) 范围的随机数
long randomNanos = ThreadLocalRandom.current().nextLong(0, totalNanosOfDay);
// 3. 使用随机纳秒数创建 LocalTime 对象
LocalTime randomTime = LocalTime.ofNanoOfDay(randomNanos);
// 4. LocalDate LocalTime 组合成 LocalDateTime
return LocalDateTime.of(date, randomTime);
}
/**
* 获取指定日期每小时的第1分钟共24个时间点
* @param date
* @return
*/
public static List<LocalDateTime> get24HoursInDay(LocalDate date) {
List<LocalDateTime> result = new ArrayList<>();
for (int hour = 0; hour < 24; hour++) {
LocalDateTime dateTime = LocalDateTime.of(date, LocalTime.of(hour, 1, 0));
result.add(dateTime);
}
return result;
}
/**
* 替换日期
*
* @param newSql
* @param fromDate
* @param toDate
* @return
*/
public static String replaceDate(String newSql, String fromDate, LocalDate toDate) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
newSql = StrUtil.replace(newSql, fromDate, toDate.format(formatter));
return newSql;
}
public static void main(String[] args) {
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
while (!currentDate.isAfter(endDate)) {
LocalDateTime inDay = getRandomDateTimeInDay(currentDate);
System.out.println(inDay.format(formatter));
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockBridgeErectMachineDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`bridge_erect_machine_data` (`id`, `dev_sn`, `dev_name`, `wind_speed`, `main_hook_lifting_weight`, `main_hook_height`, `main_hook_speed`, `auxiliary_hook_lifting_weight`, `auxiliary_hook_height`, `auxiliary_hook_speed`, `big_car_trip`, `big_cart_speed`, `car_trip`, `car_speed`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '架桥机设备', 6, 2, 3, 4, 5, 60, 70, 60, 90, 10, 20, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 21:00:17', '2024-03-25 20:00:17');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,52 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockCarPassRecordUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`car_pass_record` (`id`, `car_number`, `type`, `pass_time`, `image_url`, `car_color`, `location`, `project_sn`, `car_logo`, `color`, `panorama_url`, `camera_id`, `driver_data`, `is_open`) VALUES (%s, '宁A8LG23', 0, '2024-07-09 18:25:53', '668d103186e4b02e934c80e5.png', '白色', '1212', '77F2C55702E54741A6F42A03675C35A8', 'Jeep', NULL, '668d103186e4b02e934c80e4.png', '123456', NULL, 0);\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`car_pass_record` (`id`, `car_number`, `type`, `pass_time`, `image_url`, `car_color`, `location`, `project_sn`, `car_logo`, `color`, `panorama_url`, `camera_id`, `driver_data`, `is_open`) VALUES (%s, '冀F0B5K1', 1, '2024-07-09 18:25:59', '668d103786e4b02e934c80e7.png', '白色', '1212', '77F2C55702E54741A6F42A03675C35A8', '丰田', NULL, '668d103786e4b02e934c80e6.png', '123456', NULL, 0);\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`car_pass_record` (`id`, `car_number`, `type`, `pass_time`, `image_url`, `car_color`, `location`, `project_sn`, `car_logo`, `color`, `panorama_url`, `camera_id`, `driver_data`, `is_open`) VALUES (%s, '宁A8LG23', 1, '2024-07-09 18:26:00', '668d103886e4b02e934c80e9.png', '白色', '1212', '77F2C55702E54741A6F42A03675C35A8', 'Jeep', NULL, '668d103886e4b02e934c80e8.png', '123456', NULL, 0);\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-07-09", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,56 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockConcreteMixStationDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`concrete_mix_station_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `pouring_part`, `power_level`, `actual_quantity`, `water_binder_ratio`, `discharge_time`, `use_status`, `construction_mix_ratio`, `stirring_time`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '拉林隧洞出口', '7', '预制管片', 'c50W10F100', 1.3, 0, '2025-10-14 16:14:04', 1, 'PF240715001', '100', '拉林隧道', '管理员', '77F2C55702E54741A6F42A03675C35A8', '2025-10-14 16:15:39', '2025-10-14 16:15:39');\n" +
"INSERT INTO `wisdomsite`.`concrete_mix_station_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `pouring_part`, `power_level`, `actual_quantity`, `water_binder_ratio`, `discharge_time`, `use_status`, `construction_mix_ratio`, `stirring_time`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '拉林隧洞出口', '18', '预制管片B', 'C50W10F100B', 1.3, 0, '2025-10-14 15:42:21', 1, 'PF250331001', '100', '预制管片B', '管理员', '77F2C55702E54741A6F42A03675C35A8', '2025-10-14 15:43:55', '2025-10-14 15:43:55');\n" +
"INSERT INTO `wisdomsite`.`concrete_mix_station_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `pouring_part`, `power_level`, `actual_quantity`, `water_binder_ratio`, `discharge_time`, `use_status`, `construction_mix_ratio`, `stirring_time`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '拉林隧洞出口', '18', '预制管片B', 'C50W10F100B', 1.3, 0, '2025-10-14 15:36:36', 1, 'PF250331001', '100', '预制管片B', '管理员', '77F2C55702E54741A6F42A03675C35A8', '2025-10-14 15:38:10', '2025-10-14 15:38:10');\n" +
"INSERT INTO `wisdomsite`.`concrete_mix_station_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `pouring_part`, `power_level`, `actual_quantity`, `water_binder_ratio`, `discharge_time`, `use_status`, `construction_mix_ratio`, `stirring_time`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '拉林隧洞出口', '18', '预制管片B', 'C50W10F100B', 1.3, 0, '2025-10-14 15:31:32', 1, 'PF250331001', '100', '预制管片B', '管理员', '77F2C55702E54741A6F42A03675C35A8', '2025-10-14 15:33:04', '2025-10-14 15:33:04');\n" +
"INSERT INTO `wisdomsite`.`concrete_mix_station_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `pouring_part`, `power_level`, `actual_quantity`, `water_binder_ratio`, `discharge_time`, `use_status`, `construction_mix_ratio`, `stirring_time`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '拉林隧洞出口', '18', '预制管片B', 'C50W10F100B', 1.3, 0, '2025-10-14 15:26:03', 1, 'PF250331001', '100', '预制管片B', '管理员', '77F2C55702E54741A6F42A03675C35A8', '2025-10-14 15:27:39', '2025-10-14 15:27:39');\n" +
"INSERT INTO `wisdomsite`.`concrete_mix_station_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `pouring_part`, `power_level`, `actual_quantity`, `water_binder_ratio`, `discharge_time`, `use_status`, `construction_mix_ratio`, `stirring_time`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '拉林隧洞出口', '18', '预制管片B', 'C50W10F100B', 1.3, 0, '2025-10-14 15:18:30', 1, 'PF250331001', '100', '预制管片B', '管理员', '77F2C55702E54741A6F42A03675C35A8', '2025-10-14 15:20:03', '2025-10-14 15:20:03');\n" +
"INSERT INTO `wisdomsite`.`concrete_mix_station_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `pouring_part`, `power_level`, `actual_quantity`, `water_binder_ratio`, `discharge_time`, `use_status`, `construction_mix_ratio`, `stirring_time`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '拉林隧洞出口', '18', '预制管片B', 'C50W10F100B', 1.3, 0, '2025-10-14 15:04:51', 1, 'PF250331001', '100', '预制管片B', '管理员', '77F2C55702E54741A6F42A03675C35A8', '2025-10-14 15:06:27', '2025-10-14 15:06:27');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-10-14", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockDischargingPlatformCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`discharging_platform_current_data` (`id`, `dev_sn`, `project_sn`, `recive_time`, `loading`, `displacement`, `x_dip_angle`, `y_dip_angle`, `xiewen_id`, `mock_time`) VALUES (%s, 'AFC2F5C868A2474588D64F9C678F1042', '77F2C55702E54741A6F42A03675C35A8', '2024-07-30 13:49:25', '0.0', NULL, '0.0', '0.0', 40330, '2025-06-16 16:22:02');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-07-30", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,55 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockDustNoiseDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 80.00, 50.00, 68.20, 96.00, 23.60, 88.20, 0.80, '南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 75.00, 49.00, 65.10, 90.00, 23.60, 88.20, 0.90, '西南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 76.00, 50.00, 66.90, 92.00, 23.60, 88.40, 1.10, '西南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 74.00, 48.00, 66.70, 89.00, 23.60, 88.20, 1.30, '南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 73.00, 47.00, 66.10, 88.00, 23.60, 88.50, 1.60, '西南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);\n" +
"INSERT INTO `wisdomsite`.`dust_noise_data` (`id`, `project_sn`, `device_id`, `crc`, `upload_date`, `pm10`, `pm25`, `noise`, `tsp`, `temperature`, `humidity`, `windspeed`, `winddirection`, `pressure`, `voltage`, `plate_temperature`, `plate_humidity`, `xiewen_id`, `mock_time`, `evaporation_rate`) VALUES (%s, '77F2C55702E54741A6F42A03675C35A8', '20230811yc1', NULL, '%s', 76.00, 49.00, 64.30, 92.00, 23.60, 88.40, 1.00, '南风', 101.30, NULL, NULL, NULL, NULL, '%s', NULL);";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-07-10", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,52 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockElectricalDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`electrical_data` (`id`, `dev_sn`, `project_sn`, `upload_time`, `voltage_a`, `voltage_b`, `voltage_c`, `phase_current_a`, `phase_current_b`, `phase_current_c`, `electric_leakage`, `cable_temperature_a`, `cable_temperature_b`, `cable_temperature_c`, `ambient_temperature`, `xiewen_id`, `mock_time`) VALUES (%s, '20230811dx1', '77F2C55702E54741A6F42A03675C35A8', '2025-07-10 05:58:54', '225.1', '225.7', '224.1', '0.0', '0.0', '0.0', '0.0', '27.7', '27.9', '27.8', '27.9', NULL, '2025-07-10 05:58:55');\n" +
"INSERT INTO `wisdomsite`.`electrical_data` (`id`, `dev_sn`, `project_sn`, `upload_time`, `voltage_a`, `voltage_b`, `voltage_c`, `phase_current_a`, `phase_current_b`, `phase_current_c`, `electric_leakage`, `cable_temperature_a`, `cable_temperature_b`, `cable_temperature_c`, `ambient_temperature`, `xiewen_id`, `mock_time`) VALUES (%s, '20230811dx1', '77F2C55702E54741A6F42A03675C35A8', '2025-07-10 05:29:00', '224.7', '225.5', '223.9', '0.0', '0.0', '0.0', '0.0', '27.6', '27.6', '27.5', '27.6', NULL, '2025-07-10 05:29:00');\n" +
"INSERT INTO `wisdomsite`.`electrical_data` (`id`, `dev_sn`, `project_sn`, `upload_time`, `voltage_a`, `voltage_b`, `voltage_c`, `phase_current_a`, `phase_current_b`, `phase_current_c`, `electric_leakage`, `cable_temperature_a`, `cable_temperature_b`, `cable_temperature_c`, `ambient_temperature`, `xiewen_id`, `mock_time`) VALUES (%s, '20230811dx1', '77F2C55702E54741A6F42A03675C35A8', '2025-07-10 04:59:06', '225.4', '226.1', '224.2', '0.0', '0.0', '0.0', '0.0', '27.6', '27.6', '27.6', '27.6', NULL, '2025-07-10 04:59:07');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-07-10", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,54 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockGantryCraneCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`gantry_crane_current_data` (`id`, `dev_sn`, `project_sn`, `recive_time`, `run_time`, `wind_speed`, `wind_speed_state`, `angle_x_axis`, `angle_y_axis`, `large_crane_range`, `large_crane_speed`, `small_crane_range`, `small_crane_speed`, `second_small_crane_range`, `second_small_crane_speed`, `small_crane_main_hook_load`, `small_crane_main_hook_height`, `small_crane_auxiliary_hook_load`, `small_crane_auxiliary_hook_height`, `second_small_crane_main_hook_load`, `second_small_crane_main_hook_height`, `second_small_crane_auxiliary_hook_load`, `second_small_crane_auxiliary_hook_height`, `main_hook_current`, `main_hook_voltage`, `second_main_hook_current`, `second_main_hook_voltage`, `small_crane_range_state`, `second_small_crane_range_state`, `large_crane_distance_state`, `main_hook_weight_state`, `second_main_hook_weight_state`, `auxiliary_hook_weight_state`, `second_auxiliary_hook_weight_state`, `main_hook_height_state`, `second_main_hook_height_state`, `auxiliary_hook_height_state`, `second_auxiliary_hook_height_state`, `angle_x_state`, `angle_y_state`, `gated_state`, `anti_wind_and_nonslip_state`, `cable_reel_status`, `large_car_safe_status`, `large_car_run_status`, `small_car_run_status`, `second_small_car_run_status`, `master_hook_run_status`, `second_master_hook_run_status`, `sub_hook_run_status`, `second_sub_hook_run_status`, `driver_name`, `driver_id_card`, `total_day`, `total_times`, `power_on_day`, `power_on_times`, `operating_cycle_number`, `mock_time`) VALUES (%s, 'A2740F41305C419F8BFE9D50E365AB53', '77F2C55702E54741A6F42A03675C35A8', '2024-04-07 16:19:56', NULL, '2', 0, NULL, NULL, '0', '10', NULL, '10', NULL, '0', '0', 5.73000, NULL, NULL, '0', '0.0', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7.98', '191:31:04', '0.0', '0.0', 4606, '2025-06-16 16:23:31');\n" +
"INSERT INTO `wisdomsite`.`gantry_crane_current_data` (`id`, `dev_sn`, `project_sn`, `recive_time`, `run_time`, `wind_speed`, `wind_speed_state`, `angle_x_axis`, `angle_y_axis`, `large_crane_range`, `large_crane_speed`, `small_crane_range`, `small_crane_speed`, `second_small_crane_range`, `second_small_crane_speed`, `small_crane_main_hook_load`, `small_crane_main_hook_height`, `small_crane_auxiliary_hook_load`, `small_crane_auxiliary_hook_height`, `second_small_crane_main_hook_load`, `second_small_crane_main_hook_height`, `second_small_crane_auxiliary_hook_load`, `second_small_crane_auxiliary_hook_height`, `main_hook_current`, `main_hook_voltage`, `second_main_hook_current`, `second_main_hook_voltage`, `small_crane_range_state`, `second_small_crane_range_state`, `large_crane_distance_state`, `main_hook_weight_state`, `second_main_hook_weight_state`, `auxiliary_hook_weight_state`, `second_auxiliary_hook_weight_state`, `main_hook_height_state`, `second_main_hook_height_state`, `auxiliary_hook_height_state`, `second_auxiliary_hook_height_state`, `angle_x_state`, `angle_y_state`, `gated_state`, `anti_wind_and_nonslip_state`, `cable_reel_status`, `large_car_safe_status`, `large_car_run_status`, `small_car_run_status`, `second_small_car_run_status`, `master_hook_run_status`, `second_master_hook_run_status`, `sub_hook_run_status`, `second_sub_hook_run_status`, `driver_name`, `driver_id_card`, `total_day`, `total_times`, `power_on_day`, `power_on_times`, `operating_cycle_number`, `mock_time`) VALUES (%s, 'A2740F41305C419F8BFE9D50E365AB53', '77F2C55702E54741A6F42A03675C35A8', '2024-04-07 16:09:57', NULL, '1', 0, NULL, NULL, '0', '10', NULL, '10', NULL, '0', '0', 5.73000, NULL, NULL, '0', '0.0', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7.98', '191:30:07', '0.0', '0.0', 4606, '2025-06-16 16:23:31');\n" +
"INSERT INTO `wisdomsite`.`gantry_crane_current_data` (`id`, `dev_sn`, `project_sn`, `recive_time`, `run_time`, `wind_speed`, `wind_speed_state`, `angle_x_axis`, `angle_y_axis`, `large_crane_range`, `large_crane_speed`, `small_crane_range`, `small_crane_speed`, `second_small_crane_range`, `second_small_crane_speed`, `small_crane_main_hook_load`, `small_crane_main_hook_height`, `small_crane_auxiliary_hook_load`, `small_crane_auxiliary_hook_height`, `second_small_crane_main_hook_load`, `second_small_crane_main_hook_height`, `second_small_crane_auxiliary_hook_load`, `second_small_crane_auxiliary_hook_height`, `main_hook_current`, `main_hook_voltage`, `second_main_hook_current`, `second_main_hook_voltage`, `small_crane_range_state`, `second_small_crane_range_state`, `large_crane_distance_state`, `main_hook_weight_state`, `second_main_hook_weight_state`, `auxiliary_hook_weight_state`, `second_auxiliary_hook_weight_state`, `main_hook_height_state`, `second_main_hook_height_state`, `auxiliary_hook_height_state`, `second_auxiliary_hook_height_state`, `angle_x_state`, `angle_y_state`, `gated_state`, `anti_wind_and_nonslip_state`, `cable_reel_status`, `large_car_safe_status`, `large_car_run_status`, `small_car_run_status`, `second_small_car_run_status`, `master_hook_run_status`, `second_master_hook_run_status`, `sub_hook_run_status`, `second_sub_hook_run_status`, `driver_name`, `driver_id_card`, `total_day`, `total_times`, `power_on_day`, `power_on_times`, `operating_cycle_number`, `mock_time`) VALUES (%s, 'A2740F41305C419F8BFE9D50E365AB53', '77F2C55702E54741A6F42A03675C35A8', '2024-04-07 15:59:58', NULL, '3', 0, NULL, NULL, '0', '10', NULL, '10', NULL, '0', '0', 5.73000, NULL, NULL, '0', '0.0', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7.98', '191:29:06', '0.0', '0.0', 4606, '2025-06-16 16:23:31');\n" +
"INSERT INTO `wisdomsite`.`gantry_crane_current_data` (`id`, `dev_sn`, `project_sn`, `recive_time`, `run_time`, `wind_speed`, `wind_speed_state`, `angle_x_axis`, `angle_y_axis`, `large_crane_range`, `large_crane_speed`, `small_crane_range`, `small_crane_speed`, `second_small_crane_range`, `second_small_crane_speed`, `small_crane_main_hook_load`, `small_crane_main_hook_height`, `small_crane_auxiliary_hook_load`, `small_crane_auxiliary_hook_height`, `second_small_crane_main_hook_load`, `second_small_crane_main_hook_height`, `second_small_crane_auxiliary_hook_load`, `second_small_crane_auxiliary_hook_height`, `main_hook_current`, `main_hook_voltage`, `second_main_hook_current`, `second_main_hook_voltage`, `small_crane_range_state`, `second_small_crane_range_state`, `large_crane_distance_state`, `main_hook_weight_state`, `second_main_hook_weight_state`, `auxiliary_hook_weight_state`, `second_auxiliary_hook_weight_state`, `main_hook_height_state`, `second_main_hook_height_state`, `auxiliary_hook_height_state`, `second_auxiliary_hook_height_state`, `angle_x_state`, `angle_y_state`, `gated_state`, `anti_wind_and_nonslip_state`, `cable_reel_status`, `large_car_safe_status`, `large_car_run_status`, `small_car_run_status`, `second_small_car_run_status`, `master_hook_run_status`, `second_master_hook_run_status`, `sub_hook_run_status`, `second_sub_hook_run_status`, `driver_name`, `driver_id_card`, `total_day`, `total_times`, `power_on_day`, `power_on_times`, `operating_cycle_number`, `mock_time`) VALUES (%s, 'A2740F41305C419F8BFE9D50E365AB53', '77F2C55702E54741A6F42A03675C35A8', '2024-04-07 15:49:56', NULL, '1', 0, NULL, NULL, '0', '10', NULL, '10', NULL, '0', '0', 5.73000, NULL, NULL, '0', '0.0', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7.98', '191:28:04', '0.0', '0.0', 4606, '2025-06-16 16:23:31');\n" +
"INSERT INTO `wisdomsite`.`gantry_crane_current_data` (`id`, `dev_sn`, `project_sn`, `recive_time`, `run_time`, `wind_speed`, `wind_speed_state`, `angle_x_axis`, `angle_y_axis`, `large_crane_range`, `large_crane_speed`, `small_crane_range`, `small_crane_speed`, `second_small_crane_range`, `second_small_crane_speed`, `small_crane_main_hook_load`, `small_crane_main_hook_height`, `small_crane_auxiliary_hook_load`, `small_crane_auxiliary_hook_height`, `second_small_crane_main_hook_load`, `second_small_crane_main_hook_height`, `second_small_crane_auxiliary_hook_load`, `second_small_crane_auxiliary_hook_height`, `main_hook_current`, `main_hook_voltage`, `second_main_hook_current`, `second_main_hook_voltage`, `small_crane_range_state`, `second_small_crane_range_state`, `large_crane_distance_state`, `main_hook_weight_state`, `second_main_hook_weight_state`, `auxiliary_hook_weight_state`, `second_auxiliary_hook_weight_state`, `main_hook_height_state`, `second_main_hook_height_state`, `auxiliary_hook_height_state`, `second_auxiliary_hook_height_state`, `angle_x_state`, `angle_y_state`, `gated_state`, `anti_wind_and_nonslip_state`, `cable_reel_status`, `large_car_safe_status`, `large_car_run_status`, `small_car_run_status`, `second_small_car_run_status`, `master_hook_run_status`, `second_master_hook_run_status`, `sub_hook_run_status`, `second_sub_hook_run_status`, `driver_name`, `driver_id_card`, `total_day`, `total_times`, `power_on_day`, `power_on_times`, `operating_cycle_number`, `mock_time`) VALUES (%s, 'A2740F41305C419F8BFE9D50E365AB53', '77F2C55702E54741A6F42A03675C35A8', '2024-04-07 15:39:56', NULL, '0', 0, NULL, NULL, '0', '10', NULL, '10', NULL, '0', '0', 5.73000, NULL, NULL, '0', '0.0', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '7.98', '191:27:07', '0.0', '0.0', 4606, '2025-06-16 16:23:31');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-04-07", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,51 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockGantryCraneWorkCycleUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`gantry_crane_work_cycle` (`id`, `dev_sn`, `project_sn`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `master_hook_work_start_height`, `master_hook_work_end_height`, `master_hook_work_max_weight`, `master_hook_work_operation`, `sub_hook_work_start_height`, `sub_hook_work_end_height`, `sub_hook_work_max_weight`, `sub_hook_work_operation`, `second_master_hook_work_start_height`, `second_master_hook_work_end_height`, `second_master_hook_work_max_weight`, `second_master_hook_work_operation`, `second_sub_hook_work_start_height`, `second_sub_hook_work_end_height`, `second_sub_hook_work_max_weight`, `second_sub_hook_work_operation`, `large_car_work_start_range`, `large_car_work_end_range`, `large_car_work_max_speed`, `large_car_work_operation`, `small_car_work_start_range`, `small_car_work_end_range`, `small_car_work_max_speed`, `small_car_work_operation`, `second_small_car_work_start_range`, `second_small_car_work_end_range`, `second_small_car_work_max_speed`, `second_small_car_work_operation`, `work_type`, `max_dip_x`, `max_dip_y`, `max_wind_speed`, `master_hook_work_alarm`, `sub_hook_work_alarm`, `second_master_hook_work_alarm`, `second_sub_hook_work_alarm`, `large_car_speed_work_alarm`, `small_car_speed_work_alarm`, `second_small_car_speed_work_alarm`, `dip_x_work_alarm`, `dip_y_work_alarm`, `wind_speed_work_alarm`, `work_safe_status`) VALUES (%s, 'A2740F41305C419F8BFE9D50E365AB53', '77F2C55702E54741A6F42A03675C35A8', NULL, NULL, '3600', '2024-03-15 11:08:49', '司机', '520181200203204612', '2.3', '2.4', '2.1', NULL, '2.3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);\n" +
"INSERT INTO `wisdomsite`.`gantry_crane_work_cycle` (`id`, `dev_sn`, `project_sn`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `master_hook_work_start_height`, `master_hook_work_end_height`, `master_hook_work_max_weight`, `master_hook_work_operation`, `sub_hook_work_start_height`, `sub_hook_work_end_height`, `sub_hook_work_max_weight`, `sub_hook_work_operation`, `second_master_hook_work_start_height`, `second_master_hook_work_end_height`, `second_master_hook_work_max_weight`, `second_master_hook_work_operation`, `second_sub_hook_work_start_height`, `second_sub_hook_work_end_height`, `second_sub_hook_work_max_weight`, `second_sub_hook_work_operation`, `large_car_work_start_range`, `large_car_work_end_range`, `large_car_work_max_speed`, `large_car_work_operation`, `small_car_work_start_range`, `small_car_work_end_range`, `small_car_work_max_speed`, `small_car_work_operation`, `second_small_car_work_start_range`, `second_small_car_work_end_range`, `second_small_car_work_max_speed`, `second_small_car_work_operation`, `work_type`, `max_dip_x`, `max_dip_y`, `max_wind_speed`, `master_hook_work_alarm`, `sub_hook_work_alarm`, `second_master_hook_work_alarm`, `second_sub_hook_work_alarm`, `large_car_speed_work_alarm`, `small_car_speed_work_alarm`, `second_small_car_speed_work_alarm`, `dip_x_work_alarm`, `dip_y_work_alarm`, `wind_speed_work_alarm`, `work_safe_status`) VALUES (%s, 'A2740F41305C419F8BFE9D50E365AB53', '77F2C55702E54741A6F42A03675C35A8', NULL, NULL, '7200', '2024-03-15 11:09:27', '司机', '520181200203204612', '2.3', '2.4', '2.1', NULL, '2.3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-15", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockHangBasketDetectDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`hang_basket_detect_data` (`id`, `dev_name`, `dev_sn`, `hanging_basket_someone`, `wind_speed`, `bottom_film_height_left`, `bottom_film_height_right`, `bottom_film_height_difference`, `left_rear_beam_anchor`, `right_rear_beam_anchor`, `rear_beam_fixed_anchor1`, `rear_beam_fixed_anchor2`, `rear_beam_fixed_anchor3`, `rear_beam_fixed_anchor4`, `rear_beam_fixed_anchor5`, `rear_beam_fixed_anchor6`, `rear_beam_fixed_anchor7`, `rear_beam_fixed_anchor8`, `create_date`, `update_date`, `project_sn`, `inclination`, `mock_time`) VALUES (%s, '挂篮设备', '123', 2, 20, 30, 40, 50, 60, 70, 1, 4, 1, 4, 1, 3, 1, 3, '2024-03-25 20:01:30', '2024-03-25 20:01:30', '77F2C55702E54741A6F42A03675C35A8', 17, '2025-09-03 14:37:43');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,52 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
public class MockHighFormworkMeasureCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`high_formwork_measure_current_data` (`id`, `measure_point_number`, `project_sn`, `collect_time`, `electric_power`, `angle_x_axis`, `angle_y_axis`, `pressure`, `subside`, `alarm_state`, `pole_axial_force`, `horizontal_displacement`, `formwork_settlement`, `pole_tilt`, `foundation_settlement`, `acquisition_instrument_number`) VALUES (%s, '001', '77F2C55702E54741A6F42A03675C35A8', '2024-05-25 10:21:37', NULL, NULL, NULL, NULL, NULL, 1, '0', '0', '-5.00', '0.14', '0', '002');\n" +
"INSERT INTO `wisdomsite`.`high_formwork_measure_current_data` (`id`, `measure_point_number`, `project_sn`, `collect_time`, `electric_power`, `angle_x_axis`, `angle_y_axis`, `pressure`, `subside`, `alarm_state`, `pole_axial_force`, `horizontal_displacement`, `formwork_settlement`, `pole_tilt`, `foundation_settlement`, `acquisition_instrument_number`) VALUES (%s, '001', '77F2C55702E54741A6F42A03675C35A8', '2024-05-25 10:21:36', NULL, NULL, NULL, NULL, NULL, 1, '0.0', '0', '-2.32', '0.23', '0', '002');\n" +
"INSERT INTO `wisdomsite`.`high_formwork_measure_current_data` (`id`, `measure_point_number`, `project_sn`, `collect_time`, `electric_power`, `angle_x_axis`, `angle_y_axis`, `pressure`, `subside`, `alarm_state`, `pole_axial_force`, `horizontal_displacement`, `formwork_settlement`, `pole_tilt`, `foundation_settlement`, `acquisition_instrument_number`) VALUES (%s, '001', '77F2C55702E54741A6F42A03675C35A8', '2024-05-25 10:21:22', NULL, NULL, NULL, NULL, NULL, 1, '0', '0', '-5.00', '0.14', '0', '002');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-05-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,55 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockLifterAlarmUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`lifter_alarm` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `start_time`, `end_time`, `driver_name`, `driver_id_card`, `certification`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `people_cnt`, `status`, `correct_image`, `correct_remark`, `rectification_person_id`, `push_person_ids`, `correct_time`, `request_rectification_date`, `update_date`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:48', NULL, NULL, NULL, NULL, NULL, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-25 09:34:47', '2025-06-16 16:23:32');\n" +
"INSERT INTO `wisdomsite`.`lifter_alarm` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `start_time`, `end_time`, `driver_name`, `driver_id_card`, `certification`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `people_cnt`, `status`, `correct_image`, `correct_remark`, `rectification_person_id`, `push_person_ids`, `correct_time`, `request_rectification_date`, `update_date`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:37', NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-25 09:34:37', '2025-06-16 16:23:32');\n" +
"INSERT INTO `wisdomsite`.`lifter_alarm` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `start_time`, `end_time`, `driver_name`, `driver_id_card`, `certification`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `people_cnt`, `status`, `correct_image`, `correct_remark`, `rectification_person_id`, `push_person_ids`, `correct_time`, `request_rectification_date`, `update_date`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:33', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-25 09:34:32', '2025-06-16 16:23:32');\n" +
"INSERT INTO `wisdomsite`.`lifter_alarm` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `start_time`, `end_time`, `driver_name`, `driver_id_card`, `certification`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `people_cnt`, `status`, `correct_image`, `correct_remark`, `rectification_person_id`, `push_person_ids`, `correct_time`, `request_rectification_date`, `update_date`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:29', NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-25 09:34:28', '2025-06-16 16:23:32');\n" +
"INSERT INTO `wisdomsite`.`lifter_alarm` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `start_time`, `end_time`, `driver_name`, `driver_id_card`, `certification`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `people_cnt`, `status`, `correct_image`, `correct_remark`, `rectification_person_id`, `push_person_ids`, `correct_time`, `request_rectification_date`, `update_date`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:23', NULL, NULL, NULL, NULL, NULL, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-25 09:34:23', '2025-06-16 16:23:32');\n" +
"INSERT INTO `wisdomsite`.`lifter_alarm` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `start_time`, `end_time`, `driver_name`, `driver_id_card`, `certification`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `people_cnt`, `status`, `correct_image`, `correct_remark`, `rectification_person_id`, `push_person_ids`, `correct_time`, `request_rectification_date`, `update_date`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:17', NULL, NULL, NULL, NULL, NULL, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-25 09:34:17', '2025-06-16 16:23:32');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-04-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,58 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockLifterCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '29.18', NULL, NULL, '0', '2025-10-14 15:18:00', '21.38', '1', '0', '2025-10-14 15:18:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.01', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 15:18:00');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '25.55', NULL, NULL, '0', '2025-10-14 15:09:00', '29.63', '3', '0', '2025-10-14 15:09:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.02', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 15:09:00');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '19.71', NULL, NULL, '0', '2025-10-14 15:00:01', '54.8', '1', '0', '2025-10-14 15:00:01', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.48', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 15:00:01');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '36.31', NULL, NULL, '0', '2025-10-14 14:54:00', '52.16', '3', '0', '2025-10-14 14:54:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.16', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 14:54:00');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '19.18', NULL, NULL, '0', '2025-10-14 14:45:00', '10.84', '1', '0', '2025-10-14 14:45:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.38', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 14:45:00');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '9.33', NULL, NULL, '0', '2025-10-14 14:36:00', '54.47', '0', '0', '2025-10-14 14:36:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.8', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 14:36:00');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '12.58', NULL, NULL, '0', '2025-10-14 14:27:00', '9.32', '0', '0', '2025-10-14 14:27:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.92', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 14:27:00');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '16.72', NULL, NULL, '0', '2025-10-14 14:18:00', '23.23', '3', '0', '2025-10-14 14:18:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.14', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 14:18:00');\n" +
"INSERT INTO `wisdomsite`.`lifter_current_data` (`id`, `dev_sn`, `dev_name`, `project_sn`, `max_load`, `type`, `height`, `stop_height`, `stop_time`, `real_flag`, `start_time`, `loading`, `load_ratio`, `braking_distance`, `recive_time`, `running_state`, `is_online`, `driver_id_card`, `driver_licence`, `driver_name`, `height_ratio`, `bias_angle`, `bias_ratio`, `people_number`, `speed`, `floor_num`, `wind_speed`, `dip_angle_x`, `dip_angle_y`, `front_door_state`, `back_door_state`, `no_error`, `id_error`, `people_cnt_error`, `weight_error`, `speed_error`, `height_error`, `floor_error`, `obliguity_x_error`, `obliguity_y_error`, `wind_speed_error`, `gps_error`, `wireless_error`, `no_pre_alarm`, `weight_pre_alarm`, `speed_pre_alarm`, `height_pre_alarm`, `obliguity_x_pre_alarm`, `obliguity_y_pre_alarm`, `wind_speed_pre_alarm`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', NULL, '77F2C55702E54741A6F42A03675C35A8', '500', '0', '26.11', NULL, NULL, '0', '2025-10-14 14:09:00', '76.94', '3', '0', '2025-10-14 14:09:00', 1, 1, NULL, NULL, NULL, NULL, '0', NULL, NULL, '0.48', 0, '0', '0', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 14:09:00');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-10-14", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,54 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockLifterWorkCycleUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`lifter_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `loading`, `load_ratio`, `start_height`, `stop_height`, `running_state`, `max_speed`, `dip_angle_x`, `dip_angle_y`, `wind_speed`, `start_floor_num`, `end_floor_num`, `people_num`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', NULL, NULL, '9824', '2024-04-25 09:34:47', NULL, '520181200203204612', '5964', '15', 77.00, 96.00, 1, 77.00, '118', '59', 93.00, 31, 33, 4, NULL, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, '2025-06-16 16:23:44');\n" +
"INSERT INTO `wisdomsite`.`lifter_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `loading`, `load_ratio`, `start_height`, `stop_height`, `running_state`, `max_speed`, `dip_angle_x`, `dip_angle_y`, `wind_speed`, `start_floor_num`, `end_floor_num`, `people_num`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', NULL, NULL, '7158', '2024-04-25 09:34:37', NULL, '520181200203204612', '6226', '40', 70.00, 76.00, 2, 16.00, '356', '344', 62.00, 20, 17, 3, NULL, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, '2025-06-16 16:23:44');\n" +
"INSERT INTO `wisdomsite`.`lifter_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `loading`, `load_ratio`, `start_height`, `stop_height`, `running_state`, `max_speed`, `dip_angle_x`, `dip_angle_y`, `wind_speed`, `start_floor_num`, `end_floor_num`, `people_num`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', NULL, NULL, '4782', '2024-04-25 09:34:32', NULL, '520181200203204612', '6352', '29', 58.00, 51.00, 2, 30.00, '84', '56', 67.00, 42, 58, 3, NULL, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, '2025-06-16 16:23:44');\n" +
"INSERT INTO `wisdomsite`.`lifter_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `loading`, `load_ratio`, `start_height`, `stop_height`, `running_state`, `max_speed`, `dip_angle_x`, `dip_angle_y`, `wind_speed`, `start_floor_num`, `end_floor_num`, `people_num`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', NULL, NULL, '5253', '2024-04-25 09:34:29', NULL, '520181200203204612', '2747', '83', 66.00, 91.00, 1, 17.00, '105', '55', 36.00, 1, 40, 1, NULL, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, '2025-06-16 16:23:44');\n" +
"INSERT INTO `wisdomsite`.`lifter_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `loading`, `load_ratio`, `start_height`, `stop_height`, `running_state`, `max_speed`, `dip_angle_x`, `dip_angle_y`, `wind_speed`, `start_floor_num`, `end_floor_num`, `people_num`, `no_alarm`, `people_cnt_alarm`, `weight_alarm`, `speed_alarm`, `height_alarm`, `obliguity_x_alarm`, `obliguity_y_alarm`, `wind_speed_alarm`, `motor1_alarm`, `motor2_alarm`, `motor3_alarm`, `top_alarm`, `fall_alarm`, `bottom_alarm`, `mock_time`) VALUES (%s, 'A6A6E84EEBE447978135A2FF9C709605', '升降机1号', '77F2C55702E54741A6F42A03675C35A8', NULL, NULL, '5752', '2024-04-25 09:34:23', NULL, '520181200203204612', '3075', '17', 77.00, 84.00, 1, 66.00, '29', '98', 80.00, 27, 40, 7, NULL, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, '2025-06-16 16:23:44');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-04-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,108 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockMechanicalEquipmentPositionDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217095, 118.128211, '2024-03-30 17:36:27', 1.85, NULL, 100, 12, '2024-03-30 19:20:00', '2024-03-30 19:20:00', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128732.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217598, 118.127957, '2024-03-30 17:09:04', 0.27, NULL, 100, 12, '2024-03-30 19:20:00', '2024-03-30 19:20:00', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128732.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217598, 118.127967, '2024-03-30 17:08:59', 0.22, NULL, 100, 12, '2024-03-30 19:20:00', '2024-03-30 19:20:00', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128732.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217601, 118.127967, '2024-03-30 17:08:54', 0.36, NULL, 100, 12, '2024-03-30 19:20:00', '2024-03-30 19:20:00', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128731.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217601, 118.127977, '2024-03-30 17:08:39', 0.25, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128729.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217598, 118.127977, '2024-03-30 17:08:34', 0.29, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128728.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217584, 118.127977, '2024-03-30 17:08:19', 0.16, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128726.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217573, 118.127977, '2024-03-30 17:08:09', 0.39, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128723.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217575, 118.127967, '2024-03-30 17:08:04', 0.37, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128722.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217558, 118.127967, '2024-03-30 17:07:49', 0.43, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128720.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217552, 118.127957, '2024-03-30 17:07:44', 0.35, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128719.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217540, 118.127952, '2024-03-30 17:07:39', 0.56, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128717.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217527, 118.127937, '2024-03-30 17:07:29', 0.27, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128715.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217546, 118.127917, '2024-03-30 17:06:59', 0.24, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128708.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217552, 118.127907, '2024-03-30 17:06:49', 0.17, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128706.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217550, 118.127907, '2024-03-30 17:06:44', 0.16, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128706.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217540, 118.127917, '2024-03-30 17:06:39', 0.49, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128704.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217516, 118.127917, '2024-03-30 17:06:19', 0.18, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128700.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217526, 118.127917, '2024-03-30 17:06:09', 0.47, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128699.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217504, 118.127952, '2024-03-30 17:05:49', 0.39, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128694.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217500, 118.127967, '2024-03-30 17:05:44', 0.24, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128692.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217496, 118.127976, '2024-03-30 17:05:34', 0.20, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128691.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217500, 118.127982, '2024-03-30 17:05:24', 0.11, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128689.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217510, 118.127982, '2024-03-30 17:05:19', 0.07, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128689.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217548, 118.127982, '2024-03-30 17:05:04', 0.10, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128684.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217554, 118.127977, '2024-03-30 17:04:54', 0.33, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128683.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217504, 118.127996, '2024-03-30 17:04:44', 0.13, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128677.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217500, 118.127996, '2024-03-30 17:04:39', 0.16, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128675.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217356, 118.127837, '2024-03-30 16:07:38', 2.58, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128667.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217279, 118.127927, '2024-03-30 15:37:59', 3.61, NULL, 100, 12, '2024-03-30 19:20:01', '2024-03-30 19:20:01', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128667.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217518, 118.127996, '2024-03-30 13:31:16', 0.93, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128667.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217527, 118.127982, '2024-03-30 13:06:25', 0.73, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128666.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217536, 118.127986, '2024-03-30 13:06:20', 0.60, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128664.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217550, 118.127996, '2024-03-30 13:06:15', 0.98, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128662.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217561, 118.127982, '2024-03-30 13:06:10', 0.81, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128659.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217569, 118.127967, '2024-03-30 13:06:05', 1.44, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128655.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217573, 118.127952, '2024-03-30 13:06:00', 0.78, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128652.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217470, 118.127986, '2024-03-30 13:05:20', 1.23, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128640.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217466, 118.127996, '2024-03-30 13:05:15', 1.13, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128638.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217468, 118.127957, '2024-03-30 13:05:10', 1.08, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128634.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217472, 118.127957, '2024-03-30 13:05:05', 1.74, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128631.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217483, 118.127927, '2024-03-30 13:05:00', 0.21, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128628.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217487, 118.127937, '2024-03-30 13:04:55', 0.85, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128626.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217500, 118.127937, '2024-03-30 13:04:50', 0.35, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128625.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217506, 118.127937, '2024-03-30 13:04:45', 0.09, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128622.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217514, 118.127927, '2024-03-30 13:03:50', 0.23, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128613.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217514, 118.127937, '2024-03-30 13:03:40', 0.21, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128612.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217506, 118.127927, '2024-03-30 13:03:30', 0.66, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128609.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217506, 118.127947, '2024-03-30 13:03:25', 0.13, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128607.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217518, 118.127947, '2024-03-30 13:03:20', 0.90, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128605.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217527, 118.127947, '2024-03-30 13:03:15', 0.80, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128604.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217527, 118.127927, '2024-03-30 13:03:10', 0.58, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区徐市镇圳头村', NULL, 128602.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217535, 118.127907, '2024-03-30 13:03:05', 0.76, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128599.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217540, 118.127887, '2024-03-30 13:03:00', 0.16, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128596.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217542, 118.127857, '2024-03-30 13:02:55', 0.61, NULL, 100, 12, '2024-03-30 19:20:02', '2024-03-30 19:20:02', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128594.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217536, 118.127827, '2024-03-30 13:02:50', 0.81, NULL, 100, 12, '2024-03-30 19:20:03', '2024-03-30 19:20:03', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128590.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217514, 118.127817, '2024-03-30 13:02:45', 0.48, NULL, 100, 12, '2024-03-30 19:20:03', '2024-03-30 19:20:03', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128587.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217493, 118.127787, '2024-03-30 13:02:40', 0.47, NULL, 100, 12, '2024-03-30 19:20:03', '2024-03-30 19:20:03', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128583.00, '2025-06-16 16:29:13');\n" +
"INSERT INTO `wisdomsite`.`mechanical_equipment_position_data` (`id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `speed`, `work_status`, `equipment_power`, `equipment_voltage`, `create_time`, `update_time`, `project_sn`, `address`, `direction`, `mileage`, `mock_time`) VALUES (%s, 'Z37351952457', 27.217470, 118.127761, '2024-03-30 13:02:35', 1.04, NULL, 100, 12, '2024-03-30 19:20:03', '2024-03-30 19:20:03', '77F2C55702E54741A6F42A03675C35A8', '福建省南平市建阳区福建博朗建筑科技有限公司东(徐林线北)', NULL, 128579.00, '2025-06-16 16:29:13');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-30", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockPaveCompactionRecordUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`pave_compaction_record` (`id`, `dev_name`, `dev_sn`, `pave_speed`, `average_pave_temp`, `pave_degree`, `amplitude`, `frequency`, `geographical_longitude`, `geographical_latitude`, `pave_time`, `sensor1_pave_temp`, `sensor2_pave_temp`, `sensor3_pave_temp`, `sensor4_pave_temp`, `sensor5_pave_temp`, `sensor6_pave_temp`, `sensor7_pave_temp`, `sensor8_pave_temp`, `sensor9_pave_temp`, `sensor10_pave_temp`, `sensor1_pave_degree`, `sensor2_pave_degree`, `sensor3_pave_degree`, `sensor4_pave_degree`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '压实设备', '123', 1, 2, 3, 4, 5, 6, 7, '2024-03-25 14:18:47', 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 20:06:24', '2024-03-25 20:06:24');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockPaveRecordUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`pave_record` (`id`, `dev_name`, `dev_sn`, `pave_speed`, `average_pave_temp`, `average_pave_thickness`, `amplitude`, `frequency`, `geographical_longitude`, `geographical_latitude`, `pave_time`, `sensor1_pave_temp`, `sensor2_pave_temp`, `sensor3_pave_temp`, `sensor4_pave_temp`, `sensor5_pave_temp`, `sensor6_pave_temp`, `sensor7_pave_temp`, `sensor8_pave_temp`, `sensor9_pave_temp`, `sensor10_pave_temp`, `sensor1_pave_thickness`, `sensor2_pave_thickness`, `sensor3_pave_thickness`, `sensor4_pave_thickness`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '摊铺设备', '123', 1, 2, 3, 4, 5, 6, 7, '2024-03-25 14:15:24', 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 20:06:02', '2024-03-25 20:06:02');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockPitchMixStationProdDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`pitch_mix_station_prod_data` (`id`, `dev_sn`, `dev_name`, `task_number`, `project_name`, `proportion_name`, `plate_weight`, `whetstone_ratio`, `use_layer`, `discharge_time`, `use_status`, `construction_site`, `operator`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '沥青拌合站设备', '任务单号', '工程名称', '配比名称', 10, 20, '使用层', '2024-03-25 14:06:15', 5, '施工地点', '操作员', '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 17:10:46', '2024-03-25 17:10:46');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,53 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
public class MockPoisonousGasDevCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`poisonous_gas_dev_current_data` (`id`, `dev_sn`, `gas_type`, `project_sn`, `unit`, `create_date`, `update_date`, `upload_time`, `gas_val`, `mock_time`) VALUES (%s, 'fyykydqt001', 1, '77F2C55702E54741A6F42A03675C35A8', 2, '%s', '%s', '%s', 21.07000, '%s');";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
while (!currentDate.isAfter(endDate)) {
List<LocalDateTime> hoursInDay = MockUtil.get24HoursInDay(currentDate);
for (LocalDateTime dateTime : hoursInDay) {
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的唯一 ID
long newId = baseId + idCounter++;
String time = dateTime.format(formatter);
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId, time, time, time, time);
newSql = MockUtil.replaceDate(newSql, "2025-10-11", currentDate);
System.out.println(newSql);
}
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockPressureTestMachineManageUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`pressure_test_machine_manage` (`id`, `dev_sn`, `test_number`, `test_type`, `specimen_num`, `age`, `design_strength`, `intensity_representative_value`, `test_time`, `production_time`, `status`, `operator`, `equipment_strength`, `upload_attachment`, `specimen_size`, `specimen_age`, `specimen_area`, `nominal_diameter`, `create_date`, `update_date`, `project_sn`, `construction_part`) VALUES (%s, '123', '试验编号', 2, '试件数量', '18', '设计强度', 10, '2024-01-31 15:15:07', '2024-01-31 11:17:07', 1, '操作员', '设备强度', NULL, '试件尺寸', 20, 30, 40, '2024-01-31 20:02:30', '2024-01-31 20:02:30', '77F2C55702E54741A6F42A03675C35A8', '施工部位');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-01-31", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,72 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;
public class MockRainRecordUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 01:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 02:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 03:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 04:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 05:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 06:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 07:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 08:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 09:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 10:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 11:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 12:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 13:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 14:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 15:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 16:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 17:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 18:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 19:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 20:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 21:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 22:18:53');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`rain_record` (`id`, `wind_force`, `wind_speed`, `wind_direction`, `accumulated_rainfall`, `instantaneous_rainfall`, `current_rainfall`, `daily_rainfall`, `air_temperature`, `air_humidity`, `atmospheric_pressure`, `dev_sn`, `project_sn`, `create_date`, `update_date`, `record_time`) VALUES (%s, 1.00, 1.34, '东风', 1.00, 1.20, 1.10, 2.00, 27.00, 45.00, 101.33, '123', '77F2C55702E54741A6F42A03675C35A8', '2025-10-11 16:18:18.013', '2025-10-11 16:41:50.582', '2025-10-11 23:18:53');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-10-11", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,105 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockSafetyHatDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.69378, 91.15353, '2025-08-24 11:27:16', '2025-08-25 14:44:43', '2025-08-25 14:44:43', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:43');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.69420, 91.15375, '2025-08-24 11:26:56', '2025-08-25 14:44:42', '2025-08-25 14:44:42', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:42');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.69602, 91.15474, '2025-08-24 11:26:35', '2025-08-25 14:44:42', '2025-08-25 14:44:42', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:42');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.69799, 91.15621, '2025-08-24 11:26:15', '2025-08-25 14:44:42', '2025-08-25 14:44:42', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:42');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.69922, 91.15685, '2025-08-24 11:25:55', '2025-08-25 14:44:42', '2025-08-25 14:44:42', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:42');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.70035, 91.15729, '2025-08-24 11:25:35', '2025-08-25 14:44:41', '2025-08-25 14:44:41', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:41');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.70288, 91.15808, '2025-08-24 11:25:15', '2025-08-25 14:44:41', '2025-08-25 14:44:41', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:41');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.70502, 91.15960, '2025-08-24 11:24:55', '2025-08-25 14:44:41', '2025-08-25 14:44:41', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:41');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.70533, 91.16057, '2025-08-24 11:24:35', '2025-08-25 14:44:41', '2025-08-25 14:44:41', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 14:44:41');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.70628, 91.16349, '2025-08-24 11:24:15', '2025-08-25 09:22:44', '2025-08-25 09:22:44', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:22:44');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.70747, 91.16633, '2025-08-24 11:23:55', '2025-08-25 09:15:07', '2025-08-25 09:15:07', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:07');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.70877, 91.16865, '2025-08-24 11:23:35', '2025-08-25 09:15:07', '2025-08-25 09:15:07', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:07');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71014, 91.17117, '2025-08-24 11:23:15', '2025-08-25 09:15:07', '2025-08-25 09:15:07', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:07');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71107, 91.17321, '2025-08-24 11:22:55', '2025-08-25 09:15:07', '2025-08-25 09:15:07', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:07');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71104, 91.17495, '2025-08-24 11:22:35', '2025-08-25 09:15:06', '2025-08-25 09:15:06', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:06');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71129, 91.17549, '2025-08-24 11:22:14', '2025-08-25 09:15:06', '2025-08-25 09:15:06', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:06');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71228, 91.17508, '2025-08-24 11:21:54', '2025-08-25 09:15:06', '2025-08-25 09:15:06', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:06');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71306, 91.17439, '2025-08-24 11:21:34', '2025-08-25 09:15:06', '2025-08-25 09:15:06', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:06');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71268, 91.17378, '2025-08-24 11:20:34', '2025-08-25 09:15:05', '2025-08-25 09:15:05', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:05');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71242, 91.17379, '2025-08-24 11:19:54', '2025-08-25 09:15:05', '2025-08-25 09:15:05', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:05');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71222, 91.17389, '2025-08-24 11:12:53', '2025-08-25 09:15:05', '2025-08-25 09:15:05', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:05');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71242, 91.17374, '2025-08-24 11:09:52', '2025-08-25 09:15:05', '2025-08-25 09:15:05', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:05');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71263, 91.17370, '2025-08-24 11:05:12', '2025-08-25 09:15:04', '2025-08-25 09:15:04', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:04');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71285, 91.17375, '2025-08-24 10:59:31', '2025-08-25 09:15:04', '2025-08-25 09:15:04', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:04');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71291, 91.17409, '2025-08-24 10:59:11', '2025-08-25 09:15:04', '2025-08-25 09:15:04', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:04');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71358, 91.17462, '2025-08-24 10:58:51', '2025-08-25 09:15:04', '2025-08-25 09:15:04', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:04');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71427, 91.17444, '2025-08-24 10:58:11', '2025-08-25 09:15:04', '2025-08-25 09:15:04', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:04');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71450, 91.17447, '2025-08-24 10:57:51', '2025-08-25 09:15:03', '2025-08-25 09:15:03', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:03');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71471, 91.17456, '2025-08-24 10:56:51', '2025-08-25 09:15:03', '2025-08-25 09:15:03', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:03');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71500, 91.17481, '2025-08-24 10:56:10', '2025-08-25 09:15:03', '2025-08-25 09:15:03', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:03');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71520, 91.17470, '2025-08-24 10:49:06', '2025-08-25 09:15:02', '2025-08-25 09:15:02', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:02');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71412, 91.17470, '2025-08-24 10:48:46', '2025-08-25 09:15:02', '2025-08-25 09:15:02', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:02');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71297, 91.17449, '2025-08-24 10:47:26', '2025-08-25 09:15:02', '2025-08-25 09:15:02', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:02');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71189, 91.17389, '2025-08-24 10:47:06', '2025-08-25 09:15:02', '2025-08-25 09:15:02', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:02');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71296, 91.17386, '2025-08-24 10:46:46', '2025-08-25 09:15:01', '2025-08-25 09:15:01', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:01');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71465, 91.17436, '2025-08-24 10:46:26', '2025-08-25 09:15:01', '2025-08-25 09:15:01', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:01');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71374, 91.17473, '2025-08-24 10:45:45', '2025-08-25 09:15:01', '2025-08-25 09:15:01', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:01');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71132, 91.17594, '2025-08-24 10:45:25', '2025-08-25 09:15:01', '2025-08-25 09:15:01', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:01');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71171, 91.17592, '2025-08-24 10:45:05', '2025-08-25 09:15:00', '2025-08-25 09:15:00', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:00');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71233, 91.17572, '2025-08-24 10:44:45', '2025-08-25 09:15:00', '2025-08-25 09:15:00', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:00');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71309, 91.17547, '2025-08-24 10:44:25', '2025-08-25 09:15:00', '2025-08-25 09:15:00', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:15:00');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71280, 91.17555, '2025-08-24 10:43:45', '2025-08-25 09:14:59', '2025-08-25 09:14:59', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:59');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71316, 91.17538, '2025-08-24 10:43:25', '2025-08-25 09:14:59', '2025-08-25 09:14:59', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:59');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71463, 91.17490, '2025-08-24 10:43:05', '2025-08-25 09:14:59', '2025-08-25 09:14:59', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:59');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71353, 91.17532, '2025-08-24 10:42:45', '2025-08-25 09:14:59', '2025-08-25 09:14:59', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:59');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71274, 91.17562, '2025-08-24 10:42:25', '2025-08-25 09:14:59', '2025-08-25 09:14:59', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:59');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71229, 91.17581, '2025-08-24 10:42:05', '2025-08-25 09:14:58', '2025-08-25 09:14:58', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:58');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71207, 91.17589, '2025-08-24 10:41:44', '2025-08-25 09:14:58', '2025-08-25 09:14:58', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:58');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71228, 91.17595, '2025-08-24 10:41:04', '2025-08-25 09:14:58', '2025-08-25 09:14:58', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:58');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71385, 91.17503, '2025-08-24 10:40:44', '2025-08-25 09:14:58', '2025-08-25 09:14:58', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:58');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71481, 91.17444, '2025-08-24 10:40:04', '2025-08-25 09:14:57', '2025-08-25 09:14:57', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:57');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71447, 91.17443, '2025-08-24 10:39:04', '2025-08-25 09:14:57', '2025-08-25 09:14:57', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:57');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71424, 91.17440, '2025-08-24 10:38:44', '2025-08-25 09:14:57', '2025-08-25 09:14:57', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:57');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71403, 91.17443, '2025-08-24 10:38:04', '2025-08-25 09:14:57', '2025-08-25 09:14:57', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:57');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71440, 91.17440, '2025-08-24 10:36:43', '2025-08-25 09:14:57', '2025-08-25 09:14:57', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:57');\n" +
"INSERT INTO `wisdomsite`.`safety_hat_data` (`id`, `worker_info_id`, `dev_sn`, `latitude`, `longitude`, `upload_time`, `create_time`, `update_time`, `project_sn`, `is_platform_data`, `type`, `worker_info_name`, `mock_time`) VALUES (%s, 1801536983378595842, '866652021945119', 29.71419, 91.17410, '2025-08-24 10:36:03', '2025-08-25 09:14:56', '2025-08-25 09:14:56', '77F2C55702E54741A6F42A03675C35A8', 1, 1, '', '2025-08-25 09:14:56');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-08-24", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,105 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockSafetyHatDataVehiclePositionDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.15353, 29.69378, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:27', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.15375, 29.6942, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:26', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.15474, 29.69602, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:26', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.15621, 29.69799, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:26', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.15685, 29.69922, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:25', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.15729, 29.70035, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:25', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.15808, 29.70288, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:25', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1596, 29.70502, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:24', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.16057, 29.70533, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:24', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.16349, 29.70628, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:24', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.16633, 29.70747, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:23', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.16865, 29.70877, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:23', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17117, 29.71014, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:23', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17321, 29.71107, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:22', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17495, 29.71104, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:22', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17549, 29.71129, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:22', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17508, 29.71228, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:21', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17439, 29.71306, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:21', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17378, 29.71268, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:20', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17379, 29.71242, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:19', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17389, 29.71222, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:12', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17374, 29.71242, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:09', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1737, 29.71263, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 11:05', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17375, 29.71285, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:59', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17409, 29.71291, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:59', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17462, 29.71358, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:58', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17444, 29.71427, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:58', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17447, 29.7145, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:57', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17456, 29.71471, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:56', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17481, 29.715, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:56', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1747, 29.7152, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:49', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1747, 29.71412, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:48', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17449, 29.71297, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:47', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17389, 29.71189, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:47', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17386, 29.71296, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:46', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17436, 29.71465, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:46', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17473, 29.71374, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:45', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17594, 29.71132, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:45', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17592, 29.71171, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:45', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17572, 29.71233, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:44', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17547, 29.71309, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:44', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17555, 29.7128, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:43', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17538, 29.71316, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:43', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1749, 29.71463, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:43', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17532, 29.71353, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:42', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17562, 29.71274, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:42', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17581, 29.71229, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:42', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17589, 29.71207, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:41', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17595, 29.71228, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:41', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17503, 29.71385, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:40', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17444, 29.71481, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:40', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17443, 29.71447, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:39', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1744, 29.71424, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:38', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.17443, 29.71403, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:38', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1744, 29.7144, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:36', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`vehicle_position_data` (`id`, `dev_sn`, `battery_percentage`, `total_fuel_consumption_day`, `total_sleep_time_day`, `cumulative_operating_fuel_consumption_day`, `total_work_time_day`, `longitude`, `latitude`, `project_sn`, `create_time`, `update_time`, `speed`, `mileage`, `mock_time`) VALUES (%s, '123456', 0, 0, 0, 0, 0, 91.1741, 29.71419, '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 10:36', '2024-03-25 15:18:28', 3, NULL, '2024-03-25 14:38:56');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockSmartGroutDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`smart_grout_data` (`id`, `dev_sn`, `beam_number`, `beam_type`, `construction_part`, `concrete_design_strength`, `equipment_manufacturer`, `tension_grout_time`, `status`, `create_date`, `update_date`, `project_sn`) VALUES (%s, '123', '梁号', '梁型', '施工部位', '砼设计强度', '设备厂家', '2024-03-25 11:23:50', 1, '2024-03-25 17:27:54', '2024-03-25 17:27:54', '77F2C55702E54741A6F42A03675C35A8');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockSmartTensionDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`smart_tension_data` (`id`, `dev_sn`, `beam_number`, `beam_type`, `concrete_design_strength`, `equipment_manufacturer`, `construction_part`, `anchor_sheet_thickness`, `tension_time`, `status`, `create_date`, `update_date`, `project_sn`) VALUES (%s, '123', '梁号', '梁型1', '砼设计强度', '设备厂家', '施工部位', '锚片厚度', '2024-03-25 16:23:50', 2, '2024-03-25 17:15:09', '2024-03-25 17:15:09', '77F2C55702E54741A6F42A03675C35A8');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockStableWaterMixStationDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`stable_water_mix_station_data` (`id`, `dev_sn`, `rwbh`, `qddj`, `pbbh`, `tld`, `kddj`, `ksdj`, `kzdj`, `sj`, `clmc`, `clbm`, `cldsfid`, `clggxh`, `jldw`, `sldw`, `gcmc`, `sybw`, `glzdlj`, `cph`, `jzbh`, `czy`, `tbbm`, `scsl`, `timestamp`, `source`, `scbz`, `scsj`, `bwsfid`, `project_sn`, `create_date`, `update_date`) VALUES (%s, '123', '任务编号', '强度等级', '配比编号', '塌落度', '抗冻等级', '抗渗等级', '抗折等级', '司机', '材料名称', '材料编码', '材料第三方ID', '材料规格型号', '计量单位', '收料单位', '工程名称', '使用部位', '骨粒最大粒径', '车牌号', '机组编号', '操作员', '同步编码', 1, '2024-03-25 10:53:12.321', '单据来源', 'Y', '2024-03-25 10:53:12.321', '部位三方id', '77F2C55702E54741A6F42A03675C35A8', '2024-03-25 17:13:34', '2024-03-25 17:13:34');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-03-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,53 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockStandardCurrentDataUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`standard_current_data` (`id`, `dev_sn`, `project_sn`, `receive_time`, `temperature`, `humidity`, `auxiliary_heat`, `temperature_control`, `humidification`, `fan`, `arefaction`, `run_state`, `mock_time`) VALUES (%s, 'A8EBAE0E709C4033BF80076D915AFEDA', '77F2C55702E54741A6F42A03675C35A8', '2024-08-31 01:34:00', '26.10', '98.30', 1, 1, 1, 1, 1, 1, '2024-08-31 16:30:10');\n" +
"INSERT INTO `wisdomsite`.`standard_current_data` (`id`, `dev_sn`, `project_sn`, `receive_time`, `temperature`, `humidity`, `auxiliary_heat`, `temperature_control`, `humidification`, `fan`, `arefaction`, `run_state`, `mock_time`) VALUES (%s, 'A8EBAE0E709C4033BF80076D915AFEDA', '77F2C55702E54741A6F42A03675C35A8', '2024-08-31 01:32:00', '26.20', '98.30', 1, 1, 1, 1, 1, 1, '2024-08-31 16:30:10');\n" +
"INSERT INTO `wisdomsite`.`standard_current_data` (`id`, `dev_sn`, `project_sn`, `receive_time`, `temperature`, `humidity`, `auxiliary_heat`, `temperature_control`, `humidification`, `fan`, `arefaction`, `run_state`, `mock_time`) VALUES (%s, 'A8EBAE0E709C4033BF80076D915AFEDA', '77F2C55702E54741A6F42A03675C35A8', '2024-08-31 01:08:00', '26.30', '98.30', 1, 1, 1, 1, 1, 1, '2024-08-31 16:30:10');\n" +
"INSERT INTO `wisdomsite`.`standard_current_data` (`id`, `dev_sn`, `project_sn`, `receive_time`, `temperature`, `humidity`, `auxiliary_heat`, `temperature_control`, `humidification`, `fan`, `arefaction`, `run_state`, `mock_time`) VALUES (%s, 'A8EBAE0E709C4033BF80076D915AFEDA', '77F2C55702E54741A6F42A03675C35A8', '2024-08-31 01:06:00', '26.30', '98.30', 1, 1, 1, 1, 1, 1, '2024-08-31 16:30:10');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-08-31", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,50 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockTowerAlarmUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`tower_alarm` (`id`, `dev_sn`, `dev_name`, `project_sn`, `alarm_type`, `tower_currentdata_id`, `add_time`, `start_time`, `end_time`, `driver_name`, `driver_id_card`, `certification`, `moment_alarm`, `wind_speed_alarm`, `height_alarm`, `height_lower_alarm`, `min_range_alarm`, `max_range_alarm`, `pos_angle_alarm`, `neg_angle_alarm`, `obliguity_alarm`, `environment_alarm`, `multi_alarm`, `standard_high_alarm`, `standard_high_alarm_dev`, `status`, `correct_image`, `correct_remark`, `rectification_person_id`, `push_person_ids`, `correct_time`, `request_rectification_date`, `update_date`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', 1, NULL, '2025-03-31 15:35:05', '2025-03-31 15:34:06', '2025-03-31 15:35:03', '管理员', NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2025-03-31 15:35:04', '2025-06-16 16:30:12');";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-03-31", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,54 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockTowerViolationUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`tower_violation` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `violation_time`, `moment_violation`, `wind_speed_violation`, `collision_violation`, `ban_region_violation`, `person_violation`, `hook_violation`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:51', '2024-04-25 09:34:49 ', 1, 0, 1, 0, 0, 1, '2025-06-16 16:41:16');\n" +
"INSERT INTO `wisdomsite`.`tower_violation` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `violation_time`, `moment_violation`, `wind_speed_violation`, `collision_violation`, `ban_region_violation`, `person_violation`, `hook_violation`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:43', '2024-04-25 09:34:42 ', 1, 1, 1, 0, 0, 0, '2025-06-16 16:41:16');\n" +
"INSERT INTO `wisdomsite`.`tower_violation` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `violation_time`, `moment_violation`, `wind_speed_violation`, `collision_violation`, `ban_region_violation`, `person_violation`, `hook_violation`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:40', '2024-04-25 09:34:39 ', 0, 1, 0, 1, 0, 0, '2025-06-16 16:41:16');\n" +
"INSERT INTO `wisdomsite`.`tower_violation` (`id`, `dev_sn`, `dev_name`, `project_sn`, `add_time`, `violation_time`, `moment_violation`, `wind_speed_violation`, `collision_violation`, `ban_region_violation`, `person_violation`, `hook_violation`, `mock_time`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', '2024-04-25 09:34:31', '2024-04-25 09:34:30 ', 1, 1, 1, 1, 0, 0, '2025-06-16 16:41:16');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2024-04-25", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,54 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockTowerWorkCycleUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite`.`tower_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `work_multiple`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `sling_start_height`, `sling_end_height`, `sling_start_range`, `sling_end_range`, `sling_start_rotation`, `sling_end_rotation`, `peak_load`, `loading`, `work_max_force`, `work_max_torque`, `work_max_torque_range`, `max_angle`, `min_angle`, `max_range`, `min_range`, `max_height`, `min_height`, `max_wind_speed`, `work_max_range_alarm`, `work_min_range_alarm`, `work_height_alarm`, `work_height_lower_alarm`, `work_pos_angle_alarm`, `work_neg_angle_alarm`, `work_moment_alarm`, `work_obliguity_alarm`, `work_environment_alarm`, `work_multi_alarm`, `work_moment_pre_alarm`, `work_wind_speed_alarm`, `mock_time`, `xiao_sa_id`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', NULL, '2025-10-14 13:54:08', '2025-10-14 13:56:34', '146', '2025-10-14 13:59:13', NULL, NULL, '-5', '27', '27', '27', '163', '163', NULL, '1147', '-251', NULL, NULL, NULL, NULL, '31', '23', '27', '-6', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 13:59:13', NULL);\n" +
"INSERT INTO `wisdomsite`.`tower_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `work_multiple`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `sling_start_height`, `sling_end_height`, `sling_start_range`, `sling_end_range`, `sling_start_rotation`, `sling_end_rotation`, `peak_load`, `loading`, `work_max_force`, `work_max_torque`, `work_max_torque_range`, `max_angle`, `min_angle`, `max_range`, `min_range`, `max_height`, `min_height`, `max_wind_speed`, `work_max_range_alarm`, `work_min_range_alarm`, `work_height_alarm`, `work_height_lower_alarm`, `work_pos_angle_alarm`, `work_neg_angle_alarm`, `work_moment_alarm`, `work_obliguity_alarm`, `work_environment_alarm`, `work_multi_alarm`, `work_moment_pre_alarm`, `work_wind_speed_alarm`, `mock_time`, `xiao_sa_id`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', NULL, '2025-10-14 13:50:48', '2025-10-14 13:52:25', '97', '2025-10-14 13:52:45', NULL, NULL, '-5', '45', '26', '45', '163', '163', NULL, '1261', '2934', NULL, NULL, NULL, NULL, '46', '23', '26', '-5', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 13:52:44', NULL);\n" +
"INSERT INTO `wisdomsite`.`tower_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `work_multiple`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `sling_start_height`, `sling_end_height`, `sling_start_range`, `sling_end_range`, `sling_start_rotation`, `sling_end_rotation`, `peak_load`, `loading`, `work_max_force`, `work_max_torque`, `work_max_torque_range`, `max_angle`, `min_angle`, `max_range`, `min_range`, `max_height`, `min_height`, `max_wind_speed`, `work_max_range_alarm`, `work_min_range_alarm`, `work_height_alarm`, `work_height_lower_alarm`, `work_pos_angle_alarm`, `work_neg_angle_alarm`, `work_moment_alarm`, `work_obliguity_alarm`, `work_environment_alarm`, `work_multi_alarm`, `work_moment_pre_alarm`, `work_wind_speed_alarm`, `mock_time`, `xiao_sa_id`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', NULL, '2025-10-14 13:38:15', '2025-10-14 13:40:08', '113', '2025-10-14 13:43:09', NULL, NULL, '5', '24', '38', '24', '163', '163', NULL, '650', '-1881', NULL, NULL, NULL, NULL, '59', '24', '25', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 13:43:09', NULL);\n" +
"INSERT INTO `wisdomsite`.`tower_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `work_multiple`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `sling_start_height`, `sling_end_height`, `sling_start_range`, `sling_end_range`, `sling_start_rotation`, `sling_end_rotation`, `peak_load`, `loading`, `work_max_force`, `work_max_torque`, `work_max_torque_range`, `max_angle`, `min_angle`, `max_range`, `min_range`, `max_height`, `min_height`, `max_wind_speed`, `work_max_range_alarm`, `work_min_range_alarm`, `work_height_alarm`, `work_height_lower_alarm`, `work_pos_angle_alarm`, `work_neg_angle_alarm`, `work_moment_alarm`, `work_obliguity_alarm`, `work_environment_alarm`, `work_multi_alarm`, `work_moment_pre_alarm`, `work_wind_speed_alarm`, `mock_time`, `xiao_sa_id`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', NULL, '2025-10-14 13:23:51', '2025-10-14 13:24:59', '68', '2025-10-14 13:30:14', NULL, NULL, '-6', '12', '32', '12', '163', '163', NULL, '780', '-3269', NULL, NULL, NULL, NULL, '32', '10', '16', '-6', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 13:30:13', NULL);\n" +
"INSERT INTO `wisdomsite`.`tower_work_cycle` (`id`, `dev_sn`, `dev_name`, `project_sn`, `work_multiple`, `start_time`, `end_time`, `work_time`, `add_time`, `driver_name`, `driver_id_card`, `sling_start_height`, `sling_end_height`, `sling_start_range`, `sling_end_range`, `sling_start_rotation`, `sling_end_rotation`, `peak_load`, `loading`, `work_max_force`, `work_max_torque`, `work_max_torque_range`, `max_angle`, `min_angle`, `max_range`, `min_range`, `max_height`, `min_height`, `max_wind_speed`, `work_max_range_alarm`, `work_min_range_alarm`, `work_height_alarm`, `work_height_lower_alarm`, `work_pos_angle_alarm`, `work_neg_angle_alarm`, `work_moment_alarm`, `work_obliguity_alarm`, `work_environment_alarm`, `work_multi_alarm`, `work_moment_pre_alarm`, `work_wind_speed_alarm`, `mock_time`, `xiao_sa_id`) VALUES (%s, '7FA387A3C5984756BB23F4800D89D9EF', '塔吊1', '77F2C55702E54741A6F42A03675C35A8', NULL, '2025-10-14 13:18:21', '2025-10-14 13:23:15', '294', '2025-10-14 13:24:46', NULL, NULL, '-6', '36', '27', '36', '163', '163', NULL, '1179', '-1211', NULL, NULL, NULL, NULL, '42', '23', '25', '-10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-14 13:24:45', NULL);\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-10-14", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,52 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockWeighInfoUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`weigh_info` (`id`, `serial_no`, `license_plate`, `forwarding_unit`, `receiving_unit`, `goods_name`, `specifications`, `reserve`, `tare`, `gross_weight`, `net_weight`, `gross_time`, `tare_time`, `a_check_time`, `b_check_time`, `project_sn`, `remove_weighdata_info_id`) VALUES (%s, '%s', '冀F0B5K1', '发货单位', '收货单位', '货物1', '规格1', '备注', 300.00, 240.00, 270.00, '2023-08-11 10:56:29', '2023-08-11 12:56:29', '2023-08-11 20:56:29', '2023-08-11 20:56:29', '77F2C55702E54741A6F42A03675C35A8', '%s');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`weigh_info` (`id`, `serial_no`, `license_plate`, `forwarding_unit`, `receiving_unit`, `goods_name`, `specifications`, `reserve`, `tare`, `gross_weight`, `net_weight`, `gross_time`, `tare_time`, `a_check_time`, `b_check_time`, `project_sn`, `remove_weighdata_info_id`) VALUES (%s, '%s', '皖A65681', '钢筋发货单位', '石方收货单位', '钢筋', 'HPB235', '备注', 300.00, 100.00, 270.00, '2023-08-11 13:56:29', '2023-08-11 13:56:29', '2023-08-11 08:56:29', '2023-08-11 09:56:29', '77F2C55702E54741A6F42A03675C35A8', '%s');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`weigh_info` (`id`, `serial_no`, `license_plate`, `forwarding_unit`, `receiving_unit`, `goods_name`, `specifications`, `reserve`, `tare`, `gross_weight`, `net_weight`, `gross_time`, `tare_time`, `a_check_time`, `b_check_time`, `project_sn`, `remove_weighdata_info_id`) VALUES (%s, '%s', '皖A65681', '钢筋发货单位', '石方收货单位', '钢筋', 'HPB235', '备注', 300.00, 100.00, 270.00, '2023-08-11 13:56:29', '2023-08-11 13:56:29', '2023-08-11 08:56:29', '2023-08-11 09:56:29', '77F2C55702E54741A6F42A03675C35A8', '%s');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId,newId,newId);
newSql = MockUtil.replaceDate(newSql, "2023-08-11", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}

View File

@ -0,0 +1,55 @@
package com.zhgd.xmgl.util.mock.replaceDate;
import cn.hutool.core.util.StrUtil;
import com.zhgd.xmgl.util.mock.randomDateTimeInDay.MockUtil;
import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;
public class MockWorkerAttendanceUtil {
public static void main(String[] args) {
// 注意将原始语句中的 IDcreate_timeupdate_date 替换为 %s 占位符
// 替换顺序 %s (ID), %s (create_time), %s (update_date)
String copySql = "INSERT INTO `wisdomsite_yanshi_new`.`worker_attendance` (`id`, `person_sn`, `pass_type`, `create_time`, `project_sn`, `dev_sn`, `card_type`, `image_url`, `attendance_type`, `passageway_name`, `attendance_status`, `temperature`, `is_statistics`, `car_number`, `health_code`, `nucleic_acid_time`, `nucleic_acid_result`, `vaccinate_time`, `vaccinate_state`, `reissue_card_reason`, `address`, `is_mock`, `mock_time`) VALUES (%s, 'CFEFB6F766AC44D2A32CE6333EA02F34', 1, '2025-09-12 08:58:58', '77F2C55702E54741A6F42A03675C35A8', 'fyykrl001', 2, '68ec757cfbbb5030dcca6648.jpg', 1, '人脸设别', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-13 11:50:10');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`worker_attendance` (`id`, `person_sn`, `pass_type`, `create_time`, `project_sn`, `dev_sn`, `card_type`, `image_url`, `attendance_type`, `passageway_name`, `attendance_status`, `temperature`, `is_statistics`, `car_number`, `health_code`, `nucleic_acid_time`, `nucleic_acid_result`, `vaccinate_time`, `vaccinate_state`, `reissue_card_reason`, `address`, `is_mock`, `mock_time`) VALUES (%s, 'CFEFB6F766AC44D2A32CE6333EA02F34', 2, '2025-09-12 17:58:58', '77F2C55702E54741A6F42A03675C35A8', 'fyykrl001', 2, '68ec757cfbbb5030dcca6648.jpg', 1, '人脸设别', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-13 11:50:58');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`worker_attendance` (`id`, `person_sn`, `pass_type`, `create_time`, `project_sn`, `dev_sn`, `card_type`, `image_url`, `attendance_type`, `passageway_name`, `attendance_status`, `temperature`, `is_statistics`, `car_number`, `health_code`, `nucleic_acid_time`, `nucleic_acid_result`, `vaccinate_time`, `vaccinate_state`, `reissue_card_reason`, `address`, `is_mock`, `mock_time`) VALUES (%s, '1F0D5D3FB2924D2DA40DCB0BCBF9201C', 1, '2025-09-12 07:01:58', '77F2C55702E54741A6F42A03675C35A8', 'fyykrl001', 2, 'a4d3662e-3ad5-4155-9eaf-c39162ef9e0b.jpg', 1, '人脸设别', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-13 11:52:23');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`worker_attendance` (`id`, `person_sn`, `pass_type`, `create_time`, `project_sn`, `dev_sn`, `card_type`, `image_url`, `attendance_type`, `passageway_name`, `attendance_status`, `temperature`, `is_statistics`, `car_number`, `health_code`, `nucleic_acid_time`, `nucleic_acid_result`, `vaccinate_time`, `vaccinate_state`, `reissue_card_reason`, `address`, `is_mock`, `mock_time`) VALUES (%s, '1F0D5D3FB2924D2DA40DCB0BCBF9201C', 2, '2025-09-12 19:01:58', '77F2C55702E54741A6F42A03675C35A8', 'fyykrl001', 2, 'a4d3662e-3ad5-4155-9eaf-c39162ef9e0b.jpg', 1, '人脸设别', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-13 11:52:30');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`worker_attendance` (`id`, `person_sn`, `pass_type`, `create_time`, `project_sn`, `dev_sn`, `card_type`, `image_url`, `attendance_type`, `passageway_name`, `attendance_status`, `temperature`, `is_statistics`, `car_number`, `health_code`, `nucleic_acid_time`, `nucleic_acid_result`, `vaccinate_time`, `vaccinate_state`, `reissue_card_reason`, `address`, `is_mock`, `mock_time`) VALUES (%s, '83C2F764B62E4CB9BE2A07D44C397D63', 2, '2025-09-12 22:01:58', '77F2C55702E54741A6F42A03675C35A8', 'fyykrl001', 2, '68ec758dfbbb5030dcca664a.jpg', 1, '人脸设别', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-13 11:53:01');\n" +
"INSERT INTO `wisdomsite_yanshi_new`.`worker_attendance` (`id`, `person_sn`, `pass_type`, `create_time`, `project_sn`, `dev_sn`, `card_type`, `image_url`, `attendance_type`, `passageway_name`, `attendance_status`, `temperature`, `is_statistics`, `car_number`, `health_code`, `nucleic_acid_time`, `nucleic_acid_result`, `vaccinate_time`, `vaccinate_state`, `reissue_card_reason`, `address`, `is_mock`, `mock_time`) VALUES (%s, '83C2F764B62E4CB9BE2A07D44C397D63', 1, '2025-09-12 06:01:58', '77F2C55702E54741A6F42A03675C35A8', 'fyykrl001', 2, '68ec758dfbbb5030dcca664a.jpg', 1, '人脸设别', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-10-13 11:53:09');\n";
copySql = StrUtil.replace(copySql, "`wisdomsite`.", "");
List<String> sqlTemplates = StrUtil.split(copySql, ";\n").stream().map(s -> s + ";").collect(Collectors.toList());
// 2. 定义日期范围和时间部分
LocalDate startDate = LocalDate.of(2025, 10, 1);
LocalDate endDate = LocalDate.of(2025, 10, 31);
// 用于生成唯一 ID 的起始值确保它足够大避免与现有数据冲突
// 我们将从一个较大的基数开始并为每天的每条记录递增
long baseId = System.currentTimeMillis();
long idCounter = 0;
// 3. 循环日期
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
// 4. 循环 6 条模板语句
for (int i = 0; i < sqlTemplates.size(); i++) {
String template = sqlTemplates.get(i);
// 构造新的日期时间
// 构造新的唯一 ID
long newId = baseId + idCounter++;
// 格式化并输出 SQL 语句
String newSql = String.format(template, newId);
newSql = MockUtil.replaceDate(newSql, "2025-09-12", currentDate);
System.out.println(newSql);
}
// 移动到下一天
currentDate = currentDate.plusDays(1);
}
System.out.println("\n--- 共生成 " + idCounter + " 条 SQL 记录 ---");
}
}