public int batchCreate(List<InquiryData> list, Date countTime) { if(list != null && list.size()>0) { InquiryData inquiryData = new InquiryData(); String sql = inquiryData.getCreateObjSql(); String tableName = InquiryData.getTableName_(countTime); sql = sql.replace(inquiryData.getTableName(), tableName); BeanPropertySqlParameterSource[] bp = new BeanPropertySqlParameterSource[list.size()]; // Object[] obj = list.toArray(); Calendar cal = Calendar.getInstance(); for(int i = 0; i<list.size(); i++) { cal.setTime(countTime); InquiryData data = list.get(i); data.setId(UUID.randomUUID().toString().replaceAll("-", "")); data.setHours(cal.get(Calendar.HOUR_OF_DAY)); data.setDay(cal.get(Calendar.DAY_OF_MONTH)); data.setMonth(cal.get(Calendar.MONTH)+1); data.setYear(cal.get(Calendar.YEAR)); data.setCreateTime(countTime); bp[i] = new BeanPropertySqlParameterSource(data); } this.getSimpleJdbcTemplate().batchUpdate(sql, bp); } return 1; }