<#--按照项目pid和月度yearmonth查询月度排班弹窗页面的数据-->

SELECT
	ao.id,
	ao.pjt_postid AS pjtPostId,
	ao.yearmonth,
	ao.shiftid,
	ao.userid,
	ao.runway,
	ao.deploy_people_num AS deployPeopleNum,
	ao.attendance_cycle AS attendanceCycle,
	ao.create_name AS createName,
	ao.create_by AS createBy,
	ao.create_date AS createDate,
	ao.update_name AS updateName,
	ao.update_by AS updateBy,
	ao.update_date AS updateDate,
	ao.sys_org_code AS sysOrgCode,
	ao.sys_company_code AS sysCompanyCode
FROM
	t_bus_arrangeduty_operate ao where 1=1
	
<#if (arrangeDutyOperateDto.yearmonth )?? && arrangeDutyOperateDto.yearmonth ?length gt 0>
	 and ao.yearmonth = :arrangeDutyOperateDto.yearmonth 
<#else >
	 and ao.yearmonth=null 
</#if>

<#if (arrangeDutyOperateDto.pid )?? && arrangeDutyOperateDto.pid ?length gt 0>
	 and ao.pid = :arrangeDutyOperateDto.pid
<#else >
	 and ao.pid=null 
</#if>
	
	
<#-- <#if ( arrangeDutyOperateDto.arrangeDutyOperateIdList )?? && arrangeDutyOperateDto.arrangeDutyOperateIdList ?size gt 0>
	and ao.id in(
	<#list arrangeDutyOperateDto.arrangeDutyOperateIdList as item>        
	   '${item}'
	 <#if item_has_next>,</#if>
	 </#list>
	)
<#else >
	and ao.id=null
</#if> -->

order by ao.create_date desc









