`id`, `tenant_id`, `parent_tenant_id`,`device_id`, `type`, `status`, `location`, `name`, `version`, `create_date`, `update_date`, `online_status`, `first_hb_time`, `last_hb_time`, `hb_cmd`, `config` where 1 = 1 and `id` = #{id} and `tenant_id` = #{tenantId} and `parent_tenant_id` = #{parentTenantId} and `device_id` = #{deviceId} and `version` like concat('%', #{version},'%') and `location` like concat('%', #{location},'%') and `name` like concat('%', #{name},'%') and `type` = #{type} and `status` = #{status} and `create_date` = #{createDate} and `update_date` = #{updateDate} and `online_status` = #{onlineStatus} and `first_hb_time` = #{firstHbTime} and `last_hb_time` = #{lastHbTime} and `hb_cmd` = #{hbCmd} and `config` = #{config} and id in #{idItem} order by ${sortColumns} update wx_device set `online_status` = 0 where `status` = 0 and `online_status` = 1 and `last_hb_time` < #{expiredTime}