Files
xj-platform/db/done/20251127-3-xj-emergency迁移qed数据.sql
lianlonggang f74a2322e4 chore(db): 将已执行完成的 SQL 脚本从 updatesql 迁移至 done 目录
将历史已执行完毕的 SQL 更新脚本统一归档至 db/done/ 目录,
便于区分待执行脚本与已完成脚本。
2026-09-03 10:43:23 +08:00

51 lines
979 B
Java

INSERT INTO aed_equipment_manger (
id,
name,
longitude,
latitude,
depart_code,
del_flag,
create_by,
create_time,
update_by,
update_time,
charge_first,
charge_first_mobile,
manage_depart_code,
manage_user_name,
manage_user_mobile,
publish_flag
)
SELECT
id,
name,
CAST(longitude AS DECIMAL(10,6)),
CAST(latitude AS DECIMAL(10,6)),
org_code,
del_flag,
create_by,
create_time,
update_by,
update_time,
manage_name,
manage_phone,
org_code,
manage_name,
manage_phone,
1
FROM xj_aed
WHERE del_flag = 0;
INSERT INTO aed_location_equipment (id, equipment_id, address, longitude, latitude)
SELECT
UUID_SHORT(),
aem.id,
xa.address,
CAST(xa.longitude AS DECIMAL(10,6)),
CAST(xa.latitude AS DECIMAL(10,6))
FROM xj_aed xa
JOIN aed_equipment_manger aem
ON xa.id = aem.id
WHERE xa.address IS NOT NULL AND xa.address <> '';