导航栏

mybatis批量插入List

mysql批量插入数据

Mapper.xml

 <insert id="addTask" parameterType="java.util.LinkedList">
        insert into tasks(ffmpeg) 
        values
        <foreach collection="list" item="item"  index="index" separator=",">
            (
            #{item}
            )
        </foreach>
</insert>

借鉴链接

mysql读取固定条数据

mapper

 <select id="getTasks" resultType="String">
        select ffmpeg from tasks limit 5;
    </select>

mysql删除固定条数据

delete from tasks limit 5;

借鉴博客

posted @ 2020-12-07 14:41  RickZ  阅读(728)  评论(0编辑  收藏  举报