From 9cb8d7e0f4ffca386b14a15f8a0aca4d1db23252 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 30 十月 2025 15:58:45 +0800
Subject: [PATCH] 2025.10.30 新增单场景纵向统计接口
---
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt
index fba609a..2beb313 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt
@@ -1,8 +1,9 @@
package cn.flightfeather.supervision.domain.ds1.repository
-import cn.flightfeather.supervision.domain.ds1.entity.Scense
+import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
+import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
@@ -12,12 +13,14 @@
@Repository
class UserInfoSVRep(
private val userinfoMapper: UserinfoMapper,
+ private val sceneRep: SceneRep,
) {
/**
* 鏌ユ壘鐢ㄦ埛
*/
fun findUser(sceneIdList: List<String?>): List<Userinfo?> {
+ if (sceneIdList.isEmpty()) return emptyList()
return userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
createCriteria().andIn("dGuid", sceneIdList)
})
@@ -30,4 +33,35 @@
null
}
}
+
+ /**
+ * 妯$硦鎼滅储鐢ㄦ埛
+ * @param areaVo 鏌ヨ鍖哄煙鑼冨洿
+ * @param keyword 鎼滅储鍏抽敭瀛楋紝鍖归厤璐︽埛[Userinfo.acountname]鍜屾樀绉癧Userinfo.realname]
+ * @param userType 鐢ㄦ埛绫诲瀷锛岄粯璁や紒涓歔Constant.UserType.ENTERPRISE]
+ */
+ fun searchUser(
+ areaVo: AreaVo, keyword: String,
+ userType: Constant.UserType = Constant.UserType.ENTERPRISE,
+ ): List<Userinfo?> {
+ return userinfoMapper.searchUser(areaVo, keyword, userType.value)
+// val userList = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
+// createCriteria().orLike("realname", "%${keyword}%")
+// .orLike("acountname", "%${keyword}%")
+// })
+// val sceneList = sceneRep.findSceneList(Scense().apply {
+// provincecode = areaVo.provincecode
+// citycode = areaVo.citycode
+// districtcode = areaVo.districtcode
+// towncode = areaVo.towncode
+// typeid = areaVo.scensetypeid?.toByteOrNull()
+// extension1 = if (areaVo.online == true) "1" else "0"
+// })
+// return userList.filter { u ->
+// val scene = sceneList.find { s ->
+// return@find s?.guid == u.dGuid
+// }
+// return@filter scene != null
+// }
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3