mybatis批量删除
<deleteid="deleteCTQ"parameterType="java.lang.String">DELETE FROM sqm_product_ctq_current where guid in
<foreachitem="idItem"collection="array"open="("separator=","close=")">
#{idItem}
</foreach>
</delete>
sqm_product_ctq_current表名
guid字段名
collection里表示类型,这里是array,还可以是list
idItem不用管,相当于一个变量
这个是写在xxxMapper.xml里的
id="deleteCTQ"在xxxMapper.java里需要有对应的方法
public
void deleteCTQ(String[] ctqGuids);
这里传进来的参数就是一个字符串型的数据
页:
[1]