From a3cc1d220f8a1de11874bebceba0130d32157ff1 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 30 九月 2025 09:26:32 +0800 Subject: [PATCH] 2025.9.30 1. 联合前端调试数据产品接口(待完成) --- src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/JSDustSiteRep.kt | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/JSDustSiteRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/JSDustSiteRep.kt index 13684fe..5ac1b36 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/JSDustSiteRep.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/JSDustSiteRep.kt @@ -1,5 +1,6 @@ package cn.flightfeather.supervision.domain.ds3.repository +import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteInfo import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteInfoMapper import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper @@ -7,6 +8,7 @@ import cn.flightfeather.supervision.lightshare.vo.DeviceSiteVo import org.springframework.stereotype.Repository import tk.mybatis.mapper.entity.Example +import java.util.* /** * 閲戝北鎵皹鐩戞祴鐐逛綅鍜岀郴缁熺敤鎴锋槧灏勫叧绯绘暟鎹簱鐩稿叧鎿嶄綔 @@ -37,4 +39,37 @@ val res = jsDustSiteInfoMapper.selectAll() return DeviceSiteVo.fromJSDustSiteInfo(res) } + + fun searchSiteInfo(keyword: String): List<DeviceSiteVo> { + val res = jsDustSiteInfoMapper.selectByExample(Example(JSDustSiteInfo::class.java).apply { + createCriteria().andLike("name", "%$keyword%") + }) + return DeviceSiteVo.fromJSDustSiteInfo(res) + } + + /** + * 鏍规嵁id鏌ヨ + */ + fun findByPrimaryKey(id: Int?): JSDustSiteMap? { + if (id == null) { + return null + } + return jsDustSiteMapMapper.selectByPrimaryKey(id) + } + + /** + * 鏂板 + */ + fun insert(jsDustSiteMap: JSDustSiteMap): Int { + jsDustSiteMap.createTime = Date() + return jsDustSiteMapMapper.insert(jsDustSiteMap) + } + + /** + * 鏇存柊 + */ + fun update(jsDustSiteMap: JSDustSiteMap): Int { + jsDustSiteMap.createTime = Date() + return jsDustSiteMapMapper.updateByPrimaryKeySelective(jsDustSiteMap) + } } \ No newline at end of file -- Gitblit v1.9.3