给以下代码的@Excel里添加orderNum属性,并赋值,值为字符号数字,且从10开始递增:@Excel(name = "负荷率",groupName = "萨南深冷",fixedIndex = 10) private String snslfhl; @Excel(name = "外输气阀组压力",groupName = "萨南深冷",fixedIndex = 11) private String snslwsqfyl; @Excel(name = "外输轻烃量",groupName = "萨南深冷",fixedIndex = 12) private String snslwsqtl; @Excel(name = "返输轻烃量",groupName = "萨南深冷",fixedIndex = 13) private String snslfsqtl; @Excel(name = "水消耗",groupName = "萨南深冷",fixedIndex = 14) private String snslsxh; @Excel(name = "电消耗",groupName = "萨南深冷",fixedIndex = 15) private String snsldxh; @Excel(name = "醇消耗",groupName = "萨南深冷",fixedIndex = 16) private String snslcxh; @Excel(name = "气消耗",groupName = "萨南深冷",fixedIndex = 17) private String snslqxh; @Excel(name = "加热炉燃料气",groupName = "萨南深冷",fixedIndex = 18) private String snsljrl; @Excel(name = "收烃率",groupName = "萨南深冷",fixedIndex = 19) private String snslstl; @Excel(name = "锅炉燃料气",groupName = "萨南深冷",fixedIndex = 20) private String snslglyql;
时间: 2024-03-26 21:40:14 浏览: 82
数据库设计
可以将`@Excel`注解中添加一个`orderNum`属性,并给定初始值为10,然后在每个注解上递增即可。修改后的代码如下:
```
@Excel(name = "负荷率", groupName = "萨南深冷", fixedIndex = 10, orderNum = "10")
private String snslfhl;
@Excel(name = "外输气阀组压力", groupName = "萨南深冷", fixedIndex = 11, orderNum = "11")
private String snslwsqfyl;
@Excel(name = "外输轻烃量", groupName = "萨南深冷", fixedIndex = 12, orderNum = "12")
private String snslwsqtl;
@Excel(name = "返输轻烃量", groupName = "萨南深冷", fixedIndex = 13, orderNum = "13")
private String snslfsqtl;
@Excel(name = "水消耗", groupName = "萨南深冷", fixedIndex = 14, orderNum = "14")
private String snslsxh;
@Excel(name = "电消耗", groupName = "萨南深冷", fixedIndex = 15, orderNum = "15")
private String snsldxh;
@Excel(name = "醇消耗", groupName = "萨南深冷", fixedIndex = 16, orderNum = "16")
private String snslcxh;
@Excel(name = "气消耗", groupName = "萨南深冷", fixedIndex = 17, orderNum = "17")
private String snslqxh;
@Excel(name = "加热炉燃料气", groupName = "萨南深冷", fixedIndex = 18, orderNum = "18")
private String snsljrl;
@Excel(name = "收烃率", groupName = "萨南深冷", fixedIndex = 19, orderNum = "19")
private String snslstl;
@Excel(name = "锅炉燃料气", groupName = "萨南深冷", fixedIndex = 20, orderNum = "20")
private String snslglyql;
```
这样每个属性的`orderNum`就会依次递增。
阅读全文