SELECT u.pjt_id pid,d.departname pName,bu.realname pidName,u.yearmonth ,u.earlymonth_total earlyMonthTotal ,u.endmonth_total endMonthTotal ,u.entry_total entryTotal,u.leave_total leaveTotal ,u.flow_proportion flowProportion from t_bus_proj_user_statistics u LEFT JOIN t_s_depart d ON u.pjt_id = d.ID LEFT JOIN t_s_base_user bu ON u.pm_id = bu.ID where 1=1 <#if ( userEntity.attYear )??> and u.yearmonth like CONCAT('%', :userEntity.attYear ,'%') <#if ( userEntity.pid )??> and u.pjt_id =:userEntity.pid order by u.yearmonth