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"
open="(" close=")" conjunction="OR">
username=#UserNameList[]#
</iterate>

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的更多相关文章

  1. js forEach参数详解,forEach与for循环区别,forEach中如何删除数组元素

     壹 ❀ 引 在JS开发工作中,遍历数组的操作可谓十分常见了,那么像for循环,forEach此类方法自然也不会陌生,我个人也觉得forEach不值得写一篇博客记录,直到我遇到了一个有趣的问题,我们来 ...

  2. 空循环比较 for foreach array_map array_walk

    申请一个数组,然后不断的跑空循环,看看执行时间 for循环 foreach (不使用键) foreach(使用键) array_map array_walk 查看效率速度发现很明显 是foreach更 ...

  3. 增强的for循环(或foreach)

    增强的for循环(也称为foreach循环):不用下标变量,顺序的訪问整个数组.不能以其它顺序訪问数组,或者改变数组的元素. for(elementType element: arrayRefVar) ...

  4. 手写js代码(一)javascript数组循环遍历之forEach

    注:原文地址http://blog.csdn.net/oscar999/article/details/8671546 我这里是仿照学习! 1.js的数组循环遍历 ①数组的遍历首先想到的是for()循 ...

  5. java for循环增强(foreach)

    for循环增强,在此之前还不知道foreach有这样的功能,先鄙视一下自己,留给自己看: 功能: ***若List用foreach : [  for(Student stu : list)  ]这种形 ...

  6. ibatis.net 循环

    if (oReqV[0]["tag"] != null && !string.IsNullOrEmpty(oReqV[0]["tag"].ToS ...

  7. 二维数组遍历的方式(for普通循环遍历、foreach循环遍历、toString方式遍历)

    package com.Summer_0421.cn; import java.lang.reflect.Array; import java.util.Arrays; /** * @author S ...

  8. JavaScript里的循环方法之forEach,for-in,for-of

    JavaScript一种直译式脚本语言,是一种动态类型.弱类型.基于原型的语言,内置支持类型.它的解释器被称为JavaScript引擎,为浏览器的一部分,广泛用于客户端的脚本语言,最早是在HTML(标 ...

  9. JavaScript数组循环遍历之forEach

    1.  js 数组循环遍历. 数组循环变量,最先想到的就是 for(var i=0;i<count;i++)这样的方式了. 除此之外,也可以使用较简便的forEach 方式 2.  forEac ...

随机推荐

  1. css选择器的使用详解

    -.css选择器的分类: 二.常用选择器详解: 1.标签选择器: 语法: 标签名 { 属性:属性值; } 代码示例: h1 { color: #ccc; font-size: 28px; } 2.类选 ...

  2. 用application实现一个网页的浏览计数器

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  3. Oracle学习笔记五 SQL命令(三):Group by、排序、连接查询、子查询、分页

    GROUP BY和HAVING子句 GROUP BY子句 用于将信息划分为更小的组每一组行返回针对该组的单个结果 --统计每个部门的人数: Select count(*) from emp group ...

  4. 用C++开发Binder服务

    用C++来实现Binder服务比较麻烦,原因是没有AIDL的辅助,必须手工来写中间的代码. 首先写一个服务类ExampleServer的代码: class ExampleServer : public ...

  5. C#相关开发视频

    Quickly Generate C# Classes from JSON Responses .NET Compiler Platform ("Roslyn") for the ...

  6. mysql 基础 增删改查语句

    MySQL:众多关系型数据库中的一种仓库 --数据库箱子 --表数据库:进入mysql 命令行: mysql -uroot -p查看所有数据库: show databases;创建数据库: creat ...

  7. webstorm对WebGL自动提示

    默认竟然没有勾选上,怪不得提示的时候,有很多webgl接口找不到方法(虽然可以运行).

  8. [LeetCode] Path Sum III 二叉树的路径和之三

    You are given a binary tree in which each node contains an integer value. Find the number of paths t ...

  9. [LeetCode] Factorial Trailing Zeroes 求阶乘末尾零的个数

    Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in log ...

  10. Hibernate 缓存机制浅析

    1. 为什么要用 Hibernate 缓存? Hibernate是一个持久层框架,经常访问物理数据库. 为了降低应用程序对物理数据源访问的频次,从而提高应用程序的运行性能. 缓存内的数据是对物理数据源 ...