|
@@ -1157,10 +1157,10 @@ func GetUnitType(bedid int64, orgid int64) (models.DeviceAddmacher, error) {
|
1157
|
1157
|
return addmacher, err
|
1158
|
1158
|
}
|
1159
|
1159
|
|
1160
|
|
-func GetLaseDeviceInfomation(orgid int64, bedid int64, date int64) (*models.DeviceInformation, error) {
|
|
1160
|
+func GetLaseDeviceInfomation(orgid int64, bedid int64, date int64, scheduletype int64) (*models.DeviceInformation, error) {
|
1161
|
1161
|
|
1162
|
1162
|
information := models.DeviceInformation{}
|
1163
|
|
- err := UserReadDB().Model(&information).Where("bed_number = ? and user_org_id =? and status = 1 and date = ?", bedid, orgid, date).Find(&information).Error
|
|
1163
|
+ err := UserReadDB().Model(&information).Where("bed_number = ? and user_org_id =? and status = 1 and date = ? and class = ? ", bedid, orgid, date, scheduletype).Find(&information).Error
|
1164
|
1164
|
if err == gorm.ErrRecordNotFound {
|
1165
|
1165
|
return nil, err
|
1166
|
1166
|
}
|
|
@@ -1170,9 +1170,9 @@ func GetLaseDeviceInfomation(orgid int64, bedid int64, date int64) (*models.Devi
|
1170
|
1170
|
return &information, nil
|
1171
|
1171
|
}
|
1172
|
1172
|
|
1173
|
|
-func GetLaseDeviceInfomationTwo(orgid int64, bedid int64) (models.DeviceInformation, error) {
|
|
1173
|
+func GetLaseDeviceInfomationTwo(orgid int64, bedid int64, scheduletype int64) (models.DeviceInformation, error) {
|
1174
|
1174
|
information := models.DeviceInformation{}
|
1175
|
|
- err = UserReadDB().Model(&information).Where("bed_number= ? and user_org_id = ? and status = 1", bedid, orgid).Last(&information).Error
|
|
1175
|
+ err = UserReadDB().Model(&information).Where("bed_number= ? and user_org_id = ? and status = 1 and class = ?", bedid, orgid, scheduletype).Last(&information).Error
|
1176
|
1176
|
return information, err
|
1177
|
1177
|
}
|
1178
|
1178
|
|
|
@@ -1225,8 +1225,8 @@ func CreateInformationTwo(information *models.DeviceInformation) error {
|
1225
|
1225
|
return err
|
1226
|
1226
|
}
|
1227
|
1227
|
|
1228
|
|
-func UpdateInformation(information *models.DeviceInformation, scheduledate int64, bedid int64) error {
|
|
1228
|
+func UpdateInformation(information *models.DeviceInformation, scheduledate int64, bedid int64, scheduletype int64) error {
|
1229
|
1229
|
|
1230
|
|
- err := UserWriteDB().Model(&information).Where("date = ? and bed_number = ?", scheduledate, bedid).Updates(map[string]interface{}{"long_time": information.LongTime, "disinfec_startime": information.DisinfecStartime, "disinfec_endtime": information.DisinfecEndtime}).Error
|
|
1230
|
+ err := UserWriteDB().Model(&information).Where("date = ? and bed_number = ? and class = ?", scheduledate, bedid, scheduletype).Updates(map[string]interface{}{"long_time": information.LongTime, "disinfec_startime": information.DisinfecStartime, "disinfec_endtime": information.DisinfecEndtime}).Error
|
1231
|
1231
|
return err
|
1232
|
1232
|
}
|