|
|
@@ -1,46 +1,45 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yunfeiyun.agmp.iotm.web.mapper.IotDeviceconnMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="IotDeviceconn" id="IotDeviceconnResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="devconnBid" column="devconnBid" />
|
|
|
- <result property="devclassBid" column="devclassBid" />
|
|
|
- <result property="devtypeBid" column="devtypeBid" />
|
|
|
- <result property="firmBid" column="firmBid" />
|
|
|
- <result property="devconnType" column="devconnType" />
|
|
|
- <result property="devconnName" column="devconnName" />
|
|
|
- <result property="devtypeName" column="devtypeName" />
|
|
|
- <result property="devconnConfig" column="devconnConfig" />
|
|
|
- <result property="devconnRemark" column="devconnRemark" />
|
|
|
- <result property="devconnCreator" column="devconnCreator" />
|
|
|
- <result property="devconnModifier" column="devconnModifier" />
|
|
|
- <result property="devconnModifieddate" column="devconnModifieddate" />
|
|
|
- <result property="devconnCreateddate" column="devconnCreateddate" />
|
|
|
- <result property="tid" column="tid" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="devconnBid" column="devconnBid"/>
|
|
|
+ <result property="devclassBid" column="devclassBid"/>
|
|
|
+ <result property="devtypeBid" column="devtypeBid"/>
|
|
|
+ <result property="firmBid" column="firmBid"/>
|
|
|
+ <result property="devconnType" column="devconnType"/>
|
|
|
+ <result property="devconnName" column="devconnName"/>
|
|
|
+ <result property="devtypeName" column="devtypeName"/>
|
|
|
+ <result property="devconnConfig" column="devconnConfig"/>
|
|
|
+ <result property="devconnRemark" column="devconnRemark"/>
|
|
|
+ <result property="devconnCreator" column="devconnCreator"/>
|
|
|
+ <result property="devconnModifier" column="devconnModifier"/>
|
|
|
+ <result property="devconnModifieddate" column="devconnModifieddate"/>
|
|
|
+ <result property="devconnCreateddate" column="devconnCreateddate"/>
|
|
|
+ <result property="tid" column="tid"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectIotDeviceconnVo">
|
|
|
select id, devconnBid, devtypeBid, devconnType, devconnName, devconnConfig, devconnRemark, devconnCreator,
|
|
|
- devconnModifier, devconnModifieddate, devconnCreateddate, tid from IotDeviceconn
|
|
|
+ devconnModifier, devconnModifieddate, devconnCreateddate, tid from IotDeviceconn
|
|
|
</sql>
|
|
|
<update id="updateBatchByBid">
|
|
|
- <foreach collection="list" open="(" separator="," close=")" index="index" item="item">
|
|
|
+ <foreach collection="list" separator=";" index="index" item="item">
|
|
|
update IotDeviceconn
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="devconnType != null">devcfgBid = #{devcfgBid},</if>
|
|
|
- <if test="devconnName != null">tid = #{tid},</if>
|
|
|
- <if test="devconnConfig != null">devBid = #{devBid},</if>
|
|
|
- <if test="devconnRemark != null">devcfgCmd = #{devcfgCmd},</if>
|
|
|
- <if test="devconnCreator != null">devcfgContext = #{devcfgContext},</if>
|
|
|
- <if test="devconnModifier != null">devcfgCreator = #{devcfgCreator},</if>
|
|
|
- <if test="devcfgModifier != null">devcfgModifier = #{devcfgModifier},</if>
|
|
|
- <if test="devconnModifieddate != null">devcfgModifieddate = #{devcfgModifieddate},</if>
|
|
|
- <if test="devconnCreateddate != null">devcfgCreateddate = #{devcfgCreateddate},</if>
|
|
|
+ <if test="item.devconnType != null">devconnType = #{item.devconnType},</if>
|
|
|
+ <if test="item.devconnName != null">devconnName = #{item.devconnName},</if>
|
|
|
+ <if test="item.devconnConfig != null">devconnConfig = #{item.devconnConfig},</if>
|
|
|
+ <if test="item.devconnRemark != null">devconnRemark = #{item.devconnRemark},</if>
|
|
|
+ <if test="item.devconnCreator != null">devconnCreator = #{item.devconnCreator},</if>
|
|
|
+ <if test="item.devconnModifier != null">devconnModifier = #{item.devconnModifier},</if>
|
|
|
+ <if test="item.devconnModifieddate != null">devconnModifieddate = #{item.devconnModifieddate},</if>
|
|
|
+ <if test="item.devconnCreateddate != null">devconnCreateddate = #{item.devconnCreateddate},</if>
|
|
|
</trim>
|
|
|
- where devconnBid = #{devconnBid}
|
|
|
+ where devconnBid = #{item.devconnBid}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
<update id="updateIotDeviceconnByBid">
|
|
|
@@ -61,23 +60,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectIotDeviceconnList" parameterType="IotDeviceconn" resultMap="IotDeviceconnResult">
|
|
|
select dcn.devconnBid, dcn.devtypeBid, dcn.devconnType, dcn.devconnName, dcn.devconnConfig, dcn.devconnRemark,
|
|
|
- dcn.devconnCreator, dcn.devconnModifier, dcn.devconnModifieddate, dcn.devconnCreateddate,
|
|
|
- dt.devclassBid, dt.firmBid, dt.devtypeName
|
|
|
+ dcn.devconnCreator, dcn.devconnModifier, dcn.devconnModifieddate, dcn.devconnCreateddate,
|
|
|
+ dt.devclassBid, dt.firmBid, dt.devtypeName
|
|
|
from IotDeviceconn as dcn
|
|
|
- left join TosDevicetype as dt on dt.devtypeBid = dcn.devtypeBid
|
|
|
+ left join TosDevicetype as dt on dt.devtypeBid = dcn.devtypeBid
|
|
|
|
|
|
<where>
|
|
|
tid = #{tid}
|
|
|
- <if test="devconnBid != null and devconnBid != ''"> and dcn.devconnBid = #{devconnBid}</if>
|
|
|
- <if test="devtypeBid != null and devtypeBid != ''"> and dcn.devtypeBid = #{devtypeBid}</if>
|
|
|
- <if test="devconnType != null and devconnType != ''"> and dcn.devconnType = #{devconnType}</if>
|
|
|
- <if test="devconnName != null and devconnName != ''"> and dcn.devconnName like concat('%', #{devconnName}, '%')</if>
|
|
|
- <if test="devconnConfig != null and devconnConfig != ''"> and dcn.devconnConfig = #{devconnConfig}</if>
|
|
|
- <if test="devconnRemark != null and devconnRemark != ''"> and dcn.devconnRemark = #{devconnRemark}</if>
|
|
|
- <if test="devconnCreator != null and devconnCreator != ''"> and dcn.devconnCreator = #{devconnCreator}</if>
|
|
|
- <if test="devconnModifier != null and devconnModifier != ''"> and dcn.devconnModifier = #{devconnModifier}</if>
|
|
|
- <if test="devconnModifieddate != null and devconnModifieddate != ''"> and dcn.devconnModifieddate = #{devconnModifieddate}</if>
|
|
|
- <if test="devconnCreateddate != null and devconnCreateddate != ''"> and dcn.devconnCreateddate = #{devconnCreateddate}</if>
|
|
|
+ <if test="devconnBid != null and devconnBid != ''">and dcn.devconnBid = #{devconnBid}</if>
|
|
|
+ <if test="devtypeBid != null and devtypeBid != ''">and dcn.devtypeBid = #{devtypeBid}</if>
|
|
|
+ <if test="devconnType != null and devconnType != ''">and dcn.devconnType = #{devconnType}</if>
|
|
|
+ <if test="devconnName != null and devconnName != ''">and dcn.devconnName like concat('%', #{devconnName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="devconnConfig != null and devconnConfig != ''">and dcn.devconnConfig = #{devconnConfig}</if>
|
|
|
+ <if test="devconnRemark != null and devconnRemark != ''">and dcn.devconnRemark = #{devconnRemark}</if>
|
|
|
+ <if test="devconnCreator != null and devconnCreator != ''">and dcn.devconnCreator = #{devconnCreator}</if>
|
|
|
+ <if test="devconnModifier != null and devconnModifier != ''">and dcn.devconnModifier = #{devconnModifier}
|
|
|
+ </if>
|
|
|
+ <if test="devconnModifieddate != null and devconnModifieddate != ''">and dcn.devconnModifieddate =
|
|
|
+ #{devconnModifieddate}
|
|
|
+ </if>
|
|
|
+ <if test="devconnCreateddate != null and devconnCreateddate != ''">and dcn.devconnCreateddate =
|
|
|
+ #{devconnCreateddate}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
@@ -85,45 +91,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
parameterType="com.yunfeiyun.agmp.iotm.web.domain.reqvo.IotDeviceconnListReqVo"
|
|
|
resultType="com.yunfeiyun.agmp.iotm.web.domain.resvo.IotDeviceconnListResVo">
|
|
|
SELECT dcn.devconnBid, dcn.devconnType, dcn.devconnName, dcn.devconnRemark, dc.devclassBid, dc.devclassCode,
|
|
|
- dc.devclassName, dt.devtypeBid, dt.devtypeCode, dt.devtypeName, dcn.devconnCreateddate
|
|
|
+ dc.devclassName, dt.devtypeBid, dt.devtypeCode, dt.devtypeName, dcn.devconnCreateddate
|
|
|
FROM IotDeviceconn AS dcn
|
|
|
- LEFT JOIN TosDevicetype AS dt ON dt.devtypeBid = dcn.devtypeBid
|
|
|
- LEFT JOIN TosDeviceclass AS dc ON dc.devclassBid = dt.devclassBid
|
|
|
+ LEFT JOIN TosDevicetype AS dt ON dt.devtypeBid = dcn.devtypeBid
|
|
|
+ LEFT JOIN TosDeviceclass AS dc ON dc.devclassBid = dt.devclassBid
|
|
|
<where>
|
|
|
dcn.tid = #{tid}
|
|
|
- <if test="devclassCode != null and devclassCode != ''"> and dc.devclassCode like concat('%', #{devclassCode}, '%')</if>
|
|
|
- <if test="devclassName != null and devclassName != ''"> and dc.devclassName like concat('%', #{devclassName}, '%')</if>
|
|
|
- <if test="devtypeName != null and devtypeName != ''"> and dt.devtypeName like concat('%', #{devtypeName}, '%')</if>
|
|
|
- <if test="devtypeCode != null and devtypeCode != ''"> and dt.devtypeCode like concat('%', #{devtypeCode}, '%')</if>
|
|
|
- <if test="devconnName != null and devconnName != ''"> and dcn.devconnName like concat('%', #{devconnName}, '%')</if>
|
|
|
- <if test="devconnType != null and devconnType != ''"> and devconnType = #{devconnType}</if>
|
|
|
+ <if test="devclassCode != null and devclassCode != ''">and dc.devclassCode like concat('%',
|
|
|
+ #{devclassCode}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="devclassName != null and devclassName != ''">and dc.devclassName like concat('%',
|
|
|
+ #{devclassName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="devtypeName != null and devtypeName != ''">and dt.devtypeName like concat('%', #{devtypeName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="devtypeCode != null and devtypeCode != ''">and dt.devtypeCode like concat('%', #{devtypeCode},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="devconnName != null and devconnName != ''">and dcn.devconnName like concat('%', #{devconnName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="devconnType != null and devconnType != ''">and devconnType = #{devconnType}</if>
|
|
|
</where>
|
|
|
GROUP BY dcn.devtypeBid
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectIotDeviceconnByBid" parameterType="string" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn">
|
|
|
+ <select id="selectIotDeviceconnByBid" parameterType="string"
|
|
|
+ resultType="com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn">
|
|
|
SELECT dcn.devconnBid, dcn.devconnType, dcn.devconnName, dcn.devconnRemark, dc.devclassBid, dc.devclassCode,
|
|
|
- dc.devclassName, dt.devtypeBid, dt.devtypeCode, dt.devtypeName, dcn.devconnCreateddate, dt.firmBid
|
|
|
+ dc.devclassName, dt.devtypeBid, dt.devtypeCode, dt.devtypeName, dcn.devconnCreateddate, dt.firmBid
|
|
|
FROM IotDeviceconn AS dcn
|
|
|
- LEFT JOIN TosDevicetype AS dt ON dt.devtypeBid = dcn.devtypeBid
|
|
|
- LEFT JOIN TosDeviceclass AS dc ON dc.devclassBid = dt.devclassBid
|
|
|
+ LEFT JOIN TosDevicetype AS dt ON dt.devtypeBid = dcn.devtypeBid
|
|
|
+ LEFT JOIN TosDeviceclass AS dc ON dc.devclassBid = dt.devclassBid
|
|
|
WHERE dcn.devconnBid = #{devconnBid}
|
|
|
</select>
|
|
|
<select id="selectIotDeviceconnAllList" resultType="com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn">
|
|
|
<include refid="selectIotDeviceconnVo"/>
|
|
|
</select>
|
|
|
+ <select id="selectIotDeviceconnListByDevtypeCode"
|
|
|
+ resultType="com.yunfeiyun.agmp.iot.common.domain.IotDeviceconn">
|
|
|
+ select
|
|
|
+ idc.*
|
|
|
+ from IotDeviceconn idc
|
|
|
+ LEFT JOIN TosDevicetype tdt on tdt.devtypeBid = idc.devtypeBid
|
|
|
+ where
|
|
|
+ tdt.devtypeCode = #{devtypeCode}
|
|
|
+ <if test="devconnType != null and devconnType != ''">
|
|
|
+ and idc.devconnType = #{devconnType}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertIotDeviceconnByBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into IotDeviceconn (
|
|
|
- devconnBid, devtypeBid, devconnType, devconnName, devconnConfig, devconnRemark, devconnCreator,
|
|
|
- devconnModifier, devconnModifieddate, devconnCreateddate, tid
|
|
|
+ devconnBid, devtypeBid, devconnType, devconnName, devconnConfig, devconnRemark, devconnCreator,
|
|
|
+ devconnModifier, devconnModifieddate, devconnCreateddate, tid
|
|
|
)
|
|
|
values
|
|
|
<foreach collection="list" item="item" separator="," index="index">
|
|
|
(
|
|
|
- #{item.devconnBid}, #{item.devtypeBid}, #{item.devconnType}, #{item.devconnName}, #{item.devconnConfig},
|
|
|
- #{item.devconnRemark}, #{item.devconnCreator}, #{item.devconnModifier}, #{item.devconnModifieddate},
|
|
|
- #{item.devconnCreateddate}, #{item.tid}
|
|
|
+ #{item.devconnBid}, #{item.devtypeBid}, #{item.devconnType}, #{item.devconnName}, #{item.devconnConfig},
|
|
|
+ #{item.devconnRemark}, #{item.devconnCreator}, #{item.devconnModifier}, #{item.devconnModifieddate},
|
|
|
+ #{item.devconnCreateddate}, #{item.tid}
|
|
|
)
|
|
|
</foreach>
|
|
|
</insert>
|