一、查询结果字符拼接
SELECT t.*, CONCAT(IFNULL(d.device_num,‘‘),IFNULL(d1.device_num,‘‘)) AS deviceNum,d.device_name,pr.name AS provinceName,cr.name AS cityName,dr.name AS districtName FROM simcard t LEFT JOIN emergency d ON t.device_id = d.id LEFT JOIN battery d1 ON t.device_id = d1.id LEFT JOIN region pr ON pr.id=t.province_id LEFT JOIN region cr ON cr.id= t.city_id LEFT JOIN region dr ON dr.id=t.district_id