<#-- 验证轮流值班是否可行-->
<#--  根据值班操作表获取员工信息，再根据项目排班详细表找到班次信息，判断班次类型-->

SELECT
	uad.calendarid,
	uad.shiftid,
	ad.duty_type as shiftType,
	pd.userid,
	bu.realname
FROM
	t_bus_user_arrange_detail uad
LEFT JOIN t_bus_projarrange_detail pd ON pd.id = uad.projarrange_detailid
LEFT JOIN t_bus_arrange_duty ad ON ad.id = uad.shiftid
LEFT JOIN t_s_base_user bu ON bu.id = pd.userid
WHERE 1=1 
<#if (userAndShiftDto.projarrangeDetailid )?? && userAndShiftDto.projarrangeDetailid ?length gt 0>
	and pd.id like CONCAT('%', :userAndShiftDto.projarrangeDetailid ,'%') 
<#else >
	and pd.id is null
</#if>
	<#-- pd.id = '4028e4f55fd1d16d015fd1de527b02b0'-->


	
	
