Mybatis参数类型传递总结

1、List类型
dao层:int batchAddCarNoticeLog(List noticeList);
mapper文件:(批量插入)

insert into biz_car_notice_log
(notice_id, car_id, update_user_no,
need_notice_user_no, goods_id, goods_name,
number, add_flag, notice_flag,
create_time, update_time, delete_flag
)
values

(#{item.noticeId,jdbcType=VARCHAR}, #{item.carId,jdbcType=VARCHAR}, #{item.updateUserNo,jdbcType=VARCHAR},
#{item.needNoticeUserNo,jdbcType=VARCHAR}, #{item.goodsId,jdbcType=VARCHAR}, #{item.goodsName,jdbcType=VARCHAR},
#{item.number,jdbcType=INTEGER}, #{item.addFlag,jdbcType=VARCHAR}, #{item.noticeFlag,jdbcType=VARCHAR},
#{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.deleteFlag,jdbcType=VARCHAR}
)
2、Map类型
Dao接口:List getCarNoticeListByCarIdAndUserNo(Map map)
mapper映射文件
3、Mapper映射文件foreach使用




你可能感兴趣的:(Mybatis)