| | |
| | | start_time |
| | | </select> |
| | | |
| | | <!--计算一段时间内的数据--> |
| | | <select id="listEquipmentRunningSection" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | mdc_equipment_running_section |
| | | WHERE |
| | | equipment_id = #{ equipmentId } |
| | | AND (start_long <= #{ endLong } AND end_long >= #{ startLong }) |
| | | ORDER BY |
| | | start_time |
| | | </select> |
| | | |
| | | <!--计算一段时间内的运行数据--> |
| | | <select id="listEquipmentRunningSectionRun" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | mdc_equipment_running_section |
| | | WHERE |
| | | equipment_id = #{ equipmentId } |
| | | AND status <![CDATA[ <> ]]> '22' |
| | | AND (start_long <= #{ endLong } AND end_long >= #{ startLong }) |
| | | ORDER BY |
| | | start_time |
| | | </select> |
| | | |
| | | <!--计算一段时间内的故障数据--> |
| | | <select id="listEquipmentRunningSectionError" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | mdc_equipment_running_section |
| | | WHERE |
| | | equipment_id = #{ equipmentId } |
| | | AND status = '22' |
| | | AND (start_long <= #{ endLong } AND end_long >= #{ startLong }) |
| | | ORDER BY |
| | | start_time |
| | | </select> |
| | | |
| | | <!--查询一段时间内的报警数据--> |
| | | <select id="findAlarmList" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | mdc_equipment_running_section |
| | | <where> |
| | | <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 "> |
| | | AND equipment_id IN |
| | | <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=","> |
| | | #{ id } |
| | | </foreach> |
| | | </if> |
| | | AND (start_time <= #{ vo.endDate } AND end_time >= #{ vo.startDate }) |
| | | AND status = '22' |
| | | </where> |
| | | ORDER BY |
| | | start_time |
| | | </select> |
| | | |
| | | <!--查询数量--> |
| | | <select id="findAlarmCount" resultType="java.lang.Integer"> |
| | | SELECT |
| | | COUNT(*) |
| | | FROM |
| | | mdc_equipment_running_section |
| | | <where> |
| | | AND status = '22' |
| | | AND alarm = #{ alarmCode } |
| | | AND (start_time <= #{ endDate } AND end_time >= #{ startDate }) |
| | | AND equipment_id = #{ equipmentId } |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据日期查询数量--> |
| | | <select id="findAlarmCountByDate" resultType="java.lang.Integer"> |
| | | SELECT |
| | | COUNT(*) |
| | | FROM |
| | | mdc_equipment_running_section |
| | | <where> |
| | | AND status = '22' |
| | | AND alarm = #{ vo.alarmCode } |
| | | AND (start_time <= #{ endDate } AND end_time >= #{ startDate }) |
| | | <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 "> |
| | | AND equipment_id IN |
| | | <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=","> |
| | | #{ id } |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |