| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315 | <?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.welampiot.dao.WifiDao">    <select id="getWifiListByDTO" resultType="WifiDTO">        select w.id,w.model,w.lamp_pole_id lampPoleId,w.online,w.device_count deviceCount,w.num,s.timezone,               w.day_flow dayFlow,w.flow,w.status,w.version,w.fir_version firVersion,w.updatetime,w.net_type netType,               w.DI0,w.DO0,w.signal,w.install_date installDate,w.expiration_date expirationDate,lp.name lampPoleName        from wifi w left join lamp_pole lp on w.lamp_pole_id = lp.id            left join section s on lp.sectionid = s.id        where 1=1 <if test="sectionList != null and !sectionList.isEmpty()">                    and lp.sectionid in                    <foreach collection="sectionList" item="dto" open="(" separator="," close=")">                        #{dto}                    </foreach>            </if>            <if test="areaId != null and areaId != 0">                and lp.areaid = #{areaId}            </if>            <if test="sectionId != null and sectionId != 0">                and lp.sectionid = #{sectionId}            </if>            <choose>                <when test="onlineState == 0">                    and w.online = 0                </when>                <when test="onlineState == 1">                    and w.online = 1                </when>            </choose>            <if test="keyword != null and keyword != ''">                and w.num like '%${keyword}%'            </if>            <if test="lampPoleId != null">                and w.lamp_pole_id = #{lampPoleId}            </if>            order by w.id desc            <if test="page >= 0 and count > 0">                limit #{page},#{count}            </if>    </select>    <select id="getWifiTotalBySectionList" resultType="Integer" parameterType="WifiDTO">        select count(w.id) as total from wifi w left join lamp_pole lp on w.lamp_pole_id = lp.id        <if test="sectionList != null and !sectionList.isEmpty()">            where lp.sectionid in            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">                #{dto}            </foreach>        </if>    </select>    <select id="getWifiOnlineTotalBySectionList" resultType="Integer" parameterType="WifiDTO">        select count(w.id) as total from wifi w left join lamp_pole lp on w.lamp_pole_id = lp.id        where w.online = 1        <if test="sectionList != null and !sectionList.isEmpty()">            and lp.sectionid in            <foreach collection="sectionList" item="dto" open="(" separator="," close=")">                #{dto}            </foreach>        </if>    </select>    <select id="getWifiOutInfoByDTO" resultType="WifiDTO">        select w.remark1,w.remark2,w.remark3,w.remark4,w.remark5,w.remark6,w.AC1,w.AC2,w.AC3,w.voltage,w.current,w.power,               w.lna1_status lna1Status,w.lna2_status lna2Status,w.lna3_status lna3Status,w.type1,w.power_factor as powerFactor,               w.type2,w.type3,w.type4,w.type5,w.type6,w.close_time1 closeTime1,w.close_time2 closeTime2,w.flow as totalFlow,w.fir_version as firVersion,               w.version as softVesion,w.ledStatus,w.online,w.ACI,w.lna1_vol as lna1Vol,w.lna1_cur as lna1Cur,w.lna2_vol as lna2Vol,w.lna2_cur as lna2Cur,               w.lna3_vol as lna3Vol,w.lna3_cur as lna3Cur,               w.close_time3 closeTime3,w.close_time4 closeTime4,w.close_time5 closeTime5,w.close_time6 closeTime6,w.device_count as wifiCount,               w.open_time1 openTime1,w.open_time2 openTime2,w.open_time3 openTime3,w.open_time4 openTime4,w.open_time5 openTime5,w.open_time6 openTime6        from wifi w left join lamp_pole lp on w.lamp_pole_id = lp.id        where w.id = #{id}            <if test="sectionList != null and !sectionList.isEmpty()">                and lp.sectionid in                <foreach collection="sectionList" item="item" open="(" separator="," close=")">                    #{item}                </foreach>            </if>    </select>    <select id="getCountByDTO" resultType="int" parameterType="WifiDTO">        select count(*) as total        from wifi w        left join lamp_pole lp on lp.id = w.lamp_pole_id        where w.id = #{id}        <if test="sectionList != null and !sectionList.isEmpty()">            and lp.sectionid in            <foreach collection="sectionList" item="item" open="(" separator="," close=")">                #{item}            </foreach>        </if>        <if test="sn != null">            and w.num = #{sn}        </if>        <if test="lampPoleId != null">            and w.lamp_pole_id != #{lampPoleId}        </if>    </select>    <insert id="add" parameterType="com.welampiot.dto.WifiDTO" useGeneratedKeys="true" keyProperty="id"    >        insert into wifi(num,model,lamp_pole_id,install_date,expiration_date        <if test="ipAddr != null">,ip_addr</if>        <if test="remark1 != null">,remark1</if>        <if test="remark2 != null">,remark2</if>        <if test="remark3 != null">,remark3</if>        <if test="remark4 != null">,remark4</if>        <if test="remark5 != null">,remark5</if>        <if test="remark6 != null">,remark6</if>        )        values        (#{sn},#{model},#{lampPoleId},#{installDate},#{expirationDate}        <if test="ipAddr != null">,#{ipAddr}</if>        <if test="remark1 != null">,#{remark1}</if>        <if test="remark2 != null">,#{remark2}</if>        <if test="remark3 != null">,#{remark3}</if>        <if test="remark4 != null">,#{remark4}</if>        <if test="remark5 != null">,#{remark5}</if>        <if test="remark6 != null">,#{remark6}</if>        )    </insert>    <insert id="update" parameterType="com.welampiot.dto.WifiDTO"    >        update wifi        set        num = #{sn},        model = #{model},        <if test="ipAddr != null">ip_addr=#{ipAddr},</if>        <if test="remark1 != null">remark1=#{remark1},</if>        <if test="remark2 != null">remark2=#{remark2},</if>        <if test="remark3 != null">remark3=#{remark3},</if>        <if test="remark4 != null">remark4=#{remark4},</if>        <if test="remark5 != null">remark5=#{remark5},</if>        <if test="remark6 != null">remark6=#{remark6},</if>        <if test="type1 != null">type1=#{type1},</if>        <if test="type2 != null">type2=#{type2},</if>        <if test="type3 != null">type3=#{type3},</if>        <if test="type4 != null">type4=#{type4},</if>        <if test="type5 != null">type5=#{type5},</if>        <if test="type6 != null">type6=#{type6},</if>        <if test="AC1 != null">AC1=#{AC1},</if>        <if test="AC2 != null">AC2=#{AC2},</if>        <if test="AC3 != null">AC3=#{AC3},</if>        <if test="lna1Status != null">lna1_status=#{lna1Status},</if>        <if test="lna2Status != null">lna2_status=#{lna2Status},</if>        <if test="lna3Status != null">lna3_status=#{lna3Status},</if>        <if test="closeTime1 != null">close_time1=#{closeTime1},</if>        <if test="closeTime2 != null">close_time2=#{closeTime2},</if>        <if test="closeTime3 != null">close_time3=#{closeTime3},</if>        <if test="closeTime4 != null">close_time4=#{closeTime4},</if>        <if test="closeTime5 != null">close_time5=#{closeTime5},</if>        <if test="closeTime6 != null">close_time6=#{closeTime6},</if>        <if test="openTime1 != null">open_time1=#{openTime1},</if>        <if test="openTime2 != null">open_time1=#{openTime2},</if>        <if test="openTime3 != null">open_time1=#{openTime3},</if>        <if test="openTime4 != null">open_time1=#{openTime4},</if>        <if test="openTime5 != null">open_time1=#{openTime5},</if>        <if test="openTime6 != null">open_time1=#{openTime6},</if>        install_date = #{installDate},        expiration_date = #{expirationDate}        where 1=1        <if test="lampPoleId != null">            and lamp_pole_id = #{lampPoleId}        </if>        <if test="id != null">            and id = #{id}        </if>    </insert>    <select id="getDetailByDTO" resultType="com.welampiot.dto.WifiDTO" parameterType="com.welampiot.dto.WifiDTO">        select w.id,w.num,w.model,w.lamp_pole_id as lampPoleId,w.install_date as installDate,w.expiration_date as expirationDate,w.remark1,w.remark2,w.remark3,w.remark4,w.remark5,w.remark6,w.ip_addr as ipAddr,w.num as sn,b.sectionid as sectionId        from wifi w left join lamp_pole b on w.lamp_pole_id = b.id        where 1=1        <if test="lampPoleId != null">            and w.lamp_pole_id = #{lampPoleId}        </if>        <if test="id != null">            and w.id = #{id}        </if>    </select>    <delete id="deleteById" parameterType="int">        delete from wifi        where id=#{id}    </delete>    <select id="getWifiInfoByLampPoleId" resultType="WifiDTO">        select            w.num,            w.net_type as netType,            w.model,            w.powerModel,            w.powerWaste,            protectLevel,            w.freq        from wifi w        where w.lamp_pole_id = #{lampPoleId}    </select>    <update id="updateWifiStatus" parameterType="WifiDTO">        update            wifi w        set            w.status = #{status}        where            w.lamp_pole_id = #{lampPoleId}    </update>    <update id="updateWifiByLampPoleId" parameterType="com.welampiot.dto.WifiDTO">        update wifi        set        num = #{sn},        <if test="ipAddr != null and ipAddr != ''">ip_addr = #{ipAddr},</if>        <if test="remark1 != null and remark1 != ''">remark1 = #{remark1},</if>        <if test="remark2 != null and remark2 != ''">remark2 = #{remark2},</if>        <if test="remark3 != null and remark3 != ''">remark3 = #{remark3},</if>        <if test="remark4 != null and remark4 != ''">remark4 = #{remark4},</if>        <if test="remark5 != null and remark5 != ''">remark5 = #{remark5},</if>        <if test="remark6 != null and remark6 != ''">remark6 = #{remark6},</if>        <if test="installDate != null and installDate != ''">install_date = #{installDate},</if>        <if test="expirationDate != null and expirationDate != ''">expiration_date = #{expirationDate},</if>        model = #{model}        where 1=1        <if test="lampPoleId != null and lampPoleId != 0">            and lamp_pole_id = #{lampPoleId}        </if>        <if test="id != null and id != 0">            and id = #{id}        </if>    </update>    <select id="checkWifiData" resultType="Integer">        select count(*)        from wifi w        where 1=1        <if test="lampPoleId != null and lampPoleId != 0">            and w.lamp_pole_id != #{lampPoleId}        </if>        <if test="sn != null and sn != ''">            and w.num = #{sn}        </if>        <if test="id != null and id != 0">            and w.id != #{id}        </if>    </select>    <select id="getWifiInfoDetails" resultType="WifiDTO">        select w.remark1,w.remark2,w.remark3,w.remark4,w.remark5,w.remark6,w.AC1,w.AC2,w.AC3,w.voltage,w.current,w.power,        w.lna1_status lna1Status,w.lna2_status lna2Status,w.lna3_status lna3Status,w.type1,w.power_factor as powerFactor,        w.type2,w.type3,w.type4,w.type5,w.type6,w.close_time1 closeTime1,w.close_time2 closeTime2,w.flow as totalFlow,w.fir_version as firVersion,        w.version as softVesion,w.ledStatus,w.online,w.ACI,w.lna1_vol as lna1Vol,w.lna1_cur as lna1Cur,w.lna2_vol as lna2Vol,w.lna2_cur as lna2Cur,        w.lna3_vol as lna3Vol,w.lna3_cur as lna3Cur,        w.close_time3 closeTime3,w.close_time4 closeTime4,w.close_time5 closeTime5,w.close_time6 closeTime6,w.device_count as wifiCount,        w.open_time1 openTime1,w.open_time2 openTime2,w.open_time3 openTime3,w.open_time4 openTime4,w.open_time5 openTime5,w.open_time6 openTime6        from wifi w        where 1=1        <if test="id != null and id != 0">            and w.id = #{id}        </if>        <if test="lampPoleId != null and lampPoleId != 0">            and w.lamp_pole_id = #{lampPoleId}        </if>    </select>    <!--  智诺云信息概览累计流量和wifi连接次数  -->    <select id="getTotalWifiCountAndFlow" resultType="WifiDTO">        select            sum(w.device_count) as deviceCount,            sum(w.flow) as flow        from wifi w        left join lamp_pole lp on lp.id = w.lamp_pole_id        where 1=1        <if test="sectionList != null and !sectionList.isEmpty()">            and lp.sectionid in            <foreach collection="sectionList" item="item" open="(" separator="," close=")">                #{item}            </foreach>        </if>        <if test="sectionId != null and sectionId != 0">            and lp.sectionid = #{sectionId}        </if>        <if test="areaId != null and areaId != 0">            and lp.areaid = #{areaId}        </if>    </select>    <select id="getWifiByLampPoleId" resultType="WifiDTO">        select            w.num,w.model,w.status,w.net_type as netType,w.device_count deviceCount,            w.flow,w.day_flow as dayFlow,w.day_device_count as dayDeviceCount,w.power,            w.lanStatus,w.ledStatus,w.online,w.ACI,w.voltage,w.current,w.power_factor as powerFactor        from wifi w        where w.lamp_pole_id = #{lampPoleId}    </select>    <select id="getOneWifi" resultType="WifiDTO" parameterType="HashMap">        select W.id        from wifi W            left join lamp_pole P on P.id = W.lamp_pole_id        where P.areaid = #{areaId} and P.sectionid = #{sectionid}        <choose>            <when test="name != null and number == null">                and W.num = #{name}            </when>            <when test="name == null and number != null">                and W.num = #{number}            </when>            <otherwise>                and (W.num = #{name} or W.num = #{number})            </otherwise>        </choose>    </select></mapper>
 |