SELECT al.id,al.type_id,al.title,content,DATE_FORMAT(al.create_time,'%Y-%m-%d %H:%I:%S') create_time,alt.level,level_describe FROM alarm AS al JOIN alarm_type AS alt ON al.type_id = alt.id
SELECT id,alarm_id,type_id,title,content,DATE_FORMAT(create_time,'%Y-%m-%d %H:%I:%S') create_time,us.user_id,user_name FROM alarm_read AS al JOIN user AS us ON us.user_id = al.user_id