1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?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.NetworkDao">
- <insert id="add" parameterType="com.welampiot.dto.NetworkDTO" useGeneratedKeys="true" keyProperty="id">
- insert into network(network_name,devicesn,protocoltype,areaid,sectionid,createtime,net_type,gatewaytype,devicetype,userId)
- values
- (#{networkName},#{deviceSn},#{protocolType},#{areaId},#{sectionId},#{createTime},#{netType},#{gatewayType},#{deviceType},#{userId})
- <!-- <if test="sectionList != null and !sectionList.isEmpty()">-->
- <!-- where l.sectionid in-->
- <!-- <foreach item="dto" collection="sectionList" open="(" separator="," close=")">-->
- <!-- #{dto}-->
- <!-- </foreach>-->
- <!-- </if>-->
- </insert>
- <update id="update" parameterType="com.welampiot.dto.NetworkDTO">
- update network
- set
- network_name=#{networkName},
- devicesn=#{deviceSn},
- protocoltype=#{protocolType},
- areaid=#{areaId},
- sectionid=#{sectionId},
- devicetype=#{deviceType}
- where id = #{id}
- </update>
-
- <select id="getNetListByDTO" resultType="NetworkDTO">
- select
- <choose>
- <when test="version == 0">
- gl.chinese_name as area,
- </when>
- <when test="version == 1">
- gl.english_name as area,
- </when>
- <otherwise>
- gl.ru_name as area,
- </otherwise>
- </choose>
- n.id,n.network_name as networkName,n.devicesn as deviceSn,n.protocoltype as protocolType,n.status,
- n.model,n.lampcount as lampCount,n.fre_band_info as freBandInfo,n.simcard as simCard,n.operator,s.name as section
- from network n
- left join section s on n.sectionid = s.id
- left join global_location gl on s.pid = gl.id
- <if test="sectionList != null and !sectionList.isEmpty()">
- where n.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getNetworkDetails" resultType="NetworkDTO">
- select
- n.id,
- n.network_name as networkName,
- n.devicesn as deviceSn,
- n.protocoltype as protocolType,
- n.model,
- n.areaid as areaId,
- n.sectionid as sectionId,
- n.longitude,
- n.latitude,
- n.fre_band_info freBandInfo,
- n.simcard as simCard,
- n.operator,
- s.name as section
- <choose>
- <when test="version == 0">
- ,gl.chinese_name as area
- </when>
- <when test="version == 1">
- ,gl.english_name as area
- </when>
- <otherwise>
- ,gl.ru_name as area
- </otherwise>
- </choose>
- from network n
- left join section s on s.id = n.sectionid
- left join global_location gl on s.pid = gl.id
- where n.id = #{id}
- </select>
- <select id="getNetworkNavList" resultType="NetworkDTO">
- select
- n.id,
- n.network_name as networkName
- from network n
- <if test="sectionList != null and !sectionList.isEmpty()">
- where n.sectionid in
- <foreach collection="sectionList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- </mapper>
|