SELECT distinct d.fappraiseeid,d.fappraisee,d.fstate,d.fyear,d.forder,d.flevelFROM tb_scoredetail dwhere case (select flevel from tb_user where fusername='${fr_username}') when 1 then d.flevel=3 and d.fyear=${year} ${if(len(appraisee) == 0,"","and d.fappraiseeid = '" + appraisee + "'")} when 2 then d.flevel=3 and d.fyear=${year} ${if(len(appraisee) == 0,"and d.fappraiseeid = ''","and d.fappraiseeid = '" + appraisee + "'")} endorder by d.forder asc