【minidao】请教一个minidao使用freemark拼写sql的问题。
select t.id,(select count(s.exam_score_zf)+1
from school_exam_score s
where s.exam_score_zf>t.exam_score_zf ands.school_exam=:examid
<#if school_klass ?exists && school_klass ?length gt 0>
and s.school_klass =: school_klass
</#if>
) rank
from school_exam_score t
where t.school_exam=:examid
<#if school_klass ?exists && school_klass ?length gt 0>
and t.school_klass =: school_klass
</#if>
ORDER BY t.exam_score_zf DESC;
上面的语句中count(s.exam_score_zf)如何用freemark中的if语句控制为不同的属性?
可以像下面一样吗?
count(
<#if kemu=="语文">
s.exam_score_yw
</#if>
)+1
可以,不过kemu得是传递进来的参数
页:
[1]