Commit 9fc83349 authored by dxw's avatar dxw

导出

parent e3ea8d14
......@@ -95,6 +95,12 @@
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.5</version>
</dependency>
</dependencies>
</project>
package com.devplatform.admin.common.utils;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author Administrator
*/
public class ExportExcel2 {
/** 显示的导出表的标题 */
private String title;
/** 导出表的列名 */
private List<String> rowName;
private List<ExcelInfo> varList;
/** 构造函数,传入要导出的数据 */
public ExportExcel2(Map<String, Object> model) {
this.varList = (List<ExcelInfo>) model.get("list");
this.rowName = (List<String>) model.get("titles");
this.title = (String) model.get("title");
}
/**
* 导出数据
* @param out
*/
public void export(OutputStream out) {
try {
Workbook workbook = new XSSFWorkbook();
Sheet sheet = workbook.createSheet(title);
// sheet样式定义【】
CellStyle columnTopStyle = this.getColumnTopStyle(workbook);
CellStyle style = this.getStyle(workbook);
// 定义所需列数
int columnNum = rowName.size();
Row rowRowName = sheet.createRow(0);
sheet.setDefaultColumnWidth(18);
// 将列头设置到sheet的单元格中
for (int n = 0; n < columnNum; n++) {
Cell cellRowName = rowRowName.createCell(n, CellType.STRING);
cellRowName.setCellValue(rowName.get(n));
cellRowName.setCellStyle(columnTopStyle);
}
if(varList != null && varList.size() > 0) {
for (int i = 0; i < varList.size(); i++) {
Row rowRowName2 = sheet.createRow(i+1);
List<String> strList2 = new ArrayList<>();
//序号
strList2.add((i+1)+"");
strList2.add(varList.get(i).getName());
strList2.add(varList.get(i).getCode());
strList2.add(varList.get(i).getElectricEnergy());
strList2.add(DateUtil.getPlusTime(varList.get(i).getCreateTime()));
// 将列头设置到sheet的单元格中
for (int n = 0; n < columnNum; n++) {
Cell cellRowName = rowRowName2.createCell(n, CellType.STRING);
cellRowName.setCellValue(strList2.get(n));
cellRowName.setCellStyle(columnTopStyle);
}
}
}
if (workbook != null) {
try {
workbook.write(out);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 列头单元格样式
* @param workbook
* @return
*/
public CellStyle getColumnTopStyle(Workbook workbook) {
// 设置字体
Font font = workbook.createFont();
// 设置字体大小
font.setFontHeightInPoints((short) 12);
// 字体加粗
font.setBold(false);
// 设置字体名字
font.setFontName("宋体");
// 设置样式
CellStyle style = workbook.createCellStyle();
// 在样式中应用设置的字体
style.setFont(font);
// 设置自动换行
style.setWrapText(true);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
public CellStyle getStyle(Workbook workbook) {
// 设置字体
Font font = workbook.createFont();
// 设置字体大小
font.setFontHeightInPoints((short) 11);
// 字体加粗
font.setBold(false);
// 设置字体名字
font.setFontName("宋体");
// 设置样式;
CellStyle style = workbook.createCellStyle();
// 在样式用应用设置的字体;
style.setFont(font);
// 设置自动换行;
style.setWrapText(false);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(HorizontalAlignment.LEFT);
// 设置垂直对齐的样式为居中对齐;
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
}
package com.devplatform.admin.common.utils;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author Administrator
*/
public class ExportExcel3 {
/** 显示的导出表的标题 */
private String title;
/** 导出表的列名 */
private List<String> rowName;
private List<SnqxzInfoHour> varList;
/** 构造函数,传入要导出的数据 */
public ExportExcel3(Map<String, Object> model) {
this.varList = (List<SnqxzInfoHour>) model.get("list");
this.rowName = (List<String>) model.get("titles");
this.title = (String) model.get("title");
}
/**
* 导出数据
* @param out
*/
public void export(OutputStream out) {
try {
Workbook workbook = new XSSFWorkbook();
Sheet sheet = workbook.createSheet(title);
// sheet样式定义【】
CellStyle columnTopStyle = this.getColumnTopStyle(workbook);
CellStyle style = this.getStyle(workbook);
// 定义所需列数
int columnNum = rowName.size();
Row rowRowName = sheet.createRow(0);
sheet.setDefaultColumnWidth(18);
// 将列头设置到sheet的单元格中
for (int n = 0; n < columnNum; n++) {
Cell cellRowName = rowRowName.createCell(n, CellType.STRING);
cellRowName.setCellValue(rowName.get(n));
cellRowName.setCellStyle(columnTopStyle);
}
if(varList != null && varList.size() > 0) {
for (int i = 0; i < varList.size(); i++) {
Row rowRowName2 = sheet.createRow(i+1);
List<String> strList2 = new ArrayList<>();
//序号
strList2.add((i+1)+"");
strList2.add(varList.get(i).getName());
strList2.add(varList.get(i).getCode());
strList2.add(varList.get(i).getTemperature());
strList2.add(varList.get(i).getHumidity());
strList2.add(varList.get(i).getCarbonDioxide());
strList2.add(DateUtil.getPlusTime(varList.get(i).getCreateTime()));
// 将列头设置到sheet的单元格中
for (int n = 0; n < columnNum; n++) {
Cell cellRowName = rowRowName2.createCell(n, CellType.STRING);
cellRowName.setCellValue(strList2.get(n));
cellRowName.setCellStyle(columnTopStyle);
}
}
}
if (workbook != null) {
try {
workbook.write(out);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 列头单元格样式
* @param workbook
* @return
*/
public CellStyle getColumnTopStyle(Workbook workbook) {
// 设置字体
Font font = workbook.createFont();
// 设置字体大小
font.setFontHeightInPoints((short) 12);
// 字体加粗
font.setBold(false);
// 设置字体名字
font.setFontName("宋体");
// 设置样式
CellStyle style = workbook.createCellStyle();
// 在样式中应用设置的字体
style.setFont(font);
// 设置自动换行
style.setWrapText(true);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
public CellStyle getStyle(Workbook workbook) {
// 设置字体
Font font = workbook.createFont();
// 设置字体大小
font.setFontHeightInPoints((short) 11);
// 字体加粗
font.setBold(false);
// 设置字体名字
font.setFontName("宋体");
// 设置样式;
CellStyle style = workbook.createCellStyle();
// 在样式用应用设置的字体;
style.setFont(font);
// 设置自动换行;
style.setWrapText(false);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(HorizontalAlignment.LEFT);
// 设置垂直对齐的样式为居中对齐;
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
}
package com.devplatform.admin.common.utils;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author Administrator
*/
public class ExportExcel4 {
/** 显示的导出表的标题 */
private String title;
/** 导出表的列名 */
private List<String> rowName;
private List<SwqxzInfoHour> varList;
/** 构造函数,传入要导出的数据 */
public ExportExcel4(Map<String, Object> model) {
this.varList = (List<SwqxzInfoHour>) model.get("list");
this.rowName = (List<String>) model.get("titles");
this.title = (String) model.get("title");
}
/**
* 导出数据
* @param out
*/
public void export(OutputStream out) {
try {
Workbook workbook = new XSSFWorkbook();
Sheet sheet = workbook.createSheet(title);
// sheet样式定义【】
CellStyle columnTopStyle = this.getColumnTopStyle(workbook);
CellStyle style = this.getStyle(workbook);
// 定义所需列数
int columnNum = rowName.size();
Row rowRowName = sheet.createRow(0);
sheet.setDefaultColumnWidth(18);
// 将列头设置到sheet的单元格中
for (int n = 0; n < columnNum; n++) {
Cell cellRowName = rowRowName.createCell(n, CellType.STRING);
cellRowName.setCellValue(rowName.get(n));
cellRowName.setCellStyle(columnTopStyle);
}
if(varList != null && varList.size() > 0) {
for (int i = 0; i < varList.size(); i++) {
Row rowRowName2 = sheet.createRow(i+1);
List<String> strList2 = new ArrayList<>();
//序号
strList2.add((i+1)+"");
strList2.add(varList.get(i).getName());
strList2.add(varList.get(i).getCode());
strList2.add(varList.get(i).getTemperature());
strList2.add(varList.get(i).getHumidity());
strList2.add(varList.get(i).getWindSpeed());
strList2.add(varList.get(i).getIlluminance());
strList2.add(varList.get(i).getCarbonDioxide());
strList2.add(varList.get(i).getFineParticles());
strList2.add(varList.get(i).getRadiation());
strList2.add(DateUtil.getPlusTime(varList.get(i).getCreateTime()));
// 将列头设置到sheet的单元格中
for (int n = 0; n < columnNum; n++) {
Cell cellRowName = rowRowName2.createCell(n, CellType.STRING);
cellRowName.setCellValue(strList2.get(n));
cellRowName.setCellStyle(columnTopStyle);
}
}
}
if (workbook != null) {
try {
workbook.write(out);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 列头单元格样式
* @param workbook
* @return
*/
public CellStyle getColumnTopStyle(Workbook workbook) {
// 设置字体
Font font = workbook.createFont();
// 设置字体大小
font.setFontHeightInPoints((short) 12);
// 字体加粗
font.setBold(false);
// 设置字体名字
font.setFontName("宋体");
// 设置样式
CellStyle style = workbook.createCellStyle();
// 在样式中应用设置的字体
style.setFont(font);
// 设置自动换行
style.setWrapText(true);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
public CellStyle getStyle(Workbook workbook) {
// 设置字体
Font font = workbook.createFont();
// 设置字体大小
font.setFontHeightInPoints((short) 11);
// 字体加粗
font.setBold(false);
// 设置字体名字
font.setFontName("宋体");
// 设置样式;
CellStyle style = workbook.createCellStyle();
// 在样式用应用设置的字体;
style.setFont(font);
// 设置自动换行;
style.setWrapText(false);
// 设置水平对齐的样式为居中对齐;
style.setAlignment(HorizontalAlignment.LEFT);
// 设置垂直对齐的样式为居中对齐;
style.setVerticalAlignment(VerticalAlignment.CENTER);
return style;
}
}
package com.devplatform.admin.modules.eq.bean;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@ApiModel(value="室外气象站信息-时对象",description="室外气象站信息-时对象")
@TableName("swqxz_info_hour")
......@@ -55,4 +55,12 @@ public class SwqxzInfoHour implements Serializable {
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
private java.util.Date createTime;
/** 设备编号 */
@TableField(exist = false)
private java.lang.String code;
/** 设备名称 */
@TableField(exist = false)
private java.lang.String name;
}
......@@ -456,7 +456,8 @@ public class EquipmentController extends AbstractController {
* @param status 1=开启,2=关闭
*/
private Map<String, Object> checkModelOnOrOff(Integer type, Integer status) {
String postUrl = "http://192.168.0.222:8089/command/operationType";
// String postUrl = "http://192.168.0.222:8089/command/operationType";
String postUrl = "http://localhost:8089/command/operationType";
Map<String, String> postParam = new HashMap<String, String>(10);
postParam.put("params",status==1 ? "1": "0");
postParam.put("rgType", type.toString());
......
......@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -69,4 +70,11 @@ public class KanBanController extends AbstractController {
Page<Map<String,Object>> page = kanBanService.getListByTypeAndId(params);
return R.ok().put("page",page);
}
@GetMapping("/export/toExcel")
public void excel(HttpServletResponse response,@RequestParam Map<String, Object> params){
params.put("startTime", DateUtil.getStringOfFirstDay((String) params.get("startTime")));
params.put("endTime",DateUtil.getStringOfLastDay((String) params.get("endTime")));
kanBanService.toExcel(response,params);
}
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.DlswjInfoDayModel;
......@@ -37,4 +38,6 @@ public interface DlswjInfoDayDao extends MyBaseMapper<DlswjInfoDay> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.DlswjInfoHourModel;
......@@ -37,4 +38,6 @@ public interface DlswjInfoHourDao extends MyBaseMapper<DlswjInfoHour> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.DlswjInfoMonthModel;
......@@ -37,4 +38,6 @@ public interface DlswjInfoMonthDao extends MyBaseMapper<DlswjInfoMonth> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.FlrbInfoDayModel;
......@@ -42,4 +43,6 @@ public interface FlrbInfoDayDao extends MyBaseMapper<FlrbInfoDay> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.FlrbInfoHourModel;
......@@ -37,4 +38,6 @@ public interface FlrbInfoHourDao extends MyBaseMapper<FlrbInfoHour> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.FlrbInfoMonthModel;
......@@ -37,4 +38,6 @@ public interface FlrbInfoMonthDao extends MyBaseMapper<FlrbInfoMonth> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.JfktpInfoDayModel;
......@@ -42,4 +43,6 @@ public interface JfktpInfoDayDao extends MyBaseMapper<JfktpInfoDay> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.JfktpInfoHourModel;
......@@ -37,4 +38,6 @@ public interface JfktpInfoHourDao extends MyBaseMapper<JfktpInfoHour> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.JfktpInfoMonthModel;
......@@ -37,4 +38,6 @@ public interface JfktpInfoMonthDao extends MyBaseMapper<JfktpInfoMonth> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.PfjInfoDay;
import com.devplatform.admin.modules.eq.model.PfjInfoDayModel;
import com.devplatform.common.dao.MyBaseMapper;
......@@ -42,4 +43,6 @@ public interface PfjInfoDayDao extends MyBaseMapper<PfjInfoDay> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.PfjInfoHourModel;
......@@ -37,4 +38,6 @@ public interface PfjInfoHourDao extends MyBaseMapper<PfjInfoHour> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.PfjInfoMonthModel;
......@@ -37,4 +38,6 @@ public interface PfjInfoMonthDao extends MyBaseMapper<PfjInfoMonth> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoDay;
import com.devplatform.admin.modules.eq.model.SbInfoDayModel;
import com.devplatform.common.dao.MyBaseMapper;
......@@ -43,4 +44,6 @@ public interface SbInfoDayDao extends MyBaseMapper<SbInfoDay> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoHour;
import com.devplatform.admin.modules.eq.model.SbInfoHourModel;
import com.devplatform.common.dao.MyBaseMapper;
......@@ -37,4 +38,6 @@ public interface SbInfoHourDao extends MyBaseMapper<SbInfoHour> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoMonth;
import com.devplatform.admin.modules.eq.model.SbInfoMonthModel;
import com.devplatform.common.dao.MyBaseMapper;
......@@ -37,4 +38,6 @@ public interface SbInfoMonthDao extends MyBaseMapper<SbInfoMonth> {
@Param("params") Map<String, Object> params);
List<Map<String, Object>> queryListByParam(@Param("startTime")String startTime,@Param("endTime")String endTime);
List<ExcelInfo> queryList(@Param("params") Map<String, Object> params);
}
......@@ -47,4 +47,6 @@ public interface SnqxzInfoHourDao extends MyBaseMapper<SnqxzInfoHour> {
List<Map<String, Object>> getListFx(@Param("region")Integer region,@Param("startTime")String startTime,@Param("endTime")String endTime);
List<Map<String, Object>> getParamGroupByRegion(@Param("region")Integer region);
List<SnqxzInfoHour> queryList(@Param("params") Map<String, Object> params);
}
......@@ -44,4 +44,6 @@ public interface SwqxzInfoHourDao extends MyBaseMapper<SwqxzInfoHour> {
*/
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
List<SwqxzInfoHour> queryList(@Param("params") Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.DlswjInfoDay;
......@@ -28,4 +29,6 @@ public interface DlswjInfoDayService extends MyBaseService<DlswjInfoDay> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoHour;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.model.DlswjInfoHourModel;
import com.devplatform.common.service.MyBaseService;
......@@ -26,4 +27,6 @@ public interface DlswjInfoHourService extends MyBaseService<DlswjInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.DlswjInfoMonth;
......@@ -28,4 +29,6 @@ public interface DlswjInfoMonthService extends MyBaseService<DlswjInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
......@@ -6,6 +6,7 @@ import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.DlswjInfo;
import com.devplatform.admin.modules.eq.model.DlswjInfoModel;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -29,4 +30,6 @@ public interface DlswjInfoService extends MyBaseService<DlswjInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.FlrbInfoDay;
......@@ -32,4 +33,6 @@ public interface FlrbInfoDayService extends MyBaseService<FlrbInfoDay> {
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.FlrbInfoHour;
......@@ -27,4 +28,6 @@ public interface FlrbInfoHourService extends MyBaseService<FlrbInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.FlrbInfoMonth;
......@@ -27,4 +28,6 @@ public interface FlrbInfoMonthService extends MyBaseService<FlrbInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
......@@ -5,6 +5,7 @@ import com.devplatform.admin.modules.eq.bean.FlrbInfo;
import com.devplatform.admin.modules.eq.model.FlrbInfoModel;
import com.devplatform.common.service.MyBaseService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -28,4 +29,6 @@ public interface FlrbInfoService extends MyBaseService<FlrbInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.JfktpInfoDay;
......@@ -32,4 +33,6 @@ public interface JfktpInfoDayService extends MyBaseService<JfktpInfoDay> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.JfktpInfoHour;
......@@ -28,4 +29,6 @@ public interface JfktpInfoHourService extends MyBaseService<JfktpInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.JfktpInfoMonth;
......@@ -28,4 +29,6 @@ public interface JfktpInfoMonthService extends MyBaseService<JfktpInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
......@@ -5,6 +5,7 @@ import com.devplatform.admin.modules.eq.bean.JfktpInfo;
import com.devplatform.admin.modules.eq.model.JfktpInfoModel;
import com.devplatform.common.service.MyBaseService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -28,4 +29,6 @@ public interface JfktpInfoService extends MyBaseService<JfktpInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
......@@ -16,4 +17,6 @@ public interface KanBanService {
* @return
*/
Page<Map<String,Object>> getListByTypeAndId(Map<String, Object> params);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.PfjInfoDay;
import com.devplatform.admin.modules.eq.model.PfjInfoDayModel;
import com.devplatform.common.service.MyBaseService;
......@@ -31,4 +32,6 @@ public interface PfjInfoDayService extends MyBaseService<PfjInfoDay> {
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page,Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.PfjInfoHour;
......@@ -28,4 +29,6 @@ public interface PfjInfoHourService extends MyBaseService<PfjInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.PfjInfoMonth;
......@@ -27,4 +28,6 @@ public interface PfjInfoMonthService extends MyBaseService<PfjInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
......@@ -5,6 +5,7 @@ import com.devplatform.admin.modules.eq.bean.PfjInfo;
import com.devplatform.admin.modules.eq.model.PfjInfoModel;
import com.devplatform.common.service.MyBaseService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -28,4 +29,6 @@ public interface PfjInfoService extends MyBaseService<PfjInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoDay;
import com.devplatform.admin.modules.eq.model.SbInfoDayModel;
import com.devplatform.common.service.MyBaseService;
......@@ -31,4 +32,6 @@ public interface SbInfoDayService extends MyBaseService<SbInfoDay> {
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page,Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoHour;
import com.devplatform.admin.modules.eq.model.SbInfoHourModel;
import com.devplatform.common.service.MyBaseService;
......@@ -27,4 +28,6 @@ public interface SbInfoHourService extends MyBaseService<SbInfoHour> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoMonth;
import com.devplatform.admin.modules.eq.model.SbInfoMonthModel;
import com.devplatform.common.service.MyBaseService;
......@@ -26,4 +27,6 @@ public interface SbInfoMonthService extends MyBaseService<SbInfoMonth> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
List<ExcelInfo> queryList(Map<String, Object> params);
}
......@@ -5,6 +5,7 @@ import com.devplatform.admin.modules.eq.bean.SbInfo;
import com.devplatform.admin.modules.eq.model.SbInfoModel;
import com.devplatform.common.service.MyBaseService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -28,4 +29,6 @@ public interface SbInfoService extends MyBaseService<SbInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
......@@ -28,4 +28,5 @@ public interface SljfgInfoService extends MyBaseService<SljfgInfo> {
Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> pageTask, Map<String, Object> params);
List<Map<String, Object>> queryListByParam(String startTime,String endTime);
}
......@@ -5,6 +5,7 @@ import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour;
import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel;
import com.devplatform.common.service.MyBaseService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -35,4 +36,6 @@ public interface SnqxzInfoHourService extends MyBaseService<SnqxzInfoHour> {
List<Map<String, Object>> getListFx(Integer region, String startTime,String endTime);
List<Map<String, Object>> getParamGroupByRegion(Integer region);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
......@@ -6,6 +6,7 @@ import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -33,4 +34,6 @@ public interface SwqxzInfoHourService extends MyBaseService<SwqxzInfoHour> {
* @return
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
void toExcel(HttpServletResponse response, Map<String, Object> params);
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoDay;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.dao.DlswjInfoDayDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoDayModel;
import com.devplatform.admin.modules.eq.service.DlswjInfoDayService;
......@@ -36,4 +37,9 @@ public class DlswjInfoDayServiceImpl extends MyBaseServiceImpl<DlswjInfoDayDao,
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoHour;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.dao.DlswjInfoHourDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoHourModel;
import com.devplatform.admin.modules.eq.service.DlswjInfoHourService;
......@@ -37,4 +38,8 @@ public class DlswjInfoHourServiceImpl extends MyBaseServiceImpl<DlswjInfoHourDao
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
......@@ -2,6 +2,7 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.DlswjInfoMonth;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.dao.DlswjInfoMonthDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoMonthModel;
import com.devplatform.admin.modules.eq.service.DlswjInfoMonthService;
......@@ -36,4 +37,9 @@ public class DlswjInfoMonthServiceImpl extends MyBaseServiceImpl<DlswjInfoMonthD
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
......@@ -3,7 +3,9 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.common.utils.ExportExcel2;
import com.devplatform.admin.modules.eq.bean.DlswjInfo;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.dao.DlswjInfoDao;
import com.devplatform.admin.modules.eq.model.DlswjInfoModel;
import com.devplatform.admin.modules.eq.service.DlswjInfoDayService;
......@@ -14,7 +16,10 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -74,4 +79,44 @@ public class DlswjInfoServiceImpl extends MyBaseServiceImpl<DlswjInfoDao, DlswjI
}
return list;
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
OutputStream out = null;
try {
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
List<ExcelInfo> list = new ArrayList<>();
if(type == Constants.INT_1){
list = dlswjInfoHourService.queryList(params);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = dlswjInfoDayService.queryList(params);
}else if(type == Constants.INT_4){
list = dlswjInfoMonthService.queryList(params);
}
String fileName = "dlswj.xlsx";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-download");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
out = response.getOutputStream();
Map<String, Object> map = new HashMap<>();
map.put("title", "多联新风室外机历史记录");
List<String> strList = new ArrayList<>();
strList.add("序号");
strList.add("设备名称");
strList.add("设备编号");
strList.add("用电量");
strList.add("采集时间");
map.put("titles", strList);
map.put("list", list);
ExportExcel2 ee = new ExportExcel2(map);
ee.export(out);
}catch (Exception e){
e.printStackTrace();
}
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.FlrbInfoDay;
import com.devplatform.admin.modules.eq.dao.FlrbInfoDayDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoDayModel;
......@@ -35,4 +36,9 @@ public class FlrbInfoDayServiceImpl extends MyBaseServiceImpl<FlrbInfoDayDao, Fl
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.FlrbInfoHour;
import com.devplatform.admin.modules.eq.dao.FlrbInfoHourDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoHourModel;
......@@ -35,4 +36,9 @@ public class FlrbInfoHourServiceImpl extends MyBaseServiceImpl<FlrbInfoHourDao,
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.FlrbInfoMonth;
import com.devplatform.admin.modules.eq.dao.FlrbInfoMonthDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoMonthModel;
......@@ -36,4 +37,9 @@ public class FlrbInfoMonthServiceImpl extends MyBaseServiceImpl<FlrbInfoMonthDao
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
......@@ -3,6 +3,8 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.common.utils.ExportExcel2;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.FlrbInfo;
import com.devplatform.admin.modules.eq.dao.FlrbInfoDao;
import com.devplatform.admin.modules.eq.model.FlrbInfoModel;
......@@ -14,7 +16,10 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -75,4 +80,44 @@ public class FlrbInfoServiceImpl extends MyBaseServiceImpl<FlrbInfoDao, FlrbInfo
return list;
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
OutputStream out = null;
try {
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
List<ExcelInfo> list = new ArrayList<>();
if(type == Constants.INT_1){
list = flrbInfoHourService.queryList(params);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = flrbInfoDayService.queryList(params);
}else if(type == Constants.INT_4){
list = flrbInfoMonthService.queryList(params);
}
String fileName = "flrb.xlsx";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-download");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
out = response.getOutputStream();
Map<String, Object> map = new HashMap<>();
map.put("title", "风冷热泵机组历史记录");
List<String> strList = new ArrayList<>();
strList.add("序号");
strList.add("设备名称");
strList.add("设备编号");
strList.add("用电量");
strList.add("采集时间");
map.put("titles", strList);
map.put("list", list);
ExportExcel2 ee = new ExportExcel2(map);
ee.export(out);
}catch (Exception e){
e.printStackTrace();
}
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.JfktpInfoDay;
import com.devplatform.admin.modules.eq.dao.JfktpInfoDayDao;
import com.devplatform.admin.modules.eq.model.JfktpInfoDayModel;
......@@ -36,4 +37,9 @@ public class JfktpInfoDayServiceImpl extends MyBaseServiceImpl<JfktpInfoDayDao,
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.JfktpInfoHour;
import com.devplatform.admin.modules.eq.dao.JfktpInfoHourDao;
import com.devplatform.admin.modules.eq.model.JfktpInfoHourModel;
......@@ -35,4 +36,9 @@ public class JfktpInfoHourServiceImpl extends MyBaseServiceImpl<JfktpInfoHourDao
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.JfktpInfoMonth;
import com.devplatform.admin.modules.eq.dao.JfktpInfoMonthDao;
import com.devplatform.admin.modules.eq.model.JfktpInfoMonthModel;
......@@ -35,4 +36,9 @@ public class JfktpInfoMonthServiceImpl extends MyBaseServiceImpl<JfktpInfoMonthD
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
......@@ -3,6 +3,8 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.common.utils.ExportExcel2;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.JfktpInfo;
import com.devplatform.admin.modules.eq.dao.JfktpInfoDao;
import com.devplatform.admin.modules.eq.model.JfktpInfoModel;
......@@ -14,7 +16,10 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -76,4 +81,44 @@ public class JfktpInfoServiceImpl extends MyBaseServiceImpl<JfktpInfoDao, JfktpI
return list;
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
OutputStream out = null;
try {
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
List<ExcelInfo> list = new ArrayList<>();
if(type == Constants.INT_1){
list = jfktpInfoHourService.queryList(params);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = jfktpInfoDayService.queryList(params);
}else if(type == Constants.INT_4){
list = jfktpInfoMonthService.queryList(params);
}
String fileName = "kt.xlsx";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-download");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
out = response.getOutputStream();
Map<String, Object> map = new HashMap<>();
map.put("title", "空调历史记录");
List<String> strList = new ArrayList<>();
strList.add("序号");
strList.add("设备名称");
strList.add("设备编号");
strList.add("用电量");
strList.add("采集时间");
map.put("titles", strList);
map.put("list", list);
ExportExcel2 ee = new ExportExcel2(map);
ee.export(out);
}catch (Exception e){
e.printStackTrace();
}
}
}
......@@ -6,6 +6,7 @@ import com.devplatform.admin.modules.eq.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
......@@ -66,4 +67,25 @@ public class KanBanServiceImpl implements KanBanService {
}
return list;
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
String resourceType = (String) params.get("resourceType");
if(Constants.ID_PFJ.equals(resourceType)){
pfjInfoService.toExcel(response,params);
}else if(Constants.ID_JFKTP.equals(resourceType)){
jfktpInfoService.toExcel(response,params);
}else if(Constants.ID_FLRBJZ.equals(resourceType)){
flrbInfoService.toExcel(response,params);
}else if(Constants.ID_SB.equals(resourceType)){
sbInfoService.toExcel(response,params);
}else if(Constants.ID_SWQXZ.equals(resourceType)){
swqxzInfoHourService.toExcel(response,params);
}else if(Constants.ID_SLSWJ.equals(resourceType)){
dlswjInfoService.toExcel(response,params);
}else if(Constants.ID_SNQXZ.equals(resourceType)){
snqxzInfoHourService.toExcel(response,params);
}
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.PfjInfoDay;
import com.devplatform.admin.modules.eq.dao.PfjInfoDayDao;
import com.devplatform.admin.modules.eq.model.PfjInfoDayModel;
......@@ -37,4 +38,9 @@ public class PfjInfoDayServiceImpl extends MyBaseServiceImpl<PfjInfoDayDao, PfjI
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.PfjInfoHour;
import com.devplatform.admin.modules.eq.dao.PfjInfoHourDao;
import com.devplatform.admin.modules.eq.model.PfjInfoHourModel;
......@@ -36,4 +37,9 @@ public class PfjInfoHourServiceImpl extends MyBaseServiceImpl<PfjInfoHourDao, Pf
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.PfjInfoMonth;
import com.devplatform.admin.modules.eq.dao.PfjInfoMonthDao;
import com.devplatform.admin.modules.eq.model.PfjInfoMonthModel;
......@@ -37,4 +38,9 @@ public class PfjInfoMonthServiceImpl extends MyBaseServiceImpl<PfjInfoMonthDao,
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.alibaba.excel.ExcelWriter;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.common.utils.ExportExcel2;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.PfjInfo;
import com.devplatform.admin.modules.eq.dao.PfjInfoDao;
import com.devplatform.admin.modules.eq.model.PfjInfoModel;
......@@ -14,7 +17,10 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -74,4 +80,63 @@ public class PfjInfoServiceImpl extends MyBaseServiceImpl<PfjInfoDao, PfjInfo> i
}
return list;
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
OutputStream out = null;
ExcelWriter writer = null;
try {
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
List<ExcelInfo> list = new ArrayList<>();
if(type == Constants.INT_1){
list = pfjInfoHourService.queryList(params);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = pfjInfoDayService.queryList(params);
}else if(type == Constants.INT_4){
list = pfjInfoMonthService.queryList(params);
}
// String fileName = new String("排风机历史数据".getBytes("utf-8"),"iso-8859-1") + ".xlsx";
String fileName = "pfj.xlsx";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-download");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
out = response.getOutputStream();
Map<String, Object> map = new HashMap<>();
map.put("title", "排风机历史记录");
List<String> strList = new ArrayList<>();
strList.add("序号");
strList.add("设备名称");
strList.add("设备编号");
strList.add("用电量");
strList.add("采集时间");
map.put("titles", strList);
map.put("list", list);
ExportExcel2 ee = new ExportExcel2(map);
ee.export(out);
// writer = EasyExcel.write(fileName, ExcelInfo.class).file(out).build();
// List<List<ExcelInfo>> lists = Lists.partition(list,50000);
// for (int i = 0; i < lists.size(); i++) {
// WriteSheet writeSheet = EasyExcel.writerSheet(0, "sheet" ).build();
// WriteSheet writeSheet = EasyExcel.writerSheet(i, "sheet" + (i + 1)).build();
// 分页去数据库查询数据 这里可以去数据库查询每一页的数据
// writer.write(lists.get(i), writeSheet);
// writer.write(list, writeSheet);
// }
}catch (Exception e){
e.printStackTrace();
}
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoDay;
import com.devplatform.admin.modules.eq.dao.SbInfoDayDao;
import com.devplatform.admin.modules.eq.model.SbInfoDayModel;
......@@ -37,4 +38,8 @@ public class SbInfoDayServiceImpl extends MyBaseServiceImpl<SbInfoDayDao, SbInfo
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoHour;
import com.devplatform.admin.modules.eq.dao.SbInfoHourDao;
import com.devplatform.admin.modules.eq.model.SbInfoHourModel;
......@@ -36,4 +37,9 @@ public class SbInfoHourServiceImpl extends MyBaseServiceImpl<SbInfoHourDao, SbIn
public List<Map<String, Object>> queryListByParam(String startTime,String endTime) {
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfoMonth;
import com.devplatform.admin.modules.eq.dao.SbInfoMonthDao;
import com.devplatform.admin.modules.eq.model.SbInfoMonthModel;
......@@ -37,4 +38,8 @@ public class SbInfoMonthServiceImpl extends MyBaseServiceImpl<SbInfoMonthDao, Sb
return baseMapper.queryListByParam(startTime,endTime);
}
@Override
public List<ExcelInfo> queryList(Map<String, Object> params) {
return baseMapper.queryList(params);
}
}
......@@ -3,6 +3,8 @@ package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.common.utils.DateUtil;
import com.devplatform.admin.common.utils.ExportExcel2;
import com.devplatform.admin.modules.eq.bean.ExcelInfo;
import com.devplatform.admin.modules.eq.bean.SbInfo;
import com.devplatform.admin.modules.eq.dao.SbInfoDao;
import com.devplatform.admin.modules.eq.model.SbInfoModel;
......@@ -14,7 +16,10 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -74,4 +79,44 @@ public class SbInfoServiceImpl extends MyBaseServiceImpl<SbInfoDao, SbInfo> impl
}
return list;
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
OutputStream out = null;
try {
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
int type = DateUtil.checkTimeToType(startTime,endTime);
List<ExcelInfo> list = new ArrayList<>();
if(type == Constants.INT_1){
list = sbInfoHourService.queryList(params);
}else if(type == Constants.INT_2 || type == Constants.INT_3){
list = sbInfoDayService.queryList(params);
}else if(type == Constants.INT_4){
list = sbInfoMonthService.queryList(params);
}
String fileName = "sb.xlsx";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-download");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
out = response.getOutputStream();
Map<String, Object> map = new HashMap<>();
map.put("title", "水泵历史记录");
List<String> strList = new ArrayList<>();
strList.add("序号");
strList.add("设备名称");
strList.add("设备编号");
strList.add("用电量");
strList.add("采集时间");
map.put("titles", strList);
map.put("list", list);
ExportExcel2 ee = new ExportExcel2(map);
ee.export(out);
}catch (Exception e){
e.printStackTrace();
}
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.ExportExcel3;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour;
import com.devplatform.admin.modules.eq.dao.SnqxzInfoHourDao;
import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel;
......@@ -8,6 +9,10 @@ import com.devplatform.admin.modules.eq.service.SnqxzInfoHourService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -45,4 +50,36 @@ public class SnqxzInfoHourServiceImpl extends MyBaseServiceImpl<SnqxzInfoHourDao
public List<Map<String, Object>> getParamGroupByRegion(Integer region) {
return baseMapper.getParamGroupByRegion(region);
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
OutputStream out = null;
try {
List<SnqxzInfoHour> list = baseMapper.queryList(params);;
String fileName = "snqxz.xlsx";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-download");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
out = response.getOutputStream();
Map<String, Object> map = new HashMap<>();
map.put("title", "传感器历史记录");
List<String> strList = new ArrayList<>();
strList.add("序号");
strList.add("设备名称");
strList.add("设备编号");
strList.add("温度(℃)");
strList.add("湿度(%RH)");
strList.add("CO2(PPM)");
strList.add("采集时间");
map.put("titles", strList);
map.put("list", list);
ExportExcel3 ee = new ExportExcel3(map);
ee.export(out);
}catch (Exception e){
e.printStackTrace();
}
}
}
package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.common.utils.ExportExcel4;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.dao.SwqxzInfoHourDao;
import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel;
......@@ -8,6 +9,10 @@ import com.devplatform.admin.modules.eq.service.SwqxzInfoHourService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -37,4 +42,40 @@ public class SwqxzInfoHourServiceImpl extends MyBaseServiceImpl<SwqxzInfoHourDao
return baseMapper.queryPageListByParam(page,params);
}
@Override
public void toExcel(HttpServletResponse response, Map<String, Object> params) {
OutputStream out = null;
try {
List<SwqxzInfoHour> list = baseMapper.queryList(params);;
String fileName = "swqxz.xlsx";
response.setCharacterEncoding("UTF-8");
response.setContentType("application/x-download");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
out = response.getOutputStream();
Map<String, Object> map = new HashMap<>();
map.put("title", "室外气象站历史记录");
List<String> strList = new ArrayList<>();
strList.add("序号");
strList.add("设备名称");
strList.add("设备编号");
strList.add("温度(℃)");
strList.add("湿度(%RH)");
strList.add("风速(m/s)");
strList.add("光照(Lux)");
strList.add("CO2(PPM)");
strList.add("PM2.5(ug/m)");
strList.add("辐射(w/m)");
strList.add("采集时间");
map.put("titles", strList);
map.put("list", list);
ExportExcel4 ee = new ExportExcel4(map);
ee.export(out);
}catch (Exception e){
e.printStackTrace();
}
}
}
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from dlswj_info_day t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from dlswj_info_hour t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from dlswj_info_month t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -82,6 +82,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from flrb_info_day t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -82,6 +82,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from flrb_info_hour t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -82,6 +82,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from flrb_info_month t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from jfktp_info_day t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -83,6 +83,25 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from jfktp_info_hour t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from jfktp_info_month t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from pfj_info_day t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......
......@@ -82,6 +82,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from pfj_info_hour t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from pfj_info_month t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from sb_info_day t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......
......@@ -82,6 +82,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from sb_info_hour t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......
......@@ -83,6 +83,24 @@
group by create_time
order by create_time
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.ExcelInfo">
select lr.name as name,lr.code as code ,t.create_time as createTime,t.electric_energy as electricEnergy from sb_info_month t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time
</select>
</mapper>
......@@ -128,6 +128,24 @@
</if>
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.SnqxzInfoHour">
select t.*,lr.name as name,lr.code as code from snqxz_info_hour t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time DESC
</select>
</mapper>
......
......@@ -93,6 +93,24 @@
ORDER BY t.create_time DESC
</if>
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.SwqxzInfoHour">
select t.*,lr.name as name,lr.code as code from swqxz_info_hour t
left join li_resource lr on lr.id = t.resource_id
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="(params.startTime == null or params.startTime == '') and (params.endTime == null or params.endTime == '')">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
ORDER BY t.create_time DESC
</select>
</mapper>
......
......@@ -25,6 +25,7 @@ public class SuntrayResourceServerConfiguration extends ResourceServerConfigurer
.antMatchers(
"/websocket/",
"/admin/captcha.jpg",
"/admin/**",
"/login",
"/authorization/oauth/token",
"/admin/druid/sql.html",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment