|  |  |  | 
|---|
|  |  |  | <if test="dto.strictDeptId != null"> | 
|---|
|  |  |  | AND sdu.DEPARTMENT_ID = #{dto.strictDeptId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dto.type != null"> | 
|---|
|  |  |  | AND usr.TYPE = #{dto.type} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dto.status != null"> | 
|---|
|  |  |  | AND usr.STATUS = #{dto.status} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dto.keyword != null and dto.keyword != ''"> | 
|---|
|  |  |  | AND ( usr.`USERNAME` LIKE CONCAT('%', #{dto.keyword}, '%')  or usr.`REALNAME` LIKE CONCAT('%', #{dto.keyword}, '%') ) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dto.companyId != null"> | 
|---|
|  |  |  | AND usr.COMPANY_ID = #{dto.companyId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="dto.departmentIds != null and dto.departmentIds.size > 0"> | 
|---|
|  |  |  | AND sdu.DEPARTMENT_ID IN | 
|---|
|  |  |  | <foreach collection="dto.departmentIds" open="(" close=")" separator="," item="id"> | 
|---|