You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.2 KiB
60 lines
2.2 KiB
<?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.zc.business.mapper.DcSwitchMapper">
|
|
|
|
<resultMap type="DcSwitch" id="DcSwitch">
|
|
<result property="switchId" column="switch_id"/>
|
|
<result property="parentId" column="parent_id"/>
|
|
<result property="ancestors" column="ancestors"/>
|
|
<result property="switchName" column="switch_name"/>
|
|
<result property="stakeMark" column="stake_mark"/>
|
|
<result property="deviceList" column="device_list"/>
|
|
<result property="switchIp" column="switch_ip"/>
|
|
<result property="ringNetWork" column="ring_netWork"/>
|
|
<result property="netWorkStatus" column="netWork_status"/>
|
|
<result property="userState" column="user_state"/>
|
|
<result property="stakeMark" column="stake_mark"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectDcSwitchVo">
|
|
select switch_id,
|
|
parent_id,
|
|
ancestors,
|
|
switch_name,
|
|
stake_mark,
|
|
device_list,
|
|
switch_ip,
|
|
ring_netWork,
|
|
netWork_status,
|
|
user_state,
|
|
create_time,
|
|
update_time
|
|
from dc_switch
|
|
</sql>
|
|
|
|
<select id="getSwitchList" parameterType="DcSwitch" resultType="DcSwitch">
|
|
<include refid="selectDcSwitchVo"/>
|
|
<where>
|
|
user_state = 1
|
|
<if test="parentId != null ">and parent_id = #{parentId}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<update id="updateBatchByNetWorkStatus" parameterType="List">
|
|
update dc_switch set netWork_status =
|
|
<foreach collection="list" item="item" index="index"
|
|
separator=" " open="case switch_id" close="end">
|
|
when #{item.switchId} then #{item.netWorkStatus}
|
|
</foreach>
|
|
where switch_id in
|
|
<foreach collection="list" item="item" index="index"
|
|
separator="," open="(" close=")">
|
|
#{item.switchId}
|
|
</foreach>
|
|
</update>
|
|
|
|
</mapper>
|
|
|