Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lihongjie0209/eb3c53cc504b10746fe5171a5ccb28b1 to your computer and use it in GitHub Desktop.
Save lihongjie0209/eb3c53cc504b10746fe5171a5ccb28b1 to your computer and use it in GitHub Desktop.
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