<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.jeecg.modules.mdc.mapper.MdcEquipmentFaultInfoMapper">
|
|
<select id="findFaultRecord" resultType="org.jeecg.modules.mdc.vo.EquFaultRecord">
|
SELECT
|
t3.equipment_code equipmentId,
|
t1.fault_start_time startTime,
|
t2.actual_end_time endTime
|
FROM
|
eam_report_repair t1
|
LEFT JOIN eam_repair_order t2 ON t2.report_id = t1.id
|
LEFT JOIN eam_equipment t3 ON t1.equipment_id = t3.id
|
WHERE
|
(
|
( t1.fault_start_time BETWEEN #{startTime} AND #{endTime} )
|
OR ( t2.actual_end_time BETWEEN #{startTime} AND #{endTime} )
|
OR ( t1.fault_start_time < #{startTime} AND t2.actual_end_time IS NULL )
|
)
|
AND t3.equipment_code IN
|
<foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
|
#{ id }
|
</foreach>
|
AND t1.report_status != 'ABOLISH'
|
</select>
|
|
<select id="getMaxStaticsData" resultType="java.lang.String">
|
SELECT TOP 1 the_date FROM mdc_equipment_fault_info ORDER BY the_date DESC
|
</select>
|
</mapper>
|