Open
Description
In current feature, it does not support for appending and trimming SQL key-word(e.g. WHERE, AND, SET) like as <where>
and <set>
provided by xml based scripting language.
So, we need to add the no-dynamic phrase (e.g. WHERE 1 = 1
, SET id = id
, etc ...) before dynamic parts. I think it is easy writing but it is troublesome rule.
I hope to be enabled to write as follow:
SELECT * FROM names
/*[# mybatis:where]*/
WHERE
/*[# th:if="${firstName} != null"]*/
firstName = /*[('#{firstName}')]*/ 'Taro'
/*[/]*/
/*[# th:if="${lastName} != null"]*/
AND lastName = /*[('#{lastName}')]*/ 'Yamada'
/*[/]*/
/*[/]*/