批量插入
Dao.java:
int nameId(List<entity> entityList);
Xml
<insert id="nameId" parameterType="java.util.List">
INSERT ALL
<foreach collection="list" item="entity" index="index" separator=" ">
INTO JPT_INPUT_BILL_INFO (
<if test="entity.id!= null and entity.id != ''">"ID",</if>
...
"STATUS"
) VALUES (
<if test="entity.id!= null and entity.id!= ''"> #{entity.id,jdbcType=VARCHAR},</if>
...
'0'
)
</foreach>
SELECT 1 FROM DUAL
</insert>