首页 > 数据库技术 > 详细

mybatis sql语句转化

时间:2018-05-19 22:59:40      阅读:275      评论:0      收藏:0      [点我收藏+]
SELECT
<include refid="Base_Column_List"/>
FROM
mmall_product
<where>
<if test="productName != null">
and name=#{productName}
</if>
<if test="productId">
and id=#{productId}
</if>
</where>
<where>标签对作用:如果where标签下的if标签成立,则将成立的第一个if标签下的and或or转为 where

mybatis sql语句转化

原文:https://www.cnblogs.com/Dar-/p/9061943.html

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