From 9de446b0b83610055437fbc5172d216bb374900f Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 21 十一月 2024 09:22:19 +0800 Subject: [PATCH] 1. 2024.11.21 修复部分bug --- src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 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..a2fac40 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,10 @@ package cn.flightfeather.supervision.domain.ds1.repository +import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.domain.ds1.entity.Scense 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 +14,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 +34,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