|
@@ -588,28 +588,6 @@ func GetCultureData(bedid int64, start int64, end int64, orgId int64) (cultures
|
588
|
588
|
return cultures, err
|
589
|
589
|
}
|
590
|
590
|
|
591
|
|
-func GetDialysateData(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
592
|
|
- db := UserReadDB().Table("xt_device_dialysate as x").Where("x.status = 1")
|
593
|
|
- table := UserReadDB().Table("sgj_user_admin_role as r")
|
594
|
|
- fmt.Println("table", table)
|
595
|
|
- if orgId > 0 {
|
596
|
|
- db = db.Where("x.user_org_id = ?", orgId)
|
597
|
|
- }
|
598
|
|
- if bedid > 0 {
|
599
|
|
- db = db.Where("x.bed_id = ?", bedid)
|
600
|
|
- }
|
601
|
|
- if start > 0 {
|
602
|
|
- db = db.Where("x.sampling_date >= ?", start)
|
603
|
|
- }
|
604
|
|
- if end > 0 {
|
605
|
|
- db = db.Where("x.sampling_date <= ?", end)
|
606
|
|
- }
|
607
|
|
-
|
608
|
|
- err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
609
|
|
-
|
610
|
|
- return dialysate, err
|
611
|
|
-}
|
612
|
|
-
|
613
|
591
|
func GetDeviceIonData(bedid int64, start int64, end int64, orgId int64) (ions []*models.DeviceIons, err error) {
|
614
|
592
|
db := UserReadDB().Table("xt_device_ion as x").Where("x.status = 1")
|
615
|
593
|
table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
@@ -1242,3 +1220,324 @@ func GetDeviceInfomation(orgid int64, scheduledate int64) (information []*models
|
1242
|
1220
|
err = UserReadDB().Model(&information).Where("user_org_id = ? and date = ? and status =1", orgid, scheduledate).Find(&information).Error
|
1243
|
1221
|
return information, err
|
1244
|
1222
|
}
|
|
1223
|
+
|
|
1224
|
+func CreateOxygenates(oxygenates *models.XtDeviceOxygenates) error {
|
|
1225
|
+
|
|
1226
|
+ err := UserWriteDB().Create(&oxygenates).Error
|
|
1227
|
+ return err
|
|
1228
|
+}
|
|
1229
|
+
|
|
1230
|
+func CreateHadWater(hadwater *models.XtDeviceHadwater) error {
|
|
1231
|
+
|
|
1232
|
+ err := UserWriteDB().Create(&hadwater).Error
|
|
1233
|
+ return err
|
|
1234
|
+}
|
|
1235
|
+
|
|
1236
|
+func CreateWater(water *models.XtDeviceWater) error {
|
|
1237
|
+
|
|
1238
|
+ err := UserWriteDB().Create(&water).Error
|
|
1239
|
+ return err
|
|
1240
|
+}
|
|
1241
|
+
|
|
1242
|
+func CreateDevicePh(ph *models.XtDevicePh) error {
|
|
1243
|
+
|
|
1244
|
+ err := UserWriteDB().Create(&ph).Error
|
|
1245
|
+ return err
|
|
1246
|
+}
|
|
1247
|
+
|
|
1248
|
+func GetAllDeviceOxygenates(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1249
|
+ db := UserReadDB().Table("xt_device_oxygenates as x").Where("x.status = 1")
|
|
1250
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1251
|
+ fmt.Println("table", table)
|
|
1252
|
+ if orgId > 0 {
|
|
1253
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1254
|
+ }
|
|
1255
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1256
|
+
|
|
1257
|
+ return dialysate, err
|
|
1258
|
+}
|
|
1259
|
+
|
|
1260
|
+func GetAllHadWater(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1261
|
+ db := UserReadDB().Table("xt_device_hadwater as x").Where("x.status = 1")
|
|
1262
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1263
|
+ fmt.Println("table", table)
|
|
1264
|
+ if orgId > 0 {
|
|
1265
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1266
|
+ }
|
|
1267
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1268
|
+
|
|
1269
|
+ return dialysate, err
|
|
1270
|
+}
|
|
1271
|
+
|
|
1272
|
+func GetDeviceWater(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1273
|
+ db := UserReadDB().Table("xt_device_water as x").Where("x.status = 1")
|
|
1274
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1275
|
+ fmt.Println("table", table)
|
|
1276
|
+ if orgId > 0 {
|
|
1277
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1278
|
+ }
|
|
1279
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1280
|
+
|
|
1281
|
+ return dialysate, err
|
|
1282
|
+}
|
|
1283
|
+
|
|
1284
|
+func GetDevicePH(orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1285
|
+ db := UserReadDB().Table("xt_device_ph as x").Where("x.status = 1")
|
|
1286
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1287
|
+ fmt.Println("table", table)
|
|
1288
|
+ if orgId > 0 {
|
|
1289
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1290
|
+ }
|
|
1291
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1292
|
+
|
|
1293
|
+ return dialysate, err
|
|
1294
|
+}
|
|
1295
|
+
|
|
1296
|
+func GetDialysateData(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1297
|
+ db := UserReadDB().Table("xt_device_dialysate as x").Where("x.status = 1")
|
|
1298
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1299
|
+ fmt.Println("table", table)
|
|
1300
|
+ if orgId > 0 {
|
|
1301
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1302
|
+ }
|
|
1303
|
+ if bedid > 0 {
|
|
1304
|
+ db = db.Where("x.bed_id = ?", bedid)
|
|
1305
|
+ }
|
|
1306
|
+ if start > 0 {
|
|
1307
|
+ db = db.Where("x.sampling_date >= ?", start)
|
|
1308
|
+ }
|
|
1309
|
+ if end > 0 {
|
|
1310
|
+ db = db.Where("x.sampling_date <= ?", end)
|
|
1311
|
+ }
|
|
1312
|
+
|
|
1313
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1314
|
+
|
|
1315
|
+ return dialysate, err
|
|
1316
|
+}
|
|
1317
|
+
|
|
1318
|
+func GetOxygenates(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1319
|
+ db := UserReadDB().Table("xt_device_oxygenates as x").Where("x.status = 1")
|
|
1320
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1321
|
+ fmt.Println("table", table)
|
|
1322
|
+ if orgId > 0 {
|
|
1323
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1324
|
+ }
|
|
1325
|
+ if bedid > 0 {
|
|
1326
|
+ db = db.Where("x.bed_id = ?", bedid)
|
|
1327
|
+ }
|
|
1328
|
+ if start > 0 {
|
|
1329
|
+ db = db.Where("x.sampling_date >= ?", start)
|
|
1330
|
+ }
|
|
1331
|
+ if end > 0 {
|
|
1332
|
+ db = db.Where("x.sampling_date <= ?", end)
|
|
1333
|
+ }
|
|
1334
|
+
|
|
1335
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1336
|
+
|
|
1337
|
+ return dialysate, err
|
|
1338
|
+}
|
|
1339
|
+
|
|
1340
|
+func GetHardWater(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1341
|
+ db := UserReadDB().Table("xt_device_hadwater as x").Where("x.status = 1")
|
|
1342
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1343
|
+ fmt.Println("table", table)
|
|
1344
|
+ if orgId > 0 {
|
|
1345
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1346
|
+ }
|
|
1347
|
+ if bedid > 0 {
|
|
1348
|
+ db = db.Where("x.bed_id = ?", bedid)
|
|
1349
|
+ }
|
|
1350
|
+ if start > 0 {
|
|
1351
|
+ db = db.Where("x.sampling_date >= ?", start)
|
|
1352
|
+ }
|
|
1353
|
+ if end > 0 {
|
|
1354
|
+ db = db.Where("x.sampling_date <= ?", end)
|
|
1355
|
+ }
|
|
1356
|
+
|
|
1357
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1358
|
+
|
|
1359
|
+ return dialysate, err
|
|
1360
|
+}
|
|
1361
|
+
|
|
1362
|
+func GetWater(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1363
|
+ db := UserReadDB().Table("xt_device_water as x").Where("x.status = 1")
|
|
1364
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1365
|
+ fmt.Println("table", table)
|
|
1366
|
+ if orgId > 0 {
|
|
1367
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1368
|
+ }
|
|
1369
|
+ if bedid > 0 {
|
|
1370
|
+ db = db.Where("x.bed_id = ?", bedid)
|
|
1371
|
+ }
|
|
1372
|
+ if start > 0 {
|
|
1373
|
+ db = db.Where("x.sampling_date >= ?", start)
|
|
1374
|
+ }
|
|
1375
|
+ if end > 0 {
|
|
1376
|
+ db = db.Where("x.sampling_date <= ?", end)
|
|
1377
|
+ }
|
|
1378
|
+
|
|
1379
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1380
|
+
|
|
1381
|
+ return dialysate, err
|
|
1382
|
+}
|
|
1383
|
+
|
|
1384
|
+func GetDevicePh(bedid int64, start int64, end int64, orgId int64) (dialysate []*models.DeviceDialysates, err error) {
|
|
1385
|
+ db := UserReadDB().Table("xt_device_ph as x").Where("x.status = 1")
|
|
1386
|
+ table := UserReadDB().Table("sgj_user_admin_role as r")
|
|
1387
|
+ fmt.Println("table", table)
|
|
1388
|
+ if orgId > 0 {
|
|
1389
|
+ db = db.Where("x.user_org_id = ?", orgId)
|
|
1390
|
+ }
|
|
1391
|
+ if bedid > 0 {
|
|
1392
|
+ db = db.Where("x.bed_id = ?", bedid)
|
|
1393
|
+ }
|
|
1394
|
+ if start > 0 {
|
|
1395
|
+ db = db.Where("x.sampling_date >= ?", start)
|
|
1396
|
+ }
|
|
1397
|
+ if end > 0 {
|
|
1398
|
+ db = db.Where("x.sampling_date <= ?", end)
|
|
1399
|
+ }
|
|
1400
|
+
|
|
1401
|
+ err = db.Group("x.id").Select("x.id,x.sampling_date,x.specimenb,x.concentrate_noc,x.concentrateb_nod,x.sampling_locationb,x.detection_unit,x.samplerb,x.reporting_dateb,x.detection_resultb,x.bed_id,x.bed,r.user_name").Joins("Left Join sgj_user_admin_role as r on r.admin_user_id = x.samplerb").Scan(&dialysate).Error
|
|
1402
|
+
|
|
1403
|
+ return dialysate, err
|
|
1404
|
+}
|
|
1405
|
+
|
|
1406
|
+func GetOxygenatesById(id int64) (models.XtDeviceOxygenates, error) {
|
|
1407
|
+ oxygenates := models.XtDeviceOxygenates{}
|
|
1408
|
+ err := UserReadDB().Model(&oxygenates).Where("id = ? and status = 1", id).Find(&oxygenates).Error
|
|
1409
|
+ return oxygenates, err
|
|
1410
|
+}
|
|
1411
|
+
|
|
1412
|
+func UpdateOxygenates(id int64, orgid int64, dialysate *models.XtDeviceOxygenates) error {
|
|
1413
|
+ err := writeUserDb.Model(&dialysate).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": dialysate.SamplingDate, "specimenb": dialysate.Specimenb, "concentrate_noc": dialysate.ConcentrateNoc, "concentrateb_nod": dialysate.ConcentratebNod, "sampling_locationb": dialysate.SamplingLocationb, "detection_unit": dialysate.DetectionUnit, "samplerb": dialysate.Samplerb, "reporting_dateb": dialysate.ReportingDateb, "detection_resultb": dialysate.DetectionResultb, "mtime": time.Now().Unix()}).Error
|
|
1414
|
+ return err
|
|
1415
|
+}
|
|
1416
|
+
|
|
1417
|
+func GetHardWaterById(id int64) (models.XtDeviceHadwater, error) {
|
|
1418
|
+ hadwater := models.XtDeviceHadwater{}
|
|
1419
|
+ err := UserReadDB().Model(&hadwater).Where("id = ? and status = 1", id).Find(&hadwater).Error
|
|
1420
|
+ return hadwater, err
|
|
1421
|
+}
|
|
1422
|
+
|
|
1423
|
+func GetWaterById(id int64) (models.XtDeviceWater, error) {
|
|
1424
|
+
|
|
1425
|
+ water := models.XtDeviceWater{}
|
|
1426
|
+ err := UserReadDB().Model(&water).Where("id=? and status =1", id).Find(&water).Error
|
|
1427
|
+ return water, err
|
|
1428
|
+}
|
|
1429
|
+
|
|
1430
|
+func GetDevicePhById(id int64) (models.XtDevicePh, error) {
|
|
1431
|
+
|
|
1432
|
+ devicePh := models.XtDevicePh{}
|
|
1433
|
+ err := UserReadDB().Model(&devicePh).Where("id = ? and status =1", id).Find(&devicePh).Error
|
|
1434
|
+ return devicePh, err
|
|
1435
|
+}
|
|
1436
|
+
|
|
1437
|
+func CreateAerialDetection(detection *models.XtAerialDetection) error {
|
|
1438
|
+
|
|
1439
|
+ err := XTWriteDB().Create(&detection).Error
|
|
1440
|
+ return err
|
|
1441
|
+}
|
|
1442
|
+
|
|
1443
|
+func GetAirList(limit int64, page int64, orgid int64) (airlist []*models.XtAerialDetection, total int64, err error) {
|
|
1444
|
+ offset := (page - 1) * limit
|
|
1445
|
+ err = XTReadDB().Model(&airlist).Where("user_org_id = ? and status =1", orgid).Count(&total).Limit(limit).Offset(offset).Find(&airlist).Error
|
|
1446
|
+ return airlist, total, err
|
|
1447
|
+}
|
|
1448
|
+
|
|
1449
|
+func GetAirDisinfectDetail(id int64) (models.XtAerialDetection, error) {
|
|
1450
|
+
|
|
1451
|
+ detection := models.XtAerialDetection{}
|
|
1452
|
+ err := XTReadDB().Model(&detection).Where("id = ? and status = 1", id).Find(&detection).Error
|
|
1453
|
+ return detection, err
|
|
1454
|
+}
|
|
1455
|
+
|
|
1456
|
+func UpdateAeriaDetection(detection *models.XtAerialDetection, id int64) error {
|
|
1457
|
+
|
|
1458
|
+ err := XTWriteDB().Model(&detection).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"start_time": detection.StartTime, "created_time": detection.CreatedTime, "class": detection.Class, "disinfection_methods": detection.DisinfectionMethods, "disinfection_fluid": detection.DisinfectionFluid, "sort": detection.Sort, "creator": detection.Creator, "detection_time": detection.DetectionTime, "detection_result": detection.DetectionResult, "upload_time": detection.UploadTime, "check_out": detection.CheckOut, "modifications": detection.Modifications}).Error
|
|
1459
|
+ return err
|
|
1460
|
+}
|
|
1461
|
+
|
|
1462
|
+func DeleteAirDisinfect(id int64) error {
|
|
1463
|
+ detection := models.XtAerialDetection{}
|
|
1464
|
+ err := XTWriteDB().Model(&detection).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
|
|
1465
|
+ return err
|
|
1466
|
+}
|
|
1467
|
+
|
|
1468
|
+func SaveBodyDetection(detection *models.XtBodyDetection) error {
|
|
1469
|
+
|
|
1470
|
+ err := XTWriteDB().Create(&detection).Error
|
|
1471
|
+ return err
|
|
1472
|
+}
|
|
1473
|
+
|
|
1474
|
+func GetBodyList(limit int64, page int64, orgid int64) (body []*models.XtBodyDetection, total int64, err error) {
|
|
1475
|
+
|
|
1476
|
+ offset := (page - 1) * limit
|
|
1477
|
+ err = XTReadDB().Model(&body).Where("user_org_id = ? and status =1", orgid).Count(&total).Limit(limit).Offset(offset).Find(&body).Error
|
|
1478
|
+ return body, total, err
|
|
1479
|
+
|
|
1480
|
+}
|
|
1481
|
+
|
|
1482
|
+func GetBodyDisinfectDetail(id int64) (models.XtBodyDetection, error) {
|
|
1483
|
+
|
|
1484
|
+ detection := models.XtBodyDetection{}
|
|
1485
|
+ err := XTReadDB().Model(&detection).Where("id = ? and status = 1", id).Find(&detection).Error
|
|
1486
|
+ return detection, err
|
|
1487
|
+}
|
|
1488
|
+
|
|
1489
|
+func UpdateBodyDetection(detection *models.XtBodyDetection, id int64) error {
|
|
1490
|
+
|
|
1491
|
+ err := XTWriteDB().Model(&detection).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"start_time": detection.StartTime, "created_time": detection.CreatedTime, "class": detection.Class, "disinfection_methods": detection.DisinfectionMethods, "disinfection_fluid": detection.DisinfectionFluid, "sort": detection.Sort, "creator": detection.Creator, "detection_time": detection.DetectionTime, "detection_result": detection.DetectionResult, "upload_time": detection.UploadTime, "check_out": detection.CheckOut, "modifications": detection.Modifications}).Error
|
|
1492
|
+ return err
|
|
1493
|
+}
|
|
1494
|
+
|
|
1495
|
+func DeleteBodyDisInfect(id int64) error {
|
|
1496
|
+
|
|
1497
|
+ detection := models.XtBodyDetection{}
|
|
1498
|
+ err := XTWriteDB().Model(&detection).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"status": 0}).Error
|
|
1499
|
+ return err
|
|
1500
|
+}
|
|
1501
|
+
|
|
1502
|
+func UpdateHadWater(id int64, orgid int64, hadwater *models.XtDeviceHadwater) error {
|
|
1503
|
+
|
|
1504
|
+ err := writeUserDb.Model(&hadwater).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": hadwater.SamplingDate, "specimenb": hadwater.Specimenb, "concentrate_noc": hadwater.ConcentrateNoc, "concentrateb_nod": hadwater.ConcentratebNod, "sampling_locationb": hadwater.SamplingLocationb, "detection_unit": hadwater.DetectionUnit, "samplerb": hadwater.Samplerb, "reporting_dateb": hadwater.ReportingDateb, "detection_resultb": hadwater.DetectionResultb, "mtime": time.Now().Unix()}).Error
|
|
1505
|
+ return err
|
|
1506
|
+}
|
|
1507
|
+
|
|
1508
|
+func UpdateDeviceWater(id int64, orgid int64, hadwater *models.XtDeviceWater) error {
|
|
1509
|
+
|
|
1510
|
+ err := writeUserDb.Model(&hadwater).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": hadwater.SamplingDate, "specimenb": hadwater.Specimenb, "concentrate_noc": hadwater.ConcentrateNoc, "concentrateb_nod": hadwater.ConcentratebNod, "sampling_locationb": hadwater.SamplingLocationb, "detection_unit": hadwater.DetectionUnit, "samplerb": hadwater.Samplerb, "reporting_dateb": hadwater.ReportingDateb, "detection_resultb": hadwater.DetectionResultb, "mtime": time.Now().Unix()}).Error
|
|
1511
|
+ return err
|
|
1512
|
+}
|
|
1513
|
+
|
|
1514
|
+func UpdateDivicePh(id int64, orgid int64, hadwater *models.XtDevicePh) error {
|
|
1515
|
+ err := writeUserDb.Model(&hadwater).Where("id=? AND user_org_id = ? AND status = 1", id, orgid).Updates(map[string]interface{}{"sampling_date": hadwater.SamplingDate, "specimenb": hadwater.Specimenb, "concentrate_noc": hadwater.ConcentrateNoc, "concentrateb_nod": hadwater.ConcentratebNod, "sampling_locationb": hadwater.SamplingLocationb, "detection_unit": hadwater.DetectionUnit, "samplerb": hadwater.Samplerb, "reporting_dateb": hadwater.ReportingDateb, "detection_resultb": hadwater.DetectionResultb, "mtime": time.Now().Unix()}).Error
|
|
1516
|
+ return err
|
|
1517
|
+}
|
|
1518
|
+
|
|
1519
|
+func DeleteOxygenates(id int64) error {
|
|
1520
|
+ oxygenates := models.XtDeviceOxygenates{}
|
|
1521
|
+ err := writeUserDb.Model(&oxygenates).Where("id = ? ", id).Updates(map[string]interface{}{"status": 0}).Error
|
|
1522
|
+ return err
|
|
1523
|
+}
|
|
1524
|
+
|
|
1525
|
+func DeleteHadWater(id int64) error {
|
|
1526
|
+ hadwater := models.XtDeviceHadwater{}
|
|
1527
|
+ err := writeUserDb.Model(&hadwater).Where("id =?", id).Updates(map[string]interface{}{"status": 0}).Error
|
|
1528
|
+ return err
|
|
1529
|
+}
|
|
1530
|
+
|
|
1531
|
+func DeleteWater(id int64) error {
|
|
1532
|
+
|
|
1533
|
+ water := models.XtDeviceWater{}
|
|
1534
|
+ err := writeUserDb.Model(&water).Where("id = ? ", id).Updates(map[string]interface{}{"status": 0}).Error
|
|
1535
|
+ return err
|
|
1536
|
+}
|
|
1537
|
+
|
|
1538
|
+func DeleteDevicePh(id int64) error {
|
|
1539
|
+
|
|
1540
|
+ ph := models.XtDevicePh{}
|
|
1541
|
+ err := writeUserDb.Model(&ph).Where("id = ? ", id).Updates(map[string]interface{}{"status": 0}).Error
|
|
1542
|
+ return err
|
|
1543
|
+}
|