Mysql批量操作2(批量删除)

来源:互联网 发布:java免费发送短信插件 编辑:程序博客网 时间:2024/05/26 17:45

前一篇写了批量查询,本篇主要写批量删除语句。如果有不明白sql语句中的字段意思,建议通过前一篇批量查询进行了解。


直接上代码:


sql语句的写法:


    <select  id = "XXX(方法名)"  parameterType = "hashmap" >


             delete  from  table(table写自己的表名称)


             where


             id  in


             <foreach collection="idList"  item="item" index ="index" open="(" separator="," close=")">


                        #{item}


             </foreach>


    </select>


根据id批量删除数据



原创粉丝点击