Ibatis.net结合oracle批量删除实现代码
时间:2020-11-04 11:02:11|栏目:.NET代码|点击: 次
要删除的字符串ID为
string SDSALES_IDString = 1,2,3,4,5,6,7
//转成Array
Array array = SDSALES_IDString.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToArray<string>();
在模型定义一个 public Array SDSALES_IDs {get;set;}
XML:
<delete id="DeleteManyT_LABEL_SDSALES" parameterClass="T_LABEL_SDSALES">
DELETE FROM T_LABEL_SDSALES WHERE
<isNotNull property="SDSALES_IDs">
SDSALES_ID IN
<iterate property="SDSALES_IDs" conjunction="," open="(" close=")">
#SDSALES_IDs[]#
</iterate>
</isNotNull>
</delete>
复制代码 代码如下:
string SDSALES_IDString = 1,2,3,4,5,6,7
//转成Array
Array array = SDSALES_IDString.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToArray<string>();
在模型定义一个 public Array SDSALES_IDs {get;set;}
XML:
复制代码 代码如下:
<delete id="DeleteManyT_LABEL_SDSALES" parameterClass="T_LABEL_SDSALES">
DELETE FROM T_LABEL_SDSALES WHERE
<isNotNull property="SDSALES_IDs">
SDSALES_ID IN
<iterate property="SDSALES_IDs" conjunction="," open="(" close=")">
#SDSALES_IDs[]#
</iterate>
</isNotNull>
</delete>
上一篇:ASP.NET缓存管理的几种方法
栏 目:.NET代码
下一篇:asp.net 禁用viewstate在web.config里
本文标题:Ibatis.net结合oracle批量删除实现代码
本文地址:http://www.codeinn.net/misctech/18931.html