首页 > 其他 > 详细

mabatis多个参数的使用

时间:2020-05-28 09:26:53      阅读:37      评论:0      收藏:0      [点我收藏+]
    Users findOne(@Param(value = "sname") String name , @Param(value = "ssex") String ssex);

    void update(Users user);
    void updateOne(String name);
  <select id="findOne" resultType="users"  >
        select * from stu where 1 = 1
        <if test="_parameter != null">
         and   sname = #{sname}
        </if>

        <if test="_parameter != null">
            and ssex = #{ssex}
        </if>
    </select>

如上在参数列表中添加@Param(value = "你想要的别名")在if test中写上_parameter != null即可    原因等以后知道再补充

mabatis多个参数的使用

原文:https://www.cnblogs.com/guosai1500581464/p/12977825.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!