Mybatis框架-24:动态SQL——set标签、foreach标签

梦里梦外; 2022-01-21 10:21 407阅读 0赞

set标签

可以去掉语句最后的那个逗号

  1. <update id="updateCustomer">
  2. update `customer`
  3. <set>
  4. cust_name=#{cust_name},cust_profession=#{cust_profession},
  5. </set>
  6. where cust_id=#{cust_id}
  7. </update>

foreach标签

做范围查询的时候,可以将传进来的范围值通过foreach标签 进行遍历

支持三种类型的传入

  • list
  • 对象属性
  • 数组

发表评论

表情:
评论列表 (有 0 条评论,407人围观)

还没有评论,来说两句吧...

相关阅读