<?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.ruoyi.tc.mapper.AssetBasicNetWorkMapper">
    <update id="deleteByAssetIds">
        update asset_basic_network set del_flag = '2' where asset_id = #{id}
    </update>
    <delete id="deleteIdList" >
        DELETE FROM asset_basic_network
        WHERE asset_id IN
        <foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

    <select id="getByAssetId" resultType="com.ruoyi.tc.entity.AssetBasicNetwork">
        select *
        from asset_basic_network
        where asset_id = #{id}
        group by type,
                 id,
                 sblx,
                 pp,
                 sb_ip,
                 czxt,
                 czxtbb,
                 yjxh,
                 yjxlh,
                 yjbbxx,
                 yjyt,
                 yjbsxx
        order by create_time asc
    </select>
</mapper>

