Ibatis.net结合oracle批量删除实现代码

编程学习 2021-07-04 22:40www.dzhlxh.cn编程入门
本文介绍Ibatis.net结合oracle实现批量删除写法,并提供简单的示例代码供参考
要删除的字符串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>

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板