code: public static int mergingCells(Sheet sheet, int firstRow, int lastRow, int firstColumn, int lastColumn, CellStyle cellStyle) {
  		final CellRangeAddress cellRangeAddress = new CellRangeAddress(//
  				firstRow, // first row (0-based)
  				lastRow, // last row (0-based)
  				firstColumn, // first column (0-based)
  				lastColumn // last column (0-based)
  		);
  
  		if (null != cellStyle) {
  			RegionUtil.setBorderTop(cellStyle.getBorderTopEnum(), cellRangeAddress, sheet);
  			RegionUtil.setBorderRight(cellStyle.getBorderRightEnum(), cellRangeAddress, sheet);
  			RegionUtil.setBorderBottom(cellStyle.getBorderBottomEnum(), cellRangeAddress, sheet);
  			RegionUtil.setBorderLeft(cellStyle.getBorderLeftEnum(), cellRangeAddress, sheet);
  		}
  		return sheet.addMergedRegion(cellRangeAddress);
  	}
docs: 合并单元格，可以根据设置的值来合并行和列
  
  @param sheet 表对象
  @param firstRow 起始行，0开始
  @param lastRow 结束行，0开始
  @param firstColumn 起始列，0开始
  @param lastColumn 结束列，0开始
  @param cellStyle 单元格样式，只提取边框样式
  @return 合并后的单元格号