mapper.xml记几个用法

时间:2021-08-23 14:49:40   收藏:0   阅读:22

1.多参数不能使用parameterType,SQL语句中直接用#{index},是第几个就用第几个的索引,索引从0开始

例:

dao中

  void userDeleteById(int startId, int endId);

mapper.xml中

<delete id="userDeleteById">
delete from users where id between #{0} and #{1}
</delete>
<!--此处#{0}表示startId,#{1}表示endId-->

 

原文:https://www.cnblogs.com/wx23/p/15175546.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!