MyBatis-数据操作

36次阅读

共计 463 个字符,预计需要花费 2 分钟才能阅读完成。

MyBatis 基于注解的批量插入数据
    @Insert({"<script>",
            "insert into tmc_constract_detail",
            "<foreach collection='list'item='record'index ='index'separator=','>",
            "values(",
            "#{record.constractId,jdbcType=VARCHAR}, #{record.modifyCode,jdbcType=VARCHAR}," +
                    "#{record.constractStatus,jdbcType=VARCHAR}, #{record.updateDate,jdbcType=DATE}," +
                    "#{record.userId,jdbcType=VARCHAR}, #{record.description,jdbcType=VARCHAR}",
            "</foreach>",
            ")</script>"})
    void updatesStatus(List<TmcConstractDetail> records);

正文完
 0