GROUP BYm.id,m.name,m.device_code,m.workshop_id,ws.name,m.collect_address_id,m.brand_id,b.brand_name,m.ip_address,m.is_enabled,m.last_ping_latency,m.last_program_name,m.last_collect_time
WHERE m.id=@Id";
WHERE m.id=@Id
GROUP BYm.id,m.name,m.device_code,m.workshop_id,ws.name,m.collect_address_id,m.brand_id,b.brand_name,m.ip_address,m.is_enabled,m.last_ping_latency,m.last_program_name,m.last_collect_time,m.last_ping_time";
varsql=@"SELECT m.id as Id, m.device_code as DeviceCode, m.name as Name, m.workshop_id as WorkshopId, ws.name as WorkshopName, m.collect_address_id as CollectAddressId, m.brand_id as BrandId, b.brand_name as BrandName, m.ip_address as IpAddress, m.is_enabled as IsEnabled,
GROUPBYm.id,m.device_code,m.name,m.workshop_id,ws.name,m.collect_address_id,m.brand_id,b.brand_name,m.ip_address,m.is_enabled,m.last_ping_latency,m.last_program_name,m.last_collect_time" + where + @"ORDERBYm.idDESCLIMIT@LimitOFFSET@Offset";
LEFTJOINcnc_workerwONwm.worker_id=w.id" + where + @"