select ud.id, ud.com_id, ud.project_id, ud.name, ud.tag, ud.scene_guid, ud.source, ud.device_no, ud.addition, ud.bind_default_scene, ud.force_empty_device, ud.direction,ud.channel, ud.device_model, ud.device_state, ud.rec_type, ud.online_state, ud.version_no, ud.last_active_time, ud.has_register, ud.state, ud.remark, ud.is_del, ud.create_by, ud.create_time, ud.update_by, ud.update_time ,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` souce_name from attendance_ubi_device ud left join sys_dept dp on ud.`com_id`=dp.`dept_id` left join pro_project_info pp on ud.`project_id`=pp.`id` left join sys_dict_data dic on ud.`source`=dic.`dict_value` and dic.`dict_type`='ubi_device_source' insert into attendance_ubi_device id, com_id, project_id, name, tag, scene_guid, source, device_no, addition, bind_default_scene, force_empty_device, password, device_model, device_state, rec_type, online_state, version_no, last_active_time, has_register, state, remark, is_del, direction, channel, create_by, create_time, update_by, update_time, #{id}, #{comId}, #{projectId}, #{name}, #{tag}, #{sceneGuid}, #{source}, #{deviceNo}, #{addition}, #{bindDefaultScene}, #{forceEmptyDevice}, #{password}, #{deviceModel}, #{deviceState}, #{recType}, #{onlineState}, #{versionNo}, #{lastActiveTime}, #{hasRegister}, #{state}, #{remark}, #{isDel}, #{direction}, #{channel}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, update attendance_ubi_device com_id = #{comId}, project_id = #{projectId}, name = #{name}, tag = #{tag}, scene_guid = #{sceneGuid}, source = #{source}, device_no = #{deviceNo}, addition = #{addition}, bind_default_scene = #{bindDefaultScene}, force_empty_device = #{forceEmptyDevice}, password = #{password}, device_model = #{deviceModel}, device_state = #{deviceState}, rec_type = #{recType}, online_state = #{onlineState}, version_no = #{versionNo}, last_active_time = #{lastActiveTime}, has_register = #{hasRegister}, state = #{state}, remark = #{remark}, is_del = #{isDel}, direction = #{direction}, channel = #{channel}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, where id = #{id} delete from attendance_ubi_device where id = #{id} delete from attendance_ubi_device where id in #{id}