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 ...
随机推荐
- 最新Android系统版本与API等级对应关系表
最新Android系统版本与API等级对应关系表 从Android官网拷过来的,方便查阅... 官网地址:https://developer.android.com/guide/topics/mani ...
- h5上传图片及预览
第一次做图片上传,记录一些问题. 1,图片的base64编码就是可以将一副图片数据编码成一串字符串,使用该字符串代替图像地址.而网页上的每一个图片,都是需要消耗一个http请求下载而来的,使用base ...
- ASP.NET MVC 让@Html.DropDownList显示默认值
在使用@Html.DropDownList的过程中,发现它的用法很局限,比如在加载的时候显示设定的默认项或者调整它的显示样式,在网上查了一些资料,终于把这个问题解决了. 一.View代码 @using ...
- MVC View中获取action、controller、area名称
获取控制器名称: ViewContext.RouteData.Values["controller"].ToString(); 获取Action名称: ViewContext.Ro ...
- J2EE或MyEclipse简单配置以及第一个web页面
首先打开你下载安装好的MyEclipse,配置你开发需要的环境. 大致分为3步:①配置编码:Window-->preferences-->General-->Workspace--& ...
- 0038 Java学习笔记-多线程-传统线程间通信、Condition、阻塞队列、《疯狂Java讲义 第三版》进程间通信示例代码存在的一个问题
调用同步锁的wait().notify().notifyAll()进行线程通信 看这个经典的存取款问题,要求两个线程存款,两个线程取款,账户里有余额的时候只能取款,没余额的时候只能存款,存取款金额相同 ...
- GridView 树形结构分组的功能
在“会飞的鱼”博客中看到GridView实现树形结构的代码,经过修改,添加了树形结构中的复选框功能,欢迎吐槽. 源地址:http://www.cnblogs.com/chhuic/archive/20 ...
- tomcat优化
tomcat优化:vim catalina.sh添加:JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -X ...
- 《WePayUI组件设计的秘密》——2016年第一届前端体验大会分享
本文是博主参加第一届前端体验大会 | 物勒工名做的分享<WePayUI组件设计的秘密>,内容主要分为2个部分: 一.浅析UI库/框架的未来 讨论的UI库或者框架,主要包含展示和交互的css ...
- python学习2
1.input()返回的是字符串, 如果想读入一个数字,应该用int()转化 2.循环的写法与C不同的地方就是,for while等写完之后在那一行后面要加上一个冒号,这是比较特殊的地方. 还有就是r ...