feiyu02
2024-01-09 c1becf4cbd2e99601ce011c14b8742427249cfb4
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
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 userinfoTZMapper.selectByExample(Example(UserinfoTZ::class.java).apply {
            createCriteria().andEqualTo("extension2", type)
                .andEqualTo("extension1", district)
                .andEqualTo("usertypeid", Constant.UserType.ENTERPRISE.value)
                .andEqualTo("isenable", true)
            and(createCriteria().orIsNull("workno").orNotEqualTo("workno", "test"))
        })
    }
}