<#-- 消息发送查询所有员工信息--用人事表关联查询 -->

select 
bu.id, 
bu.id as userid,
bu.username, 
bu.realname,
up.in_postid, 
up.position_status, 
up.contract_stime
 from t_s_base_user bu 
 LEFT JOIN t_bus_user_personnel up  ON bu.ID=up.userid
 WHERE 1=1 

AND bu.delete_flag = '0'
<#if (userAndUserPersonnelDto.realname )?? && userAndUserPersonnelDto.realname ?length gt 0>
	 and bu.realname like CONCAT('%', :userAndUserPersonnelDto.realname ,'%') 
</#if>







