<?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="com.whyc.mapper.AlarmInspectionMapper" >
|
|
<resultMap id="ResultMap_AlarmInspection" type="com.whyc.pojo.web_site.AlarmInspection">
|
<id column="id" property="id" />
|
<result column="station_id" property="stationId" />
|
<result column="station_name" property="stationName" />
|
<result column="power_id" property="powerId" />
|
<result column="power_name" property="powerName" />
|
<result column="dev_id" property="devId" />
|
<result column="dev_name" property="devName" />
|
<result column="batt_group_id" property="battGroupId" />
|
<result column="batt_group_name" property="battGroupName" />
|
<result column="type" property="type" />
|
<result column="alm_num" property="almNum" />
|
<result column="alm_id" property="almId" />
|
<result column="alm_id_origin" property="almIdOrigin" />
|
<result column="alm_level" property="almLevel" />
|
<result column="is_exist" property="isExist" />
|
<result column="alm_start_time" property="almStartTime" />
|
<result column="create_time" property="createTime" />
|
<association property="baoJiGroup" javaType="com.whyc.pojo.db_user.Baojigroup">
|
<id column="baoji_group_id" property="baojiGroupId" />
|
<result column="baoji_group_name" property="baojiGroupName" />
|
</association>
|
<association property="diagnosis" javaType="com.whyc.pojo.web_site.AlarmDiagnosis">
|
<result column="alm_name" property="almName" />
|
<result column="alm_reason" property="almReason" />
|
<result column="alm_solution" property="almSolution" />
|
<result column="device_spare_ids" property="deviceSpareIds" />
|
<result column="device_spare_names" property="deviceSpareNames" />
|
</association>
|
|
</resultMap>
|
|
<select id="getList" resultMap="ResultMap_AlarmInspection">
|
select
|
ai.id,
|
ai.station_id,
|
ai.station_name,
|
ai.power_id,
|
ai.power_name,
|
ai.dev_id,
|
ai.dev_name,
|
ai.batt_group_id,
|
ai.batt_group_name,
|
ai.type,
|
ai.alm_num,
|
ai.alm_id,
|
ai.alm_id_origin,
|
ai.alm_level,
|
ai.is_exist,
|
ai.alm_start_time,
|
ai.create_time,
|
bg.baoji_group_id,
|
bg.baoji_group_name,
|
ad.alm_name,
|
ad.alm_reason,
|
ad.alm_solution,
|
ad.device_spare_ids,
|
ad.device_spare_names
|
from web_site.tb_alarm_inspection ai,
|
web_site.tb_alarm_diagnosis ad,
|
db_user.tb_baojigroup bg,
|
db_user.tb_baojigroup_power bgp
|
where ai.alm_id = ad.alm_id
|
and ai.station_id = bgp.station_id
|
and bg.baoji_group_id = bgp.baoji_group_id
|
and ai.station_id = #{stationId}
|
<if test="inspectionType == 1">
|
and ai.alm_level = 1
|
</if>
|
<if test="inspectionType == 2">
|
and ai.alm_level != 1
|
</if>
|
</select>
|
</mapper>
|