您现在的位置是:网站首页>JavaJava
MyBatis:update动态sql的使用
左鹏03-06 12:33:57【Java】4433人已围观
简介配置xml文件,使用set if 标签<update id="save" parameterType="ProductCategory"> update product_category <!-- set会自动去掉最后一个, --> &n
配置xml文件,使用set if 标签
<update id="save" parameterType="ProductCategory"> update product_category <!-- set会自动去掉最后一个, --> <set> <if test="categoryName!=null and categoryName!=''">category_name=#{categoryName},</if> <if test="categoryType!=null and categoryType!=''">category_type=#{categoryType},</if> </set> where category_id=#{categoryId} </update>
就可以了
点击排行

本栏推荐

猜你喜欢
站点信息
- 建站时间:2018-09-18
- 网站程序:Laravel
- 主题模板:《今夕何夕》
- 文章统计:85条
- 统计数据:
- 微信公众号:扫描二维码,关注我们
