乐趣区

MyBatis-数据操作

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);
退出移动版