package cn.flightfeather.supervision.domain.ds2.repository
|
|
import cn.flightfeather.supervision.common.utils.Constant
|
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
|
import cn.flightfeather.supervision.domain.ds2.mapper.UserinfoTZMapper
|
import org.springframework.stereotype.Repository
|
import tk.mybatis.mapper.entity.Example
|
|
@Repository
|
class UserInfoTZRep(private val userinfoTZMapper: UserinfoTZMapper) {
|
|
/**
|
* 查找在线的正式企业用户
|
* @param district 区县名称
|
* @param sceneType 场景类型
|
* @return
|
*/
|
fun findEnterpriseUser(district: String?, sceneType: Constant.SceneType): List<UserinfoTZ?> {
|
val type = Constant.SceneType.typeMap(sceneType.value.toByte())
|
return findEnterpriseUser(district, type?.toInt())
|
}
|
|
/**
|
* 查找在线的正式企业用户
|
* @param sceneTypeTZ 飞羽环境系统中的场景类型
|
*/
|
fun findEnterpriseUser(district: String?, sceneTypeTZ: Int?): List<UserinfoTZ?> {
|
return userinfoTZMapper.selectByExample(Example(UserinfoTZ::class.java).apply {
|
createCriteria().andEqualTo("extension2", sceneTypeTZ)
|
.andEqualTo("extension1", district)
|
.andEqualTo("usertypeid", Constant.UserType.ENTERPRISE.value)
|
.andEqualTo("isenable", true)
|
and(createCriteria().orIsNull("workno").orNotEqualTo("workno", "test"))
|
})
|
}
|
}
|