表映射配置类
public class ExcelToTableConfig {
private int startRow;
private int maxSheetRows;// excel单sheet最大记录数
private String tableName;
private List<Column> columnList;
private String chineseName;
public int getStartRow() {
return startRow;
}
public void setStartRow(int startRow) {
this.startRow = startRow;
}
public int getMaxSheetRows() {
return maxSheetRows;
}
public void setMaxSheetRows(int maxSheetRows) {
this.maxSheetRows = maxSheetRows;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public List<Column> getColumnList() {
return columnList;
}
public void setColumnList(List<Column> columnList) {
this.columnList = columnList;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
}
列映射配置类
public class Column {
private int index;
private String fieldName;
private String colName;
private String colType;
private String isHidden;
private String isWhere;
private String chineseName;
private int length;
private String readOnly;
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getColName() {
return colName;
}
public void setColName(String colName) {
this.colName = colName;
}
public String getColType() {
return colType;
}
public void setColType(String colType) {
this.colType = colType;
}
public String getIsHidden() {
return isHidden;
}
public void setIsHidden(String isHidden) {
this.isHidden = isHidden;
}
public String getIsWhere() {
return isWhere;
}
public void setIsWhere(String isWhere) {
this.isWhere = isWhere;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public String getReadOnly() {
return readOnly;
}
public void setReadOnly(String readOnly) {
this.readOnly = readOnly;
}
}
xml配置
<?xml version="1.0" encoding="UTF-8"?>
<table tableName="ytby_hd_act_order" startRow="1" chineseName="奖品记录">
<column index="0" colName="ID" chineseName ="内码" length="12" colType="long" isHidden="Yes" isWhere="Yes"></column>
<column index="1" colName="PRIZE_CODE" chineseName="兑奖码" length="16" colType="String" isHidden="No" isWhere="No"></column>
</table>