PipeInterfaceMapper.xml 13.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?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.zehong.system.mapper.PipeInterfaceMapper">
     <!--管道-->
    <resultMap type="PipeDate" id="PipeDateResult">
        <result property="pipeId"    column="pipe_id"    />
        <result property="pipePressure"    column="pipe_pressure"    />
        <result property="pipeDiameter"    column="pipe_diameter"    />
        <result property="pipeMaterial"     column="pipe_material"     />
        <result property="pipeDepth"   column="buried_depth"   />
        <result property="pipeTrend"   column="pipe_trend"   />
        <result property="buildyear"   column="build_date"   />
        <result property="pipeAddr"   column="pipe_addr"   />
        <result property="path"   column="coordinates"   />
        <result property="buildCompany"   column="build_unit"   />
        <result property="powerCompany"   column="beyond_enterprise_name"   />
        <result property="companyType"   column="beyond_enterprise_id"   />
        <result property="pipeLength"   column="pipe_length"   />

22 23 24 25 26 27 28 29 30 31 32 33 34

        <result property="pipeName"    column="pipe_name"    />
        <result property="detaildAddress"    column="detaild_address"    />
        <result property="indRegAuth"    column="ind_reg_auth"    />
        <result property="indRegAuthPer"    column="ind_reg_auth_per"    />
        <result property="indRegAuthPerCon"    column="ind_reg_auth_per_con"    />
        <result property="keyAreasGasUsage"    column="key_areas_gas_usage"    />
        <result property="affGasCom"    column="aff_gas_com"    />
        <result property="affGasComSecPer"    column="aff_gas_com_sec_per"    />
        <result property="affGasComSecPerCon"    column="aff_gas_com_sec_per_con"    />
        <result property="secCheckTime"    column="sec_check_time"    />
        <result property="unitGasUserRes"    column="unit_gas_user_res"    />
        <result property="unitGasUserResCon"    column="unit_gas_user_res_con"    />
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    </resultMap>

    <!--调压箱-->
    <resultMap type="DeviceData" id="DeviceDateResult">
        <result property="deviceId"    column="device_id"    />
        <result property="type"   column="device_type"   />
        <result property="deviceName"   column="device_name"   />
        <result property="deviceCode"   column="device_code"   />
        <result property="deviceAddr"   column="device_addr"   />
        <result property="longitude"   column="longitude"   />
        <result property="latitude"   column="latitude"   />
        <result property="companyType"   column="device_id"   />
        <result property="beyondEnterpriseName"   column="beyond_enterprise_name"   />
        <result property="companyType"   column="beyond_enterprise_id"   />
        <result property="iconUrl"   column="icon_url"   />
    </resultMap>

    <!--下级设备数据-->
    <resultMap type="PressureFlow" id="PressureFlowResult">
        <result property="deviceId"    column="relation_device_id"    />
        <result property="deviceNo"    column="device_model"    />
        <result property="deviceType"   column="device_type"   />
        <result property="reportTime"   column="create_time"   />
        <result property="iotNo"   column="iot_no"   />
    </resultMap>

    <!--场站数据-->
    <resultMap type="TSiteStationInfoData" id="TSiteStationInfoDataResult">
        <result property="siteStationId"    column="site_station_id"    />
        <result property="stationName"    column="site_station_name"    />
        <result property="stationType"    column="site_station_type"    />
        <result property="longitude"   column="longitude"   />
        <result property="latitude"   column="latitude"   />
        <result property="buildyear"   column="create_time"   />
        <result property="buildCompany"   column="build_unit"   />
        <result property="powerCompany"   column="beyond_enterprise_name"   />
        <result property="companyType"   column="beyond_enterprise_id"   />
        <result property="pictureAddress"   column="picture_address"   />
    </resultMap>

    <!--监控数据-->
    <resultMap type="TvideoManagerData" id="TvideoManagerDataResult">
        <result property="companyType"    column="video_manager_id"    />
        <result property="videoManagerId"    column="video_manager_id"    />
        <result property="videoName"    column="video_name"    />
        <result property="resourceId"   column="resource_id"   />
        <result property="longitude"   column="longitude"   />
        <result property="latitude"   column="latitude"   />
        <result property="videoAddress"   column="video_address"   />
        <result property="type"   column="type"   />
        <result property="companyType"   column="beyond_enterprise_id"   />
    </resultMap>

    <!--燃气用户数据-->
    <resultMap type="TdetectorUserData" id="TdetectorUserDataResult">
        <result property="usrName"    column="nick_name"    />
        <result property="usrType"    column="user_type"    />
        <result property="longitude"   column="longitude"   />
        <result property="latitude"   column="latitude"   />
        <result property="phone"   column="phone"   />
        <result property="address"   column="address"   />
    </resultMap>

    <!--查询企业名称id-->
    <resultMap type="TenterpriseInfoData" id="TenterpriseInfoDataResult">
        <result property="enterpriseId"    column="enterprise_id"    />
        <result property="enterpriseName"    column="enterprise_name"    />
        <result property="enterpriseType"    column="enterprise_type"    />

    </resultMap>

    <!--感知设备列表-->
    <resultMap type="TAssociatedEquipment" id="TAssociatedEquipmentResult">
        <result property="deviceCode"    column="device_code"    />
        <result property="deviceName"    column="device_name"    />
        <result property="detectionMedium"    column="detection_medium"    />
        <result property="linkman"    column="linkman"    />
        <result property="phone"    column="phone"    />
        <result property="detectorStatus"    column="detector_status"    />
        <result property="createTime"    column="alarm_time"    />
    </resultMap>

    <!--查询管道数据列表-->
    <select id="selectPipeData" parameterType="PipeDate" resultMap="PipeDateResult">
        select format(pipe_length,2)pipe_length,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
        where is_del='0'
        <if test="enterId != null and enterId != 0">
            and beyond_enterprise_id=#{enterId}
        </if>
    </select>

126 127 128 129 130 131 132 133 134 135 136 137
    <!--查询管道数据列表-->
    <select id="getPipeForSelect" parameterType="PipeDate" resultMap="PipeDateResult">
        select format(pipe_length,2)pipe_length,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,
               buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name,
               pipe_name,detaild_address,ind_reg_auth,ind_reg_auth_per,ind_reg_auth_per_con,key_areas_gas_usage,
               aff_gas_com,aff_gas_com_sec_per,aff_gas_com_sec_per_con,sec_check_time,unit_gas_user_res,unit_gas_user_res_con from t_pipe_info
        where is_del='0' and pipe_name is not null
        <if test="enterId != null and enterId != 0">
            and beyond_enterprise_id=#{enterId}
        </if>
    </select>

138 139 140 141 142 143 144 145
    <select id="getPipeBypipeId" parameterType="PipeDate" resultMap="PipeDateResult">
        select format(pipe_length,2)pipe_length,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,
               buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name,
               pipe_name,detaild_address,ind_reg_auth,ind_reg_auth_per,ind_reg_auth_per_con,key_areas_gas_usage,
               aff_gas_com,aff_gas_com_sec_per,aff_gas_com_sec_per_con,sec_check_time,unit_gas_user_res,unit_gas_user_res_con from t_pipe_info
        where pipe_id = #{pipeId}
    </select>

146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
    <!--获取分组数据-->
    <select id="selectGroupPipeData" parameterType="PipeDate" resultMap="PipeDateResult">
        select beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
        where is_del='0'
		group by beyond_enterprise_name
    </select>

    <!--调压箱数据查询方法-->
    <select id="selectDeviceData" resultMap="DeviceDateResult">
       select beyond_enterprise_id,icon_url,device_id,device_type,device_name,device_code,device_addr,longitude,latitude,beyond_enterprise_name from t_device_info
       where device_type='2' and is_del='0'
        <if test="enterId != null and enterId != 0">
            and beyond_enterprise_id=#{enterId}
        </if>
    </select>

    <!--查询下级设备数据-->
    <select id="selectPressureFlow" parameterType="java.util.List" resultMap="PressureFlowResult">
      select device_model,device_type,create_time,relation_device_id,iot_no from t_relation_device_detail_info
      where  relation_device_type='1' and  relation_device_id = #{deviceId}
    </select>

    <!--场站信息查询方法-->
    <select id="selectTSiteStationInfoData" resultMap="TSiteStationInfoDataResult">
       select beyond_enterprise_id,picture_address,site_station_id,site_station_name,site_station_type,longitude,latitude,address,create_time,build_unit,beyond_enterprise_name
       from t_site_station_info where is_del='0'
        <if test="enterId != null and enterId != 0">
            and beyond_enterprise_id=#{enterId}
        </if>
    </select>

    <!--查询场站下级数据-->
    <select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult">
         select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info
         where  relation_device_type='2' and relation_device_id = #{deviceId}
    </select>

    <!--监控信息查询-->
    <select id="selectTvideoManagerData" resultMap="TvideoManagerDataResult">
        select beyond_enterprise_id,video_manager_id,video_name,resource_id,longitude,latitude,video_address,type from  t_video_manager
        where is_del='0'
    </select>

    <!--燃气用户信息查询接口-->
    <select id="selectTdetectorUser"  resultMap="TdetectorUserDataResult">
        select nick_name,user_type,longitude,latitude,phone,address from t_detector_user
        where is_del='0'
    </select>

    <!--查询企业名称id方法-->
    <select id="selectTenterpriseInfoData" resultMap="TenterpriseInfoDataResult">
        select enterprise_id,enterprise_name,enterprise_type from t_enterprise_info where is_del='0'
    </select>

    <!--查询阀门井数据-->
    <select id="selectvalveData" resultMap="DeviceDateResult">
       select beyond_enterprise_id,device_id,icon_url,device_type,device_name,device_code,device_addr,longitude,latitude,beyond_enterprise_name from t_device_info
       where device_type='1' and is_del='0'
        <if test="enterId != null and enterId != 0">
            and beyond_enterprise_id=#{enterId}
        </if>
    </select>

    <!--查询在线下级设备数量-->
    <select id="selectOnlineQuantity" parameterType="java.util.List" resultType="java.lang.Integer">
       select count(detector_id) as id from t_detector_info
       where is_del ='0' and detector_status=#{isOnLine} and detector_code in
        (
        <foreach collection="pressureList" item="item" index="index" separator=",">
            #{item.iotNo}
        </foreach>
        )
    </select>

    <!--查询历史报警数量-->
    <select id="selectHistoricalAlarm"  parameterType="java.util.List" resultType="java.lang.Integer">
        select count(id) from t_detector_report_data
        where detector_code in
        <foreach collection="list" item="pressureList" open="(" close=")" index="index" separator=",">
            #{pressureList.iotNo}
        </foreach>
    </select>

    <!--查询已处理报警-->
    <select id="selectProcessAlarm" parameterType="java.util.List"  resultType="java.lang.Integer">
         select count(id) from t_detector_report_data
        where is_cancel_alarm !='0'  and detector_code in
        <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
            #{item.iotNo}
        </foreach>
    </select>

    <!--查询报警中-->
    <select id="selectInAlarm" parameterType="java.util.List"  resultType="java.lang.Integer">
        select count(id) from t_detector_report_data
        where is_cancel_alarm ='0'  and detector_code in
        <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
            #{item.iotNo}
        </foreach>
    </select>

    <!--查询 场站/设备 列表信息方法-->
    <select id="selectSensingDevice" resultMap="TAssociatedEquipmentResult">
      select b.iot_no device_code,b.device_name device_name,b.detection_medium,a.linkman,a.phone,c.detector_status,c.alarm_time
      from t_device_info a
      left join t_relation_device_detail_info b on a.device_id=b.relation_device_id
      left join t_detector_info c on b.iot_no=c.detector_code
      where a.device_id=#{devId} and b.relation_device_type=#{relationDeviceType}
    </select>

    <!--查询上级设备是否有下级设备-->
    <select id="selectValveWellIsNUll" resultType="java.lang.Integer">
        select count(relation_device_detail_id) from t_relation_device_detail_info where relation_device_id = #{deviceId} and relation_device_type=#{type}
    </select>

    <!--查询下级全部数据方法-->
    <select id="selectPressureFlows"   resultMap="PressureFlowResult">
      select device_model,device_type,create_time,relation_device_id,iot_no from t_relation_device_detail_info
      where  relation_device_type=#{type}
    </select>

</mapper>