|  |  | 
 |  |  |     LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = usr.CREATE_USER | 
 |  |  |     LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = usr.UPDATE_USER | 
 |  |  |     LEFT JOIN `company` sd ON sd.ID = usr.COMPANY_ID AND sd.ISDELETED = 0 | 
 |  |  |     LEFT JOIN `member` m ON usr.MEMBER_ID = m.id | 
 |  |  |     <if test="dto.roleId != null"> | 
 |  |  |       RIGHT JOIN system_user_role sur on sur.USER_ID = usr.ID and sur.ROLE_ID = #{dto.roleId} | 
 |  |  |     </if> | 
 |  |  |     <where> | 
 |  |  |       usr.DELETED = 0 | 
 |  |  |       and usr.SOURCE = 0 | 
 |  |  | <!--      <if test="dto.positionId != null">--> | 
 |  |  | <!--        AND spu.POSITION_ID = #{dto.positionId}--> | 
 |  |  | <!--      </if>--> | 
 |  |  | 
 |  |  |       <if test="dto.status != null "> | 
 |  |  |         AND  usr.`status` = #{dto.status} | 
 |  |  |       </if> | 
 |  |  |       <if test="dto.memberType != null "> | 
 |  |  |         AND  m.`type` = #{dto.memberType} | 
 |  |  |       </if> | 
 |  |  |       <if test="dto.companyType != null "> | 
 |  |  |         AND  sd.`type` = #{dto.companyType} | 
 |  |  |       </if> | 
 |  |  |     </where> | 
 |  |  |     ${orderByClause} | 
 |  |  |   </select> |