160406、mybatis批量删除

<deleteid="deleteCTQ" parameterType="java.lang.String">

DELETE FROM sqm_product_ctq_current where guid in

 

<foreach item="idItem"collection="array"open="("separator=","close=")">

#{idItem}

</foreach>

</delete>

 

 

 

sqm_product_ctq_current 表名

guid  字段名

collection里表示类型,这里是array,还可以是list

idItem不用管,相当于一个变量

 

这个是写在xxxMapper.xml里的

id="deleteCTQ"在xxxMapper.java里需要有对应的方法

 

void deleteCTQ(String[] ctqGuids);

这里传进来的参数就是一个字符串型的数据

 

posted @ 2016-04-06 22:03  目标奔雷手  阅读(209)  评论(0编辑  收藏  举报