当前位置:Gxlcms > 数据库问题 > XML 配置文件 (一) 动态SQL

XML 配置文件 (一) 动态SQL

时间:2021-07-01 10:21:17 帮助过:40人阅读


<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jt.mapper.ItemMapper">
<!--留着以后用 -->
<!--批量删除商品信息 Long[] ids

collection: 遍历集合的名称
参数类型 Map collection="map中的key"
Array类型数组 collection="array"
List集合类型 collection="list"

item: 当前遍历的变量
-->

<delete id="deleteByIds">
DELETE FROM tb_item WHERE id IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</delete>
</mapper>

XML 配置文件 (一) 动态SQL

标签:space   lis   批量删除   bat   doctype   strong   public   mes   tor   

人气教程排行