feat: 每日数据显示顺序,名称,单位

(1)港口按顺序排序(青岛港、日照港、烟台港、渤海湾港)
 (2)设备编号字段改成 设备名称(name)
 (3)单位
This commit is contained in:
LokerL 2024-12-13 20:23:01 +08:00
parent 8d5ffae076
commit 73f15098f0
2 changed files with 13 additions and 7 deletions

View File

@ -169,9 +169,11 @@
<select id="dailyReportDataOverview" parameterType="map" resultType="map"> <select id="dailyReportDataOverview" parameterType="map" resultType="map">
SELECT TO_CHAR(d.report_time, 'YYYY-MM-DD') AS day, SELECT TO_CHAR(d.report_time, 'YYYY-MM-DD') AS day,
d.sn, d.sn,
td.name,
p.dept_name as "p", p.dept_name as "p",
pp.dept_name as "pp", pp.dept_name as "pp",
ppp.dept_name as "ppp", ppp.dept_name as "ppp",
ppp.dept_id as "ppp_id",
ROUND(AVG(TO_NUMBER(d.ds)), 8) AS avg_ds ROUND(AVG(TO_NUMBER(d.ds)), 8) AS avg_ds
FROM th_device_report d FROM th_device_report d
LEFT JOIN th_device td ON d.sn = td.sn LEFT JOIN th_device td ON d.sn = td.sn
@ -180,8 +182,8 @@
LEFT JOIN sys_dept ppp ON pp.parent_id = ppp.dept_id LEFT JOIN sys_dept ppp ON pp.parent_id = ppp.dept_id
WHERE d.sn IN (SELECT d.sn FROM th_device d) WHERE d.sn IN (SELECT d.sn FROM th_device d)
AND TO_CHAR(d.report_time, 'YYYY-MM-DD') = #{day} AND TO_CHAR(d.report_time, 'YYYY-MM-DD') = #{day}
GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD'), ppp.dept_name, pp.dept_name, p.dept_name, d.sn GROUP BY TO_CHAR(d.report_time, 'YYYY-MM-DD'), ppp.dept_name, pp.dept_name, p.dept_name, d.sn, ppp.dept_id, td.name
ORDER BY ppp.dept_name, pp.dept_name, p.dept_name ORDER BY ppp.dept_id ASC
</select> </select>
<!-- 选择日期范围内 某个部门id下的所有子部门的所有设备的报警每日数量统计(d.zt = '一级报警' OR d.zt = '二级报警')的alarm_count 统计当天全部的数量count --> <!-- 选择日期范围内 某个部门id下的所有子部门的所有设备的报警每日数量统计(d.zt = '一级报警' OR d.zt = '二级报警')的alarm_count 统计当天全部的数量count -->
<select id="selectAlarmCountByDeptIdAndDateRange" parameterType="map" resultType="map"> <select id="selectAlarmCountByDeptIdAndDateRange" parameterType="map" resultType="map">

View File

@ -38,7 +38,7 @@
<div style="display: flex; gap: 10px"> <div style="display: flex; gap: 10px">
<el-tag>港区数: {{ getChildCount(row, "ppp", "pp") }}</el-tag> <el-tag>港区数: {{ getChildCount(row, "ppp", "pp") }}</el-tag>
<el-tag type="warning" <el-tag type="warning"
>平均值: {{ calculateChildAvg(row, "ppp") }}</el-tag >平均值: {{ calculateChildAvg(row, "ppp") }} mg/</el-tag
> >
</div> </div>
</template> </template>
@ -50,7 +50,7 @@
<div style="display: flex; gap: 10px"> <div style="display: flex; gap: 10px">
<el-tag>企业数: {{ getChildCount(row, "pp", "p") }}</el-tag> <el-tag>企业数: {{ getChildCount(row, "pp", "p") }}</el-tag>
<el-tag type="warning" <el-tag type="warning"
>平均值: {{ calculateChildAvg(row, "pp") }}</el-tag >平均值: {{ calculateChildAvg(row, "pp") }} mg/</el-tag
> >
</div> </div>
</template> </template>
@ -62,19 +62,23 @@
<div style="display: flex; gap: 10px"> <div style="display: flex; gap: 10px">
<el-tag>设备数: {{ getChildCount(row, "p", "sn") }}</el-tag> <el-tag>设备数: {{ getChildCount(row, "p", "sn") }}</el-tag>
<el-tag type="warning" <el-tag type="warning"
>平均值: {{ calculateChildAvg(row, "p") }}</el-tag >平均值: {{ calculateChildAvg(row, "p") }} mg/</el-tag
> >
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="sn" label="设备编号"></el-table-column> <el-table-column prop="name" label="设备名称"></el-table-column>
<el-table-column <el-table-column
prop="avgDs" prop="avgDs"
label="当日均值" label="当日均值"
align="center" align="center"
></el-table-column> >
<template slot-scope="{ row }">
<div>{{ row.avgDs }} mg/</div>
</template>
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
</div> </div>