sqlserver插入2892条出错
//batchLastIndex小于size本身customerAllList 75 batchCount 20 batchLastIndex 20
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.SIMPLE);
sqlSession.insert("com.idengyun.module.customer.dao.NewlyIncreasedToNCDao.saveAllCustomerListToNC",
customerAllList.subList(i, batchLastIndex));
sqlSession.commit();
sqlSession.close();
<insert id="saveAllCustomerListToNC" parameterType="java.util.List"
useGeneratedKeys="true" keyProperty="id">
INSERT INTO [dbo].[custdoc] (
orgcode,
appcustcode,
custname,
custclass,
tel1,
ts,
status
)
VALUES
<foreach collection="list" item="m" index="index" separator=",">
(
#{ m.orgcode },#{ m.appcustcode },#{ m.custname },'C1',#{ m.tel1
},#{m.ts},'0'
)
</foreach>
</insert>