sql的NULL和空字符串
类似于java的NULL和空字符串,NULL表示没有值,空字符串表示值为空字符串,完全不同的
SELECT NULL = NULL,NULL != NULL,NULL IS NULL,NULL IS NOT NULL FROM base_material LIMIT 1;
image.png
poi动态设置颜色
public class ExcelCellDynamicColor {
private int col;//列数 从0开始
private int startRow;//开始行数 从0开始
//由内容来决定颜色 使用 HSSFColor 中的颜色
private Map<String,Short> contentColorMap = new HashMap<>();
}
private static void setCellDynamicColor(HSSFWorkbook wb, ExcelCellDynamicColor cellDynamicColor){
int sheetNum = wb.getNumberOfSheets();
for (int i = 0; i < sheetNum; i++) {
HSSFSheet sheet = wb.getSheetAt(i);
int rows = sheet.getLastRowNum() + 1;
for (int j = 0; j < rows; j++) {
HSSFRow row = sheet.getRow(j);
if (row == null)
continue;
HSSFCell cell = row.getCell(cellDynamicColor.getCol());
//若单元格为空或行数小于开始行,则跳过
if(cell == null || j < cellDynamicColor.getStartRow()){
continue;
}
Short color = cellDynamicColor.getContentColorMap().get(cell.getStringCellValue());
if(color != null){
HSSFFont font = wb.createFont();
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.cloneStyleFrom(cell.getCellStyle());
font.setColor(color);
cellStyle.setFont(font);
cell.setCellStyle(cellStyle);
}
}
}
}
一次查询多种表现
可能的情况是多个服务提供者且每个服务提供者提供的服务是不一样的如类似于一下场景,测试有一台服务提供者,开发在本地启动下dubbo,从而有可能导致一次查询多种表现。
网友评论