🐞 fix: 修改月报数据查询,数据详情和港区对比
This commit is contained in:
parent
057fa28723
commit
18dd550878
|
@ -128,9 +128,9 @@
|
|||
<select id="monthReportDataOverviewDeviceDs" parameterType="map" resultType="map">
|
||||
SELECT d.sn,
|
||||
p.dept_name,
|
||||
pp.dept_name as "gang_qu",
|
||||
ROUND(AVG(TO_NUMBER(d.ds)), 8) AS avg_ds
|
||||
FROM th_device_report d
|
||||
pp.dept_name AS "gang_qu",
|
||||
d.avg_value AS avg_ds
|
||||
FROM th_device_report_month1 d
|
||||
LEFT JOIN th_device td ON d.sn = td.sn
|
||||
LEFT JOIN sys_dept p ON td.dept_id = p.dept_id
|
||||
LEFT JOIN sys_dept pp ON p.parent_id = pp.dept_id
|
||||
|
@ -140,17 +140,15 @@
|
|||
WHERE d.dept_id IN (SELECT dept_id
|
||||
FROM sys_dept START WITH dept_id = #{deptId}
|
||||
CONNECT BY PRIOR dept_id = parent_id))
|
||||
AND TO_CHAR(d.report_time, 'YYYY-MM') = #{month}
|
||||
GROUP BY d.sn, p.dept_name, pp.dept_name
|
||||
AND TO_CHAR(TO_DATE(d.year || '-' || d.month, 'YYYY-MM'), 'YYYY-MM') = #{month}
|
||||
ORDER BY pp.dept_name, p.dept_name
|
||||
</select>
|
||||
|
||||
<select id="monthReportDataOverviewGangQuCompare" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
pp.dept_name as "gang_qu",
|
||||
ppp.dept_name as "gang_kou",
|
||||
ROUND(AVG(TO_NUMBER(d.ds)), 8) AS avg_ds
|
||||
FROM th_device_report d
|
||||
SELECT pp.dept_name as "gang_qu",
|
||||
ppp.dept_name as "gang_kou",
|
||||
ROUND(AVG(TO_NUMBER(d.avg_value)), 2) AS avg_ds
|
||||
FROM th_device_report_month1 d
|
||||
LEFT JOIN th_device td ON d.sn = td.sn
|
||||
LEFT JOIN sys_dept p ON td.dept_id = p.dept_id
|
||||
LEFT JOIN sys_dept pp ON p.parent_id = pp.dept_id
|
||||
|
@ -162,7 +160,7 @@
|
|||
WHERE d.dept_id IN (SELECT dept_id
|
||||
FROM sys_dept START WITH dept_id = #{deptId}
|
||||
CONNECT BY PRIOR dept_id = parent_id))
|
||||
AND TO_CHAR(d.report_time, 'YYYY-MM') = #{month}
|
||||
AND TO_CHAR(TO_DATE(d.year || '-' || d.month, 'YYYY-MM'), 'YYYY-MM') = #{month}
|
||||
GROUP BY pp.dept_name, ppp.dept_name
|
||||
ORDER BY ppp.dept_name, pp.dept_name
|
||||
</select>
|
||||
|
|
Loading…
Reference in New Issue