Browse Source

fix:修复设备列表查询状态

zoie 1 month ago
parent
commit
7da61da418
1 changed files with 2 additions and 2 deletions
  1. 2 2
      models/Stock/Device.go

+ 2 - 2
models/Stock/Device.go

@@ -253,8 +253,8 @@ func (dao *DeviceDaoImpl) Read_Device_List(T_name, T_product_name, T_product_mod
 	if len(maps_z) == 0 {
 		return r, 0
 	}
-	sql = "SELECT *,latest.t__state as t_device_state,p.t_name AS t_product_name,p.t_model AS t_product_model,p.t_class AS t_product_class,p.t_spec AS t_product_spec " +
-		"FROM device d JOIN product p ON d.t_product_id = p.ID JOIN (SELECT t_sn,t__state, MAX(create_time) AS max_create_time FROM device GROUP BY t_sn) latest " +
+	sql = "SELECT *,d.t__state as t_device_state,p.t_name AS t_product_name,p.t_model AS t_product_model,p.t_class AS t_product_class,p.t_spec AS t_product_spec " +
+		"FROM device d JOIN product p ON d.t_product_id = p.ID JOIN (SELECT t_sn, MAX(create_time) AS max_create_time FROM device GROUP BY t_sn) latest " +
 		"ON d.t_sn = latest.t_sn AND d.create_time = latest.max_create_time"
 
 	sql = sql + sqlWhere