使用MyBatis-Plus生成自定義的mapper時候遇到特殊字符${}需要轉義。如:
${ew.customSqlSegment}
應該寫成
<#noparse>${ew.customSqlSegment}</#noparse>
<#noparse>的作用:FreeMarker 不會在這個指令體中間尋找FTL標籤, 插值和其他特殊的字符序列,除了noparse的結束標記。
FreeMaker官方文檔鏈接:http://freemarker.foofun.cn/ref_directive_noparse.html