1. 程式人生 > >ibatis.net 循環

ibatis.net 循環

pro null empty orm .net split 循環 form ati

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>

ibatis.net 循環