<?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="cn.iocoder.yudao.module.knowledge.mapper.TMapNodeMapper">


    <select id="selectByMapId" resultType="cn.iocoder.yudao.module.knowledge.entity.TMapNode">
        SELECT
            id AS id,
            orders AS orders,
            content AS content,
            parent_id AS parentId,
            create_time AS createTime,
            update_time AS updateTime
        FROM
            t_map_node
        WHERE
            map_id = #{id}
          AND deleted = 0
        ORDER BY
            create_time ASC
    </select>
    <update id="deleteByParentId">
        UPDATE t_map_node
        SET deleted = 1
        WHERE
            parent_id = #{id}
    </update>



</mapper>
