SELECT 'INSERT INTO `lz_cloud_crm`.`t_store_linkaddress`(`store_code`, `province`, `city`, `county`, `address`, `address_type`, `addressee_name`, `addressee_phone`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES(',
CONCAT('"',info.code,'",'),
IFNULL(CONCAT('"',info.province,'",'), 'NULL,'),
IFNULL(CONCAT('"',info.city,'",'), 'NULL,'),
IFNULL(CONCAT('"',info.county,'",'), 'NULL,'),
IFNULL(CONCAT('"',info.address,'",'), 'NULL,'),
IFNULL(CONCAT('"','2','",'), 'NULL,'),
IFNULL(CONCAT('"',info.addressee_name,'",'), 'NULL,'),
IFNULL(CONCAT('"',info.addressee_phone,'",'), 'NULL,'),
IFNULL(CONCAT('"','ZY09924','",'), 'NULL,'),
IFNULL(CONCAT('"',now(),'",'), 'NULL,'),
IFNULL(CONCAT('"','ZY09924','",'), 'NULL,'),
IFNULL(CONCAT('"',now(),'"'), 'NULL'),
");"
FROM lz_cloud_crm.t_store store
INNER JOIN lz_cloud_crm.t_business_info info
ON store.store_code = info.code
WHERE store.business_code='03'
AND info.type='01';