确认
当前程序版本
3.5.10
问题描述
代码
@Select("""
<script>
select * from `user`
<where>
<if test="true">
1=1
</if>
and 2=2
<if test="true">
and 3=3
</if>
</where>
</script>
""")
List<Map<String, Object>> test();
生成sql
select * from `user` WHERE 1=1and 2=2and 3=3
and 2=2前后缺少空格
正确的sql应该是
select * from `user` WHERE 1=1 and 2=2 and 3=3
使用3.5.9没问题,原生mybatis:3.5.19也没问题
应该是这里改出的问题 https://github.com/baomidou/mybatis-plus/commit/eddde545e118bb6688bd099dd0f6cf117882dbca#diff-c2e89b02c95139afd78ac601427433fa9aa044985ecc89fb9f2528eae9a39fb1L445
详细堆栈日志
No response
Comment From: nieqiurong
先下载这个包替换下试试,中央仓库不能发快照.
Comment From: nieqiurong
已发布 3.5.10.1