mybatis中使用foreach构造多like查询及批量插入
来源:互联网 发布:网络安全技术身份认证 编辑:程序博客网 时间:2024/06/09 22:04
使用foreach批量查询:
<!--wc根据商品分类名字,查询检测能力模糊得到数据 --><select id="likeGoodsType" resultMap="goodstypeMap">SELECT <include refid="proAll"/> FROM goods_type WHERE 1>2 OR <foreach collection="array" item="item" index="index" separator="OR"> `NAME` LIKE CONCAT('%',#{item},'%') </foreach></select>使用foreach批量插入:
<!--店铺入驻时,插入多条待检项目 --><insert id="saves">insert into store_detectability(id,store_id,test_name,test_price,parent_id,goods_type_id)values<foreach collection="list" item="item" index="index" separator="," > (#{item.id},#{item.storeId},#{item.testName},#{item.testPrice},#{item.parentId},#{item.goodsTypeId}) </foreach> </insert>
ps:使用单个list或者array传参时无需指定parameterType
详细参数请参考:http://blog.csdn.net/bareheadzzq/article/details/8006131
使用foreach批量插入
1 0
- mybatis中使用foreach构造多like查询及批量插入
- myBatis使用foreach批量插入数据
- mybatis用foreach批量插入
- Mybatis中使用like模糊查询
- MyBatis中like查询语句的使用
- Mybatis中使用like和%模糊查询
- Mybatis-批量查询&&批量插入
- mybatis+oracle+foreach list 批量插入数据
- MyBatis foreach语句批量插入数据
- mybatis在spring中使用批量插入
- mybatis批量操作中<foreach>标签的使用
- MyBatis中批量插入
- MyBatis中批量插入
- MyBatis中批量插入
- MyBatis直接执行SQL查询及批量插入数据
- MyBatis直接执行SQL查询及批量插入数据
- MyBatis直接执行SQL查询及批量插入数据
- MyBatis直接执行SQL查询及批量插入数据
- 第1周 C语言及程序设计初步 例程-4 for语句案例
- codeforce 659E (dfs 水~)
- 两个嵌套的div margin-top无效的解决办法
- 联系人数据库contacts2.db介绍
- C++计时器
- mybatis中使用foreach构造多like查询及批量插入
- Asynctask解析
- Eclipse反编译插件安装
- 匈牙利算法
- 解析spring的IOC、AOP?
- 贪心算法 problem I(1009)
- 【poj 3468】A Simple Problem with Integers 题意&题解&代码(C++)
- C++ COM
- shopNC注册后无法登陆的问题