mybatis中使用foreach构造多like查询及批量插入

使用foreach批量查询:

	
	
使用foreach批量插入:


		insert into store_detectability(id,store_id,test_name,test_price,parent_id,goods_type_id)
			values
		 
		    (#{item.id},#{item.storeId},#{item.testName},#{item.testPrice},#{item.parentId},#{item.goodsTypeId}) 
		 

ps:使用单个list或者array传参时无需指定parameterType
详细参数请参考:http://blog.csdn.net/bareheadzzq/article/details/8006131
使用foreach批量插入

你可能感兴趣的:(jsp,mybatis,springMvc)