Skip to content

Instantly share code, notes, and snippets.

@leohdr
Last active March 26, 2019 07:30
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 leohdr/c790805818c48d494d314064ea404c27 to your computer and use it in GitHub Desktop.
Save leohdr/c790805818c48d494d314064ea404c27 to your computer and use it in GitHub Desktop.
<trim prefix=" and (" prefixOverrides="or " suffix=")">
<choose>
<when test="groupId != null">
or group_id = #{groupId}
</when>
<when test="groupIdList != null and groupIdList.size() > 0 ">
or group_id in
<foreach collection="groupIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</when>
</choose>
</trim>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment