Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
mybatis_sql_templete
<select id="empFind" resultType="employee">
SELECT * FROM EMP
WHERE 1=1
<choose>
<when test="sal >= 5000">
and job ='PRESIDENT'
</when>
<when test="sal >=3000">
and job ='manager'
</when>
<when test="sal >=2000">
and job='ANALYST'
</when>
<otherwise>
and job in('clerk','salesman')
</otherwise>
</choose>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.