欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mybatis_批量插入参数List_Map_String,Object

程序员文章站 2022-06-30 20:48:38
...
mybatis_批量插入参数List<Map<String,Object>>


Dao

       int insertCoachMessageInfo(@Param("listInsert")List<Map<String,Object>> listInsert);

xml

      insert into coach_message_info(company_id,coach_info_id,title,content,is_checked,create_time)  
               values 
               <foreach collection="listInsert" separator="," item="map">
                       (#{map.companyId},#{map.coachInfo},#{map.title},#{map.content},#{map.is_checked},#{map.create_time})
               </foreach>