SELECT u.realname username,a.pjt_id pid,d.description pjName,d1.departname pidName,a.yearmonth
,CONCAT(floor(a.datum_work_duration/60) ,'小时',floor(a.datum_work_duration - floor(a.datum_work_duration/60)*60),'分钟') datumWorkDuration
,CONCAT(floor(a.attendance_duration/60) ,'小时',floor(a.attendance_duration - floor(a.attendance_duration/60)*60),'分钟') attendanceDuration
,convert(a.attendance_rate,decimal(10,2)) attendanceRate 
from t_bus_user_attendance_statistics a
LEFT JOIN t_s_depart d
ON a.pjt_id = d.ID
LEFT JOIN t_s_depart d1
ON a.dept_id = d1.ID
LEFT JOIN t_s_base_user u
ON a.user_id = u.id
where 1=1
<#if ( statsDao.yearMonthList )?? && statsDao.yearMonthList ?size gt 0>
			and a.yearmonth in(
			<#list statsDao.yearMonthList as item>        
			   '${item}'
			 <#if item_has_next>,</#if>
			 </#list>
			)
</#if>
<#if (statsDao.pid)??>
		 and a.pjt_id =:statsDao.pid
</#if>
<#if (statsDao.pid)??>
		 and a.dept_id =:statsDao.did
</#if>
order by attendanceRate asc