临时数据表

hq_property_building表:

insert INTO hq_property_building SELECT t.building_id,CONCAT("00",t.building_name),"073b4161fe4047b3adf4febc2676b699","天洋社区","80b6e0d2-4f2f-41de-9ff5-6d5b3218f465",NOW(),NULL,NULL FROM tab_building t;

hq_property_unit表:

insert INTO hq_property_unit SELECT DISTINCT CONCAT(r.unit_no,r.building_id) ,CONCAT(r.unit_no,"单元"),"073b4161fe4047b3adf4febc2676b699","天洋社区",b.id,b.name,"80b6e0d2-4f2f-41de-9ff5-6d5b3218f465",NOW(),NULL,NULL FROM tab_room r LEFT JOIN hq_property_building b ON r.building_id = b.id

SELECT r.room_id,REPLACE(SUBSTRING(r.room_name , 3),"-","0"), "073b4161fe4047b3adf4febc2676b699","天洋社区",b.id,b.name,u.id,u.name,"80b6e0d2-4f2f-41de-9ff5-6d5b3218f465",NOW(),NULL,NULL FROM tab_room r LEFT JOIN hq_property_building b ON r.building_id = b.id LEFT JOIN hq_property_unit u ON CONCAT(r.unit_no,r.building_id) = u.id;


SELECT a.AccountID,'073b4161fe4047b3adf4febc2676b699','天洋社区',r.building_id,r.`name`,r.unit_id,r.unit_name,r.id,r.`name`,a.AccTypeID,a.Tel,a.`Name`,a.Sex,a.Tel,"80b6e0d2-4f2f-41de-9ff5-6d5b3218f465",NOW(),NULL,NULL,'0' FROM tab_account a LEFT JOIN hq_property_room r ON a.RoomID = r.id;

SELECT o.id,o.identity_number,o.name,MD5(CONCAT('abc123',RIGHT(o.identity_number,6),'abc123')),o.phone,NOW() FROM hq_property_owner o

你可能感兴趣的:(临时数据表)