SELECT
de.id, code, name, 
de.type_id typeId, 
de.create_name createName, 
de.create_by createBy, 
de.create_date createDate, 
de.update_name updateName, 
de.update_by updateBy, 
de.update_date updateDate, 
de.department, 
de.description, 
org.departname projectid, 
de.picture, 
de.labelid, 
de.sourcesys, 
de.is_displayed isDisplayed, 
de.use_time, 
de.invalid_time invalidTime, de.area, de.location, 
de.user_name userName, 
de.maintain_count maintainCount, 
de.next_maintain_time nextMaintainTime, 
de.repair_count, 
de.last_repair_time lastRepairTime, de.state, de.roomname, 
de.abnormal_phone abnormalPhone, 
de.abnormal_time abnormalTime, 
de.report_phone reportPhone, 
de.assists_name assistsName, 
de.principal_name principalName
from p_device de
left join t_s_depart org on de.projectid = org.id
