MybatisX icon indicating copy to clipboard operation
MybatisX copied to clipboard

提一个bug,关于自动生成delete语句

Open Ellioben opened this issue 2 years ago • 0 comments

Repruduce:

  1. 通过idea的database打开指定需要生成orm的表
  2. 右键选择mybatis-x generate生成mapper.xml和mapper层
  3. 在mapper层使用deleteById,自动生成mybatis的xml的模块代码

问题:

自动生成的delete语句,where id = #{id} 会被放在if(id!=null && id == "")的语句里。

如果id为空,则是不加条件的全表删除 😰

Ellioben avatar Feb 10 '23 07:02 Ellioben