导航

ibatis.net 循环

Posted on 2019-03-04 00:35  高山老王  阅读(321)  评论(0编辑  收藏  举报

if (oReqV[0]["tag"] != null && !string.IsNullOrEmpty(oReqV[0]["tag"].ToString()))
{
string[] str = StringHelps.SplitString(oReqV[0]["tag"].ToString(), ",");
List<string> personList = new List<string>();
foreach(string s in str)
{
personList.Add(string.Format("%{0}%",s));
}
ht.Add("TagList", personList);
}

 

<isPropertyAvailable property="TagList">
<isNotEmpty property="TagList">
<iterate property="TagList" prepend="AND" open="(" close=")" conjunction="OR">
<![CDATA[Tag LIKE #TagList[]# ]]>
</iterate>
</isNotEmpty>
</isPropertyAvailable>