要刪除的字符串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>