select c.*,u.realname,u.username from t_bus_holiday c left join t_s_base_user u on c.userid = u.id where 1=1 <#if (holidayDao.username )?? && holidayDao.username ?length gt 0> /* 转正人编号 */ and u.username like CONCAT('%', :holidayDao.username ,'%') <#if (holidayDao.realname )?? && holidayDao.realname ?length gt 0> /* 转正人名称 */ and u.realname like CONCAT('%', :holidayDao.realname ,'%') <#if ( holidayDao.bpmStatus )?? && holidayDao.bpmStatus ?length gt 0> /* 申请状态*/ and c.bpm_status = :holidayDao.bpmStatus <#if ( holidayDao.holidayType )?? && holidayDao.holidayType ?length gt 0> /* 申请状态*/ and c.holiday_type = :holidayDao.holidayType <#if ( holidayDao.orgIdList )?? && holidayDao.orgIdList ?size gt 0> /* 所属单位*/ and c.belong_unitid in( <#list holidayDao.orgIdList as item> '${item}' <#if item_has_next>, ) <#if ( holidayDao.applyDate_begin )?? && holidayDao.applyDate_begin ?length gt 0> /* 申请日期 */ and c.apply_date >= :holidayDao.applyDate_begin <#if ( holidayDao.applyDate_end )?? && holidayDao.applyDate_end ?length gt 0> /* 申请日期 */ and c.apply_date <= :holidayDao.applyDate_end <#if ( holidayDao.holidayEtime )??> /* 转正日期 */ and to_days(c.holiday_stime) <= to_days(:holidayDao.holidayEtime) <#if ( holidayDao.holidayStime )??> /* 转正日期 */ and to_days(c.holiday_etime) >= to_days(:holidayDao.holidayStime) <#if ( useridList )?? && useridList ?size gt 0 && ( orgidList )?? && orgidList ? size gt 0 > and ((c.applicant_id in( <#list useridList as item> '${item}' <#if item_has_next>, ) and c.belong_unitid in( <#list orgidList as item> '${item}' <#if item_has_next>, )) or c.applicant_id in( <#list useridList1 as item> '${item}' <#if item_has_next>, )) <#else> and c.applicant_id in( <#list useridList1 as item> '${item}' <#if item_has_next>, ) and c.delete_flag = 0 ORDER BY c.create_date DESC,c.holiday_stime desc