Mybatis框架-24:动态SQL——set标签、foreach标签
2019-06-09 20:08
369 查看
set标签
可以去掉语句最后的那个逗号
[code]<update id="updateCustomer"> update `customer` <set> cust_name=#{cust_name},cust_profession=#{cust_profession}, </set> where cust_id=#{cust_id} </update>
foreach标签
做范围查询的时候,可以将传进来的范围值通过foreach标签 进行遍历
支持三种类型的传入
- list
- 对象属性
- 数组
[code]<select id="getCustomers" parameterType="integer[]" resultType="com.ctbu.domain.Customer"> select * from `customer` where cust_id in <foreach collection="array" open="(" close=")" separator="," item="ids"> #{ids} </foreach> </select>
相关文章推荐
- MyBatis-动态SQL的if、choose、when、otherwise、trim、where、set、foreach标签的使用
- MyBatis--动态SQL---foreach标签--范型(类)
- 【Mybatis学习笔记】07 动态sql-set/trim/foreach
- Mybatis动态SQL——if,where,trim,choose,set.foreach的用法
- Mybatis的动态sql----where,trim,set,foreach
- Mybatis动态sql中foreach标签的使用
- mybatis动态查询之foreach,sql标签查询
- ssm框架学习---mybatis中动态sql中的foreach片段
- MyBatis-动态SQL的if、choose、when、otherwise、trim、where、set、foreach使用
- Mybatis动态SQL-foreach标签
- MyBatis--动态SQL---foreach标签--数组
- MyBatis代码实例系列-07:Mybatis动态SQL标签(二)---bind、foreach和多数据库厂商支持_databaseId
- SSM框架day02-MyBatis——036 动态SQL-where、037 动态SQL-choose、038 动态SQL-foreach数组、039 动态SQL-foreachList
- 框架学习系列 mybatis 第十五篇 mybatis动态sql及常用标签二
- mybatis动态SQL中的set标签的使用
- 0064 MyBatis动态SQL--choose-when-otherwise--foreach--set--bind
- Mybatis的动态sql----where,trim,set,foreach
- MyBatis-动态SQL的if、choose、when、otherwise、trim、where、set、foreach使用
- mybatis学习--动态sql之foreach标签
- mybatis动态sql中foreach标签的使用