xml代碼java
<insert id="batchInsert" parameterType="com.hysoft.kwgstr.domain.Concept" > insert into KWG_STR_CONCEPT (CPT_ID, IDF_CODE, CPT_CODE, CPT_NAME,MODEL_ID,ONTOLOGY_SHOW,ONTOLOGY_IDT,CATEGORY) <foreach collection="list" item="item" index="index" separator="union all"> select #{item.cptId,jdbcType=CHAR}, #{item.idfCode,jdbcType=VARCHAR}, #{item.cptCode,jdbcType=VARCHAR},#{item.cptName,jdbcType=CLOB}, #{item.modelId,jdbcType=VARCHAR},#{item.ontologyShow,jdbcType=CLOB}, #{item.ontologyIdt,jdbcType=CLOB},#{item.category,jdbcType=VARCHAR} from dual </foreach> </insert>
dao層java代碼dom
//批量保存 int batchInsert(@Param("list")List<Concept> plist);