jxl 依据xml映射配置 导入导出excel (1)

表映射配置类

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>


转载于:https://my.oschina.net/u/1379199/blog/541987

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值