Files
auto-solution/auto-solution-behaviour/src/main/resources/mapper/system/NodeconnectionMapper.xml
libertyspy 0ffc42ab69 UPDATE: fk
2026-02-09 14:52:56 +08:00

75 lines
3.2 KiB
XML

<?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.solution.system.mapper.NodeconnectionMapper">
<resultMap type="Nodeconnection" id="NodeconnectionResult">
<result property="id" column="id" />
<result property="treeId" column="tree_id" />
<result property="parentNodeId" column="parent_node_id" />
<result property="childNodeId" column="child_node_id" />
<result property="orderIndex" column="order_index" />
</resultMap>
<delete id="deleteByTreeId">
delete from nodeconnection where tree_id=#{treeId}
</delete>
<sql id="selectNodeconnectionVo">
select id, tree_id, parent_node_id, child_node_id, order_index from nodeconnection
</sql>
<select id="selectNodeconnectionList" parameterType="Nodeconnection" resultMap="NodeconnectionResult">
<include refid="selectNodeconnectionVo"/>
<where>
<if test="treeId != null "> and tree_id = #{treeId}</if>
<if test="parentNodeId != null "> and parent_node_id = #{parentNodeId}</if>
<if test="childNodeId != null "> and child_node_id = #{childNodeId}</if>
<if test="orderIndex != null "> and order_index = #{orderIndex}</if>
</where>
</select>
<select id="selectNodeconnectionById" parameterType="Long" resultMap="NodeconnectionResult">
<include refid="selectNodeconnectionVo"/>
where id = #{id}
</select>
<insert id="insertNodeconnection" parameterType="Nodeconnection" useGeneratedKeys="true" keyProperty="id">
insert into nodeconnection
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="treeId != null">tree_id,</if>
<if test="parentNodeId != null">parent_node_id,</if>
<if test="childNodeId != null">child_node_id,</if>
<if test="orderIndex != null">order_index,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="treeId != null">#{treeId},</if>
<if test="parentNodeId != null">#{parentNodeId},</if>
<if test="childNodeId != null">#{childNodeId},</if>
<if test="orderIndex != null">#{orderIndex},</if>
</trim>
</insert>
<update id="updateNodeconnection" parameterType="Nodeconnection">
update nodeconnection
<trim prefix="SET" suffixOverrides=",">
<if test="treeId != null">tree_id = #{treeId},</if>
<if test="parentNodeId != null">parent_node_id = #{parentNodeId},</if>
<if test="childNodeId != null">child_node_id = #{childNodeId},</if>
<if test="orderIndex != null">order_index = #{orderIndex},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNodeconnectionById" parameterType="Long">
delete from nodeconnection where id = #{id}
</delete>
<delete id="deleteNodeconnectionByIds" parameterType="String">
delete from nodeconnection where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>