" left join tm_paper_link_branch plb on plb.ln_pid = b.p_id "+
" where plb.ln_buid= #{userId}"+
" and corp_id = #{corpId}"+
"<if test= \" paperName != null and paperName != ''\">and b.p_name like concat('%',#{paperName},'%') </if> "+
"<if test= \" examType != null and examType != '' and examType == '0'.toString()\"> and b.p_id not in(select e_pid from tm_examdata where e_uid = #{userId}) and now() > b.p_endtime </if> "+
"<if test= \" examType != null and examType != '' and examType == '1'.toString()\"> and a.e_status = 2 or a.e_status = 1 </if> "+
"<if test= \" examType != null and examType != '' and examType == '2'.toString()\"> and b.p_id not in(select e_pid from tm_examdata where e_uid = #{userId}) and now() < b.p_endtime </if> "+
"<if test= \" examType != null and examType != '' and examType == '3'.toString()\"> and a.e_status = 0 </if> "+
"<if test= \" examResult != null and examResult != '' and examResult == '0'.toString() \"> and a.e_score < b.p_pass_score </if> "+
"<if test= \" examResult != null and examResult != '' and examResult == '1'.toString() \"> and a.e_score >= b.p_pass_score </if> "+
"<if test= \" scoreStart != null and scoreStart != '' \"> and a.e_score >= #{scoreStart} </if> "+
"<if test= \" scoreEnd != null and scoreEnd != '' \"> and a.e_score <= #{scoreEnd} </if> "+
"<if test= \" consumeTimeStart != null and consumeTimeStart != '' \"> and TIMESTAMPDIFF(MINUTE, a.e_starttime, a.e_endtime) >= #{consumeTimeStart} </if> "+
"<if test= \" consumeTimeEnd != null and consumeTimeEnd != '' \"> and TIMESTAMPDIFF(MINUTE, a.e_starttime, a.e_endtime) <= #{consumeTimeEnd}</if> "+
"<if test= \" examTimeStart != null and examTimeStart != '' \"> and a.e_starttime >= #{examTimeStart} </if> "+
"<if test= \" examTimeEnd != null and examTimeEnd != '' \"> and a.e_starttime <= #{examTimeEnd} </if> "+
"<if test= \" handInTimeStart != null and handInTimeStart != '' \"> and a.e_endtime >= #{handInTimeStart} </if> "+
"<if test= \" handInTimeEnd != null and handInTimeEnd != '' \"> and a.e_endtime <= #{handInTimeStart} </if> "+
" ORDER BY corp_id "+
"<if test= \" scoreSort != null and scoreSort != '' and scoreSort == '0'.toString()\">, a.e_score asc </if> "+
"<if test= \" scoreSort != null and scoreSort != '' and scoreSort == '1'.toString()\">, a.e_score desc </if> "+
"<if test= \" examTimeSort != null and examTimeSort != '' and examTimeSort == '0'.toString()\">,a.e_starttime asc </if> "+
"<if test= \" examTimeSort != null and examTimeSort != '' and examTimeSort == '1'.toString()\">,a.e_starttime desc </if> "+
"<if test= \" handInTimeSort != null and handInTimeSort != '' and handInTimeSort == '0'.toString()\">,a.e_endtime asc </if> "+
"<if test= \" handInTimeSort != null and handInTimeSort != '' and handInTimeSort == '1'.toString()\">, a.e_endtime desc </if> "+