Commit defce221 authored by 李松's avatar 李松

修改bug

parent 65b8f734
......@@ -64,7 +64,7 @@ public class AdpterController {
adpterService.syncMainDeviceRelation();
}
@ApiOperation(value = "buildingExcel")
@ApiOperation(value = "建筑信息")
@RequestMapping(value = "/buildingExcel", method = RequestMethod.POST)
public void systemExcel(HttpServletResponse response, String gatewayId) throws IOException {
adpterService.buildingExcel(response, gatewayId);
......
......@@ -654,7 +654,7 @@ public class AdpterService {
try (OutputStream outputStream = response.getOutputStream()) {
// 创建ExcelWriter
ExcelWriter excelWriter = EasyExcel.write(outputStream).build();
// 系统信息
// 建筑信息
WriteSheet buildingSheet = EasyExcel.writerSheet(0, "建筑信息")
.head(AreaExcelModel.class)
.build();
......
SELECT
a.*,
MAX(CASE WHEN i.field_label like '%面积%' THEN i.field_value END) area,
MAX(CASE WHEN i.field_label like '%耐火%' THEN i.field_value END) level
FROM
(
SELECT
t.id,
t.`code` code,
t.`name` name,
t1.`code` parentCode,
CASE
WHEN t.`name` LIKE '%区域%'
OR t.`name` LIKE '%场%' THEN
'区域'
WHEN t.`name` LIKE '%层%' or t.`name` like '%屋顶%' THEN
'楼层'
WHEN t.`name` LIKE '%室%'
OR t.`name` LIKE '%间%'
OR t.`name` LIKE '%房%' THEN
'房间' ELSE '建筑'
END type
FROM
wl_warehouse_structure t
LEFT JOIN wl_warehouse_structure t1 ON t.parent_id = t1.id
) a ,
wl_form_instance i
WHERE
i.instance_id = a.id
group by a.id
select temp.*
from (
SELECT a.*,
MAX(CASE WHEN i.field_label like '%面积%' THEN i.field_value END) area,
MAX(CASE WHEN i.field_label like '%耐火%' THEN i.field_value END) level,
case
when i.group_type = 'building' then '建筑'
when i.group_type = 'floor' then '楼层'
when i.group_type = 'room' then '房间'
end as type
FROM (
SELECT t.id,
t.`code` code,
t.`name` name,
t1.`code` parentCode
FROM wl_warehouse_structure t
LEFT JOIN wl_warehouse_structure t1 ON t.parent_id = t1.id
) a,
wl_form_instance i
WHERE i.instance_id = a.id
group by a.id
) temp
\ No newline at end of file
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