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