|
|
@ -76,15 +76,27 @@
|
|
|
|
<!--设备稳定性 MTBF 每日-->
|
|
|
|
<!--设备稳定性 MTBF 每日-->
|
|
|
|
<select id="getMTBFList" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
|
|
|
|
<select id="getMTBFList" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
|
|
|
|
select
|
|
|
|
select
|
|
|
|
row_number() over (order by cast(eo.actual_operation_time as decimal(6, 2))/2 desc) as serialNumber,
|
|
|
|
row_number() over (order by sum(
|
|
|
|
eo.equipment_code as equipmentCode,
|
|
|
|
|
|
|
|
eo.equipment_name as equipmentName,
|
|
|
|
|
|
|
|
case
|
|
|
|
case
|
|
|
|
when eo.shutdown_times > 0 THEN cast(cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times as decimal(18,2))
|
|
|
|
when eo.shutdown_times > 0 THEN cast(cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times as decimal(18,2))
|
|
|
|
else 0
|
|
|
|
else 0
|
|
|
|
end as mtbf
|
|
|
|
end
|
|
|
|
|
|
|
|
) desc) as serialNumber,
|
|
|
|
|
|
|
|
eo.equipment_code as equipmentCode,
|
|
|
|
|
|
|
|
eo.equipment_name as equipmentName,
|
|
|
|
|
|
|
|
cast(sum(
|
|
|
|
|
|
|
|
case
|
|
|
|
|
|
|
|
when eo.shutdown_times > 0 THEN cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times
|
|
|
|
|
|
|
|
else 0
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
)/COUNT(equipment_code) as decimal(18,2))as mtbf
|
|
|
|
from equ_operation eo
|
|
|
|
from equ_operation eo
|
|
|
|
where day(eo.create_time) = day(getdate())
|
|
|
|
<where>
|
|
|
|
|
|
|
|
<if test="timeDimension == 'dd' "> and day(eo.create_time) = day(getdate())</if>
|
|
|
|
|
|
|
|
<if test="timeDimension == 'mm' "> and month(eo.create_time) = month(getdate())</if>
|
|
|
|
|
|
|
|
<if test="timeDimension == 'yyyy' "> and year(eo.create_time) = year(getdate())</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
GROUP BY equipment_code,equipment_name
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<!--完好设备占比-->
|
|
|
|
<!--完好设备占比-->
|
|
|
|