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 
 <#if ( userAndUserPersonnelDto.userIdList )?? && userAndUserPersonnelDto.userIdList ?size gt 0>
	and bu.id in(
	<#list userAndUserPersonnelDto.userIdList as item>        
	   '${item}'
	 <#if item_has_next>,</#if>
	 </#list>
	)
	<#else >
	 and bu.id=null 
</#if>
 and bu.delete_flag='0' 