	select DISTINCT pdu.userNum as username,c.daikou_debit as daikouDebit,c.*,u.realname,d.departname as belongUnitName, du.duties_name as duname,pdu.idcard as pduname,fin.belong_bank,fin.card_number as cardNumber 
	
	from t_bus_user_wage c left join t_s_base_user u on c.userid = u.id 
	
	left join t_bus_user_personnel per on per.userid = u.id 
	
	left join t_s_depart d on d.id = c.pjt_id
	
	left join t_bus_duties du on du.id = per.belong_dutiesid
	
	left join t_s_user pdu on pdu.id = u.id
	
	left join t_bus_user_financial fin on fin.userid = u.id and isdefault = '1' and fin.delete_flag='0'
	where 1=1 and u.delete_flag='0'

<#if ( userWageDto.orgIdList )?? && userWageDto.orgIdList ?size gt 0>
		    /* 所属单位*/
			and c.pjt_id in(
			<#list userWageDto.orgIdList as item>        
			   '${item}'
			 <#if item_has_next>,</#if>
			 </#list>
			)
		</#if>
<#if ( uidList )?? && uidList ?size gt 0>
		/* 可见的用户id */
		and u.id in(
		<#list uidList as item>   
			'${item}'
		<#if item_has_next>,</#if>
		</#list>
		)
	</#if>
		<#if (userWageDto.realname )?? && userWageDto.realname ?length gt 0>
		    /* 转正人名称 */
			and u.realname like CONCAT('%', :userWageDto.realname ,'%') 
		</#if>
		<#if (userWageDto.belongBank )?? && userWageDto.belongBank ?length gt 0>
		    /* 银行卡 */
			and fin.belong_bank like CONCAT('%', :userWageDto.belongBank ,'%')
		</#if>
		<#if ( userWageDto.bpmStatus )?? && userWageDto.bpmStatus ?length gt 0>
		    /* 申请状态*/
			and c.bpm_status = :userWageDto.bpmStatus
		</#if>
		
		<#if ( userWageDto.monthly )?? && userWageDto.monthly ?length gt 0>
		    /* 申请状态*/
			and c.monthly = :userWageDto.monthly
		</#if>
		
		order by d.departname