Riku
2024-08-13 6e1095e946997e406926c204ceeb5c820dbd07c1
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DeviceRep.kt
@@ -7,6 +7,7 @@
import cn.flightfeather.supervision.domain.ds1.mapper.TreatmentDeviceInfoMapper
import cn.flightfeather.supervision.domain.ds1.mapper.ProductionDeviceInfoMapper
import org.springframework.stereotype.Repository
import java.util.*
/**
 *
@@ -65,12 +66,18 @@
     * 插入设备信息
     */
    fun insertDevice(monitorDeviceInfo: MonitorDeviceInfo): Int {
        monitorDeviceInfo.diCreateTime = Date()
        monitorDeviceInfo.diUpdateTime = Date()
        return monitorDeviceInfoMapper.insert(monitorDeviceInfo)
    }
    fun insertDevice(treatmentDeviceInfo: TreatmentDeviceInfo): Int {
        treatmentDeviceInfo.piCreateTime = Date()
        treatmentDeviceInfo.piUpdateTime = Date()
        return treatmentDeviceInfoMapper.insert(treatmentDeviceInfo)
    }
    fun insertDevice(productionDeviceInfo: ProductionDeviceInfo): Int {
        productionDeviceInfo.wiCreateTime = Date()
        productionDeviceInfo.wiUpdateTime = Date()
        return productionDeviceInfoMapper.insert(productionDeviceInfo)
    }
@@ -78,12 +85,15 @@
     * 更新设备信息
     */
    fun updateDevice(monitorDeviceInfo: MonitorDeviceInfo): Int {
        monitorDeviceInfo.diUpdateTime = Date()
        return monitorDeviceInfoMapper.updateByPrimaryKey(monitorDeviceInfo)
    }
    fun updateDevice(treatmentDeviceInfo: TreatmentDeviceInfo): Int {
        treatmentDeviceInfo.piUpdateTime = Date()
        return treatmentDeviceInfoMapper.updateByPrimaryKey(treatmentDeviceInfo)
    }
    fun updateDevice(productionDeviceInfo: ProductionDeviceInfo): Int {
        productionDeviceInfo.wiUpdateTime = Date()
        return productionDeviceInfoMapper.updateByPrimaryKey(productionDeviceInfo)
    }