feiyu02
2024-07-08 b212ef0208cb094f63ea8a239a1361f8e859c839
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cn.flightfeather.supervision.domain.ds1.repository
 
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 org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
 
/**
 * 飞羽监管用户信息数据库相关操作
 */
@Repository
class UserInfoSVRep(
    private val userinfoMapper: UserinfoMapper,
) {
 
    /**
     * 查找用户
     */
    fun findUser(sceneIdList: List<String?>): List<Userinfo?> {
        return userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
            createCriteria().andIn("dGuid", sceneIdList)
        })
    }
 
    fun findUser(sceneId: String?): Userinfo? {
        return try {
            userinfoMapper.selectOne(Userinfo().apply { dGuid = sceneId })
        } catch (e: Exception) {
            null
        }
    }
}