iBatis.net 循环iterate,没有foreach
3.9.4. Iterate Element
This tag will iterate over a collection and repeat the body content for each item in a List
3.9.4.1. Iterate Attributes:
prepend – the overridable SQL part that will be prepended to the statement (optional) |
property – a property of type IList that is to be iterated over (required) |
open – the string with which to open the entire block of iterations, useful for brackets (optional) |
close – the string with which to close the entire block of iterations, useful for brackets (optional) |
conjunction – the string to be applied in between each iteration, useful for AND and OR (optional) |
Table 3.10. Creating a list of conditional clauses
Element | Description |
---|---|
<iterate> | Iterates over a property that is of type IList Example Usage:
<iterate prepend="AND" property="UserNameList" Note: It is very important to include the square brackets[] at the end of the List property name when using the Iterate element. These brackets distinguish this object as an List to keep the parser from simply outputting the List as a string. |
<iterate prepend=" "
open="(" close=")" conjunction=" OR ">
consultation_doctor_team_member_id = #[].consultation_doctor_team_member_id#
and permission_id = #[].permission_id#
</iterate>
1、prepend:前缀的意思
2、open="(" close=")" 使用括号括起来的意思
3、conjunction :表示用or 填充
4、consultation_doctor_team_member_id = #[].consultation_doctor_team_member_id#
and permission_id = #[].permission_id# 下边是循环体
##表示变量,[]表示数据索引,类似于C#代码中[i]
用.获取属性
特此声明,iBatis.net没有foreach,查边官方文档,没有这个api或标签。java版本的有!
sql 监视语句:
EXEC sp_executesql N'SELECT * FROM dbo.t_c_team_member_permission where ( consultation_doctor_team_member_id = @param0 and permission_id = @param1 OR consultation_doctor_team_member_id = @param2 and permission_id = @param3 )',
N'@param0 nvarchar(16),@param1 nvarchar(1),@param2 nvarchar(16),@param3 nvarchar(1)',
@param0 = N'CONDTM0000000033', @param1 = N'1',
@param2 = N'CONDTM0000000032', @param3 = N'1'
困扰了一下午
iBatis.net 循环iterate,没有foreach的更多相关文章
- js forEach参数详解,forEach与for循环区别,forEach中如何删除数组元素
壹 ❀ 引 在JS开发工作中,遍历数组的操作可谓十分常见了,那么像for循环,forEach此类方法自然也不会陌生,我个人也觉得forEach不值得写一篇博客记录,直到我遇到了一个有趣的问题,我们来 ...
- 空循环比较 for foreach array_map array_walk
申请一个数组,然后不断的跑空循环,看看执行时间 for循环 foreach (不使用键) foreach(使用键) array_map array_walk 查看效率速度发现很明显 是foreach更 ...
- 增强的for循环(或foreach)
增强的for循环(也称为foreach循环):不用下标变量,顺序的訪问整个数组.不能以其它顺序訪问数组,或者改变数组的元素. for(elementType element: arrayRefVar) ...
- 手写js代码(一)javascript数组循环遍历之forEach
注:原文地址http://blog.csdn.net/oscar999/article/details/8671546 我这里是仿照学习! 1.js的数组循环遍历 ①数组的遍历首先想到的是for()循 ...
- java for循环增强(foreach)
for循环增强,在此之前还不知道foreach有这样的功能,先鄙视一下自己,留给自己看: 功能: ***若List用foreach : [ for(Student stu : list) ]这种形 ...
- ibatis.net 循环
if (oReqV[0]["tag"] != null && !string.IsNullOrEmpty(oReqV[0]["tag"].ToS ...
- 二维数组遍历的方式(for普通循环遍历、foreach循环遍历、toString方式遍历)
package com.Summer_0421.cn; import java.lang.reflect.Array; import java.util.Arrays; /** * @author S ...
- JavaScript里的循环方法之forEach,for-in,for-of
JavaScript一种直译式脚本语言,是一种动态类型.弱类型.基于原型的语言,内置支持类型.它的解释器被称为JavaScript引擎,为浏览器的一部分,广泛用于客户端的脚本语言,最早是在HTML(标 ...
- JavaScript数组循环遍历之forEach
1. js 数组循环遍历. 数组循环变量,最先想到的就是 for(var i=0;i<count;i++)这样的方式了. 除此之外,也可以使用较简便的forEach 方式 2. forEac ...
随机推荐
- MBProgressHUD 显示后,为何不能点击屏幕其他地方
解决办法: hud.userInteractionEnabled= NO; 就是这么简单粗暴!这个问题 我一定要发到首页候选区! /********************************* ...
- adobe air类app 接入腾讯开放平台移动游戏使用带tencent包名前缀的问题
作者:Panda Fang 出处:http://www.cnblogs.com/lonkiss/p/4209159.html 原创文章,转载请注明作者和出处,未经允许不可用于商业营利活动 ------ ...
- 原创 C++之常量(二)
4常量的内存分配 4.1应用程序的内存结构 一个由C++编译的应用程序,占用的内存可以划分为如下几个部分: 栈(stack).由编译器自动分配释放.存放函数参数和函数里的局部变量(又称自动变量).其操 ...
- SQL Server 2008 阻止保存要求重新创建表的更改问题的设置方法
不是很理解为什么在2008中会加入阻止保存要求重新创建表的更改这个选项.症状表现为修改表结构的时候会"阻止"你.而且我遇到的情况是居然有的时候阻止你,有的时候不阻止你,摸不到头脑. ...
- HOLOLENS 扫描特效 及得出扫描结果(SurfacePlane)
HOLOLENS 扫描特效 及得出扫描结果(SurfacePlane) 要求只扫出地板和墙, 由于地板和墙面积较大 扫描结果 HOLOTOOLKIT老版本点在参数调节PlaneFinding.Find ...
- xcode8权限以及相关设置
我们需要打开info.plist文件添加相应权限的说明,否则程序在iOS10上会出现崩溃. 具体如下图: QQ20160914-0.png 注意,添加的时候,末尾不要有空格麦克风权限:Privacy ...
- 【repost】JavaScript Scoping and Hoisting
JavaScript Scoping and Hoisting Do you know what value will be alerted if the following is executed ...
- 深入C#编程
1.NET框架 1.1.NET框架结构 VB.NET C# F# lronruby others.... .NET FrameWork(FCL) 公共语言进行时(CLR) 操作系统 .NET框架具有两 ...
- [LeetCode] Guess Number Higher or Lower II 猜数字大小之二
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to gues ...
- [LeetCode] Maximum Size Subarray Sum Equals k 最大子数组之和为k
Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If t ...