1,将数组的长度定义成集合的长度
List<ElemeterInfo> eleSeqList = elemeterMapper.getEleSeqByterminaluuid(terminaluuid);
String[] eleseqArray = new String[eleSeqList.size()];
2,循环集合
int i = 0; for (ElemeterInfo elemeterInfo : eleSeqList) { Integer eleseq = elemeterInfo.getSerialportseq(); eleseqArray[i++]=String.valueOf(eleseq); }