Mybatis的choose when otherwise

<select id="getCount" resultType="int">
select count(1) from
<choose>
<when test='type!=null and type=="2"'> (或者<when test="type!=null and type=='2'.toString()">)
t_evaluate_training t,t_training_org tt
</when>
<otherwise>
t_evaluate_company t,t_company_info tt
</otherwise>
</choose>
where t.company_id=tt.id
and t.del_flag=1
and tt.del_flag=1
<if test="userId!=null">
and t.evaluate_user=#{userId}
</if>
</select>
上一篇:c#创建文件( File.Create() )后对文件写操作出错的分析


下一篇:IOS UI 第五篇:基本UI