feiyu02
2025-08-14 f373bbf83d9d2a7e5f96118d7dcd658c9fea8bc8
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DeviceRep.kt
@@ -7,9 +7,10 @@
import cn.flightfeather.supervision.domain.ds1.mapper.TreatmentDeviceInfoMapper
import cn.flightfeather.supervision.domain.ds1.mapper.ProductionDeviceInfoMapper
import org.springframework.stereotype.Repository
import java.util.*
/**
 *
 * 场景设备数据库查询
 * @date 2024/7/24
 * @author feiyu02
 */
@@ -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)
    }