[後端] 修改sql commend

This commit is contained in:
dev02 2023-11-02 16:42:29 +08:00
parent 73ea4a9a68
commit 98f21b5813

View File

@ -628,7 +628,7 @@ namespace Backend.Controllers
// JOIN variable sv ON di.device_name_tag = sv.system_value // JOIN variable sv ON di.device_name_tag = sv.system_value
// JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value // JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value
// WHERE sv.id = @id AND di.deleted = @Deleted and di.device_building_tag = @building_tag and di.is_link = 1"; // WHERE sv.id = @id AND di.deleted = @Deleted and di.device_building_tag = @building_tag and di.is_link = 1";
var sql = @"SELECT min(di.id), di.full_name, di.points, di.unit, di.is_show, di.is_show_riserDiagram, di.is_controll, di.is_bool, di.is_link, di.is_show_history, di.device_system_tag, di.device_name_tag var sql = @"SELECT min(di.id) as id, di.full_name, di.points, di.unit, di.is_show, di.is_show_riserDiagram, di.is_controll, di.is_bool, di.is_link, di.is_show_history, di.device_system_tag, di.device_name_tag
FROM device_item di FROM device_item di
JOIN variable sv ON di.device_name_tag = sv.system_value JOIN variable sv ON di.device_name_tag = sv.system_value
JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value JOIN variable mv ON sv.system_parent_id = mv.id AND di.device_system_tag = mv.system_value