UPDATE: fk

This commit is contained in:
libertyspy
2026-02-09 14:52:56 +08:00
parent 46bead08a0
commit 0ffc42ab69
16 changed files with 92 additions and 17 deletions

View File

@@ -18,6 +18,8 @@ public class Nodeconnection extends BaseEntity
/** 连接ID (主键) */ /** 连接ID (主键) */
private Long id; private Long id;
private Long treeId;
/** 父节点 (外键: TreeInstanceNode.id) */ /** 父节点 (外键: TreeInstanceNode.id) */
@Excel(name = "父节点 (外键: TreeInstanceNode.id)") @Excel(name = "父节点 (外键: TreeInstanceNode.id)")
private Long parentNodeId; private Long parentNodeId;
@@ -40,7 +42,15 @@ public class Nodeconnection extends BaseEntity
return id; return id;
} }
public void setParentNodeId(Long parentNodeId) public Long getTreeId() {
return treeId;
}
public void setTreeId(Long treeId) {
this.treeId = treeId;
}
public void setParentNodeId(Long parentNodeId)
{ {
this.parentNodeId = parentNodeId; this.parentNodeId = parentNodeId;
} }

View File

@@ -18,6 +18,8 @@ public class Nodeparameter extends BaseEntity
/** 节点参数ID (主键) */ /** 节点参数ID (主键) */
private Long id; private Long id;
private Long treeId;
/** 关联到哪个节点实例 (外键: TreeInstanceNode.id) */ /** 关联到哪个节点实例 (外键: TreeInstanceNode.id) */
@Excel(name = "关联到哪个节点实例 (外键: TreeInstanceNode.id)") @Excel(name = "关联到哪个节点实例 (外键: TreeInstanceNode.id)")
private Long nodeInstanceId; private Long nodeInstanceId;
@@ -40,7 +42,15 @@ public class Nodeparameter extends BaseEntity
return id; return id;
} }
public void setNodeInstanceId(Long nodeInstanceId) public Long getTreeId() {
return treeId;
}
public void setTreeId(Long treeId) {
this.treeId = treeId;
}
public void setNodeInstanceId(Long nodeInstanceId)
{ {
this.nodeInstanceId = nodeInstanceId; this.nodeInstanceId = nodeInstanceId;
} }

View File

@@ -40,7 +40,7 @@ public class Nodetemplate extends BaseEntity
/** 模版类型节点模版或者条件判断例如“node”precondition“ */ /** 模版类型节点模版或者条件判断例如“node”precondition“ */
@Excel(name = "模版类型节点模版或者条件判断例如“node”precondition“") @Excel(name = "模版类型节点模版或者条件判断例如“node”precondition“")
private String templeteType; private String templateType;
public Nodetemplate() { public Nodetemplate() {
} }
@@ -52,7 +52,7 @@ public class Nodetemplate extends BaseEntity
this.logicHandler = template.logicHandler; this.logicHandler = template.logicHandler;
this.description = template.description; this.description = template.description;
this.englishName = template.englishName; this.englishName = template.englishName;
this.templeteType = template.templeteType; this.templateType = template.templateType;
} }
public void setId(Long id) public void setId(Long id)
@@ -115,14 +115,14 @@ public class Nodetemplate extends BaseEntity
return englishName; return englishName;
} }
public void setTempleteType(String templeteType) public void setTemplateType(String templateType)
{ {
this.templeteType = templeteType; this.templateType = templateType;
} }
public String getTempleteType() public String getTemplateType()
{ {
return templeteType; return templateType;
} }
@Override @Override
@@ -134,7 +134,7 @@ public class Nodetemplate extends BaseEntity
.append("logicHandler", getLogicHandler()) .append("logicHandler", getLogicHandler())
.append("description", getDescription()) .append("description", getDescription())
.append("englishName", getEnglishName()) .append("englishName", getEnglishName())
.append("templeteType", getTempleteType()) .append("templateType", getTemplateType())
.toString(); .toString();
} }
} }

View File

@@ -2,6 +2,7 @@ package com.solution.system.mapper;
import java.util.List; import java.util.List;
import com.solution.system.domain.Nodeconnection; import com.solution.system.domain.Nodeconnection;
import org.apache.ibatis.annotations.Param;
/** /**
* 节点连接Mapper接口 * 节点连接Mapper接口
@@ -11,6 +12,8 @@ import com.solution.system.domain.Nodeconnection;
*/ */
public interface NodeconnectionMapper public interface NodeconnectionMapper
{ {
void deleteByTreeId(@Param("treeId") Long treeId);
/** /**
* 查询节点连接 * 查询节点连接
* *

View File

@@ -2,6 +2,7 @@ package com.solution.system.mapper;
import java.util.List; import java.util.List;
import com.solution.system.domain.Nodeparameter; import com.solution.system.domain.Nodeparameter;
import org.apache.ibatis.annotations.Param;
/** /**
* 节点参数Mapper接口 * 节点参数Mapper接口
@@ -11,6 +12,8 @@ import com.solution.system.domain.Nodeparameter;
*/ */
public interface NodeparameterMapper public interface NodeparameterMapper
{ {
void deleteByTreeId(@Param("treeId") Long treeId);
/** /**
* 查询节点参数 * 查询节点参数
* *

View File

@@ -2,6 +2,7 @@ package com.solution.system.mapper;
import java.util.List; import java.util.List;
import com.solution.system.domain.Treenodeinstance; import com.solution.system.domain.Treenodeinstance;
import org.apache.ibatis.annotations.Param;
/** /**
* 行为树实例节点Mapper接口 * 行为树实例节点Mapper接口
@@ -11,6 +12,8 @@ import com.solution.system.domain.Treenodeinstance;
*/ */
public interface TreenodeinstanceMapper public interface TreenodeinstanceMapper
{ {
void deleteByTreeId(@Param(value = "treeId") Long treeId);
/** /**
* 查询行为树实例节点 * 查询行为树实例节点
* *

View File

@@ -2,6 +2,7 @@ package com.solution.system.service;
import java.util.List; import java.util.List;
import com.solution.system.domain.Nodeconnection; import com.solution.system.domain.Nodeconnection;
import org.apache.ibatis.annotations.Param;
/** /**
* 节点连接Service接口 * 节点连接Service接口
@@ -11,6 +12,9 @@ import com.solution.system.domain.Nodeconnection;
*/ */
public interface INodeconnectionService public interface INodeconnectionService
{ {
void deleteByTreeId(@Param("treeId") Long treeId);
/** /**
* 查询节点连接 * 查询节点连接
* *

View File

@@ -11,6 +11,9 @@ import com.solution.system.domain.Nodeparameter;
*/ */
public interface INodeparameterService public interface INodeparameterService
{ {
void deleteByTreeId(Long treeId);
/** /**
* 查询节点参数 * 查询节点参数
* *

View File

@@ -11,6 +11,9 @@ import com.solution.system.domain.Treenodeinstance;
*/ */
public interface ITreenodeinstanceService public interface ITreenodeinstanceService
{ {
void deleteByTreeId(Long treeId);
/** /**
* 查询行为树实例节点 * 查询行为树实例节点
* *

View File

@@ -19,6 +19,11 @@ public class NodeconnectionServiceImpl implements INodeconnectionService
@Autowired @Autowired
private NodeconnectionMapper nodeconnectionMapper; private NodeconnectionMapper nodeconnectionMapper;
@Override
public void deleteByTreeId(Long treeId) {
nodeconnectionMapper.deleteByTreeId(treeId);
}
/** /**
* 查询节点连接 * 查询节点连接
* *

View File

@@ -19,6 +19,11 @@ public class NodeparameterServiceImpl implements INodeparameterService
@Autowired @Autowired
private NodeparameterMapper nodeparameterMapper; private NodeparameterMapper nodeparameterMapper;
@Override
public void deleteByTreeId(Long treeId) {
nodeparameterMapper.deleteByTreeId(treeId);
}
/** /**
* 查询节点参数 * 查询节点参数
* *

View File

@@ -19,6 +19,11 @@ public class TreenodeinstanceServiceImpl implements ITreenodeinstanceService
@Autowired @Autowired
private TreenodeinstanceMapper treenodeinstanceMapper; private TreenodeinstanceMapper treenodeinstanceMapper;
@Override
public void deleteByTreeId(Long treeId) {
treenodeinstanceMapper.deleteByTreeId(treeId);
}
/** /**
* 查询行为树实例节点 * 查询行为树实例节点
* *

View File

@@ -6,18 +6,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="Nodeconnection" id="NodeconnectionResult"> <resultMap type="Nodeconnection" id="NodeconnectionResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="treeId" column="tree_id" />
<result property="parentNodeId" column="parent_node_id" /> <result property="parentNodeId" column="parent_node_id" />
<result property="childNodeId" column="child_node_id" /> <result property="childNodeId" column="child_node_id" />
<result property="orderIndex" column="order_index" /> <result property="orderIndex" column="order_index" />
</resultMap> </resultMap>
<delete id="deleteByTreeId">
delete from nodeconnection where tree_id=#{treeId}
</delete>
<sql id="selectNodeconnectionVo"> <sql id="selectNodeconnectionVo">
select id, parent_node_id, child_node_id, order_index from nodeconnection select id, tree_id, parent_node_id, child_node_id, order_index from nodeconnection
</sql> </sql>
<select id="selectNodeconnectionList" parameterType="Nodeconnection" resultMap="NodeconnectionResult"> <select id="selectNodeconnectionList" parameterType="Nodeconnection" resultMap="NodeconnectionResult">
<include refid="selectNodeconnectionVo"/> <include refid="selectNodeconnectionVo"/>
<where> <where>
<if test="treeId != null "> and tree_id = #{treeId}</if>
<if test="parentNodeId != null "> and parent_node_id = #{parentNodeId}</if> <if test="parentNodeId != null "> and parent_node_id = #{parentNodeId}</if>
<if test="childNodeId != null "> and child_node_id = #{childNodeId}</if> <if test="childNodeId != null "> and child_node_id = #{childNodeId}</if>
<if test="orderIndex != null "> and order_index = #{orderIndex}</if> <if test="orderIndex != null "> and order_index = #{orderIndex}</if>
@@ -32,11 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertNodeconnection" parameterType="Nodeconnection" useGeneratedKeys="true" keyProperty="id"> <insert id="insertNodeconnection" parameterType="Nodeconnection" useGeneratedKeys="true" keyProperty="id">
insert into nodeconnection insert into nodeconnection
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="treeId != null">tree_id,</if>
<if test="parentNodeId != null">parent_node_id,</if> <if test="parentNodeId != null">parent_node_id,</if>
<if test="childNodeId != null">child_node_id,</if> <if test="childNodeId != null">child_node_id,</if>
<if test="orderIndex != null">order_index,</if> <if test="orderIndex != null">order_index,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="treeId != null">#{treeId},</if>
<if test="parentNodeId != null">#{parentNodeId},</if> <if test="parentNodeId != null">#{parentNodeId},</if>
<if test="childNodeId != null">#{childNodeId},</if> <if test="childNodeId != null">#{childNodeId},</if>
<if test="orderIndex != null">#{orderIndex},</if> <if test="orderIndex != null">#{orderIndex},</if>
@@ -46,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateNodeconnection" parameterType="Nodeconnection"> <update id="updateNodeconnection" parameterType="Nodeconnection">
update nodeconnection update nodeconnection
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="treeId != null">tree_id = #{treeId},</if>
<if test="parentNodeId != null">parent_node_id = #{parentNodeId},</if> <if test="parentNodeId != null">parent_node_id = #{parentNodeId},</if>
<if test="childNodeId != null">child_node_id = #{childNodeId},</if> <if test="childNodeId != null">child_node_id = #{childNodeId},</if>
<if test="orderIndex != null">order_index = #{orderIndex},</if> <if test="orderIndex != null">order_index = #{orderIndex},</if>

View File

@@ -6,13 +6,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="Nodeparameter" id="NodeparameterResult"> <resultMap type="Nodeparameter" id="NodeparameterResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="treeId" column="tree_id" />
<result property="nodeInstanceId" column="node_instance_id" /> <result property="nodeInstanceId" column="node_instance_id" />
<result property="paramDefId" column="param_def_id" /> <result property="paramDefId" column="param_def_id" />
<result property="value" column="value" /> <result property="value" column="value" />
</resultMap> </resultMap>
<delete id="deleteByTreeId">
delete from nodeparameter where tree_id=#{treeId}
</delete>
<sql id="selectNodeparameterVo"> <sql id="selectNodeparameterVo">
select id, node_instance_id, param_def_id, value from nodeparameter select id, treeId, node_instance_id, param_def_id, value from nodeparameter
</sql> </sql>
<select id="selectNodeparameterList" parameterType="Nodeparameter" resultMap="NodeparameterResult"> <select id="selectNodeparameterList" parameterType="Nodeparameter" resultMap="NodeparameterResult">
@@ -32,11 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertNodeparameter" parameterType="Nodeparameter" useGeneratedKeys="true" keyProperty="id"> <insert id="insertNodeparameter" parameterType="Nodeparameter" useGeneratedKeys="true" keyProperty="id">
insert into nodeparameter insert into nodeparameter
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="treeId != null">tree_id,</if>
<if test="nodeInstanceId != null">node_instance_id,</if> <if test="nodeInstanceId != null">node_instance_id,</if>
<if test="paramDefId != null">param_def_id,</if> <if test="paramDefId != null">param_def_id,</if>
<if test="value != null">value,</if> <if test="value != null">value,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="treeId != null">#{treeId},</if>
<if test="nodeInstanceId != null">#{nodeInstanceId},</if> <if test="nodeInstanceId != null">#{nodeInstanceId},</if>
<if test="paramDefId != null">#{paramDefId},</if> <if test="paramDefId != null">#{paramDefId},</if>
<if test="value != null">#{value},</if> <if test="value != null">#{value},</if>
@@ -46,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateNodeparameter" parameterType="Nodeparameter"> <update id="updateNodeparameter" parameterType="Nodeparameter">
update nodeparameter update nodeparameter
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="treeId != null">tree_id = #{treeId},</if>
<if test="nodeInstanceId != null">node_instance_id = #{nodeInstanceId},</if> <if test="nodeInstanceId != null">node_instance_id = #{nodeInstanceId},</if>
<if test="paramDefId != null">param_def_id = #{paramDefId},</if> <if test="paramDefId != null">param_def_id = #{paramDefId},</if>
<if test="value != null">value = #{value},</if> <if test="value != null">value = #{value},</if>

View File

@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="logicHandler" column="logic_handler" /> <result property="logicHandler" column="logic_handler" />
<result property="description" column="description" /> <result property="description" column="description" />
<result property="englishName" column="english_name" /> <result property="englishName" column="english_name" />
<result property="templeteType" column="templete_type" /> <result property="templateType" column="templete_type" />
</resultMap> </resultMap>
<sql id="selectNodetemplateVo"> <sql id="selectNodetemplateVo">
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="logicHandler != null and logicHandler != ''"> and logic_handler = #{logicHandler}</if> <if test="logicHandler != null and logicHandler != ''"> and logic_handler = #{logicHandler}</if>
<if test="description != null and description != ''"> and description = #{description}</if> <if test="description != null and description != ''"> and description = #{description}</if>
<if test="englishName != null and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if> <if test="englishName != null and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
<if test="templeteType != null and templeteType != ''"> and templete_type = #{templeteType}</if> <if test="templateType != null and templateType != ''"> and templete_type = #{templateType}</if>
</where> </where>
</select> </select>
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="logicHandler != null">logic_handler,</if> <if test="logicHandler != null">logic_handler,</if>
<if test="description != null">description,</if> <if test="description != null">description,</if>
<if test="englishName != null">english_name,</if> <if test="englishName != null">english_name,</if>
<if test="templeteType != null and templeteType != ''">templete_type,</if> <if test="templateType != null and templateType != ''">templete_type,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null and type != ''">#{type},</if> <if test="type != null and type != ''">#{type},</if>
@@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="logicHandler != null">#{logicHandler},</if> <if test="logicHandler != null">#{logicHandler},</if>
<if test="description != null">#{description},</if> <if test="description != null">#{description},</if>
<if test="englishName != null">#{englishName},</if> <if test="englishName != null">#{englishName},</if>
<if test="templeteType != null and templeteType != ''">#{templeteType},</if> <if test="templateType != null and templateType != ''">#{templateType},</if>
</trim> </trim>
</insert> </insert>
@@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="logicHandler != null">logic_handler = #{logicHandler},</if> <if test="logicHandler != null">logic_handler = #{logicHandler},</if>
<if test="description != null">description = #{description},</if> <if test="description != null">description = #{description},</if>
<if test="englishName != null">english_name = #{englishName},</if> <if test="englishName != null">english_name = #{englishName},</if>
<if test="templeteType != null and templeteType != ''">templete_type = #{templeteType},</if> <if test="templateType != null and templateType != ''">templete_type = #{templateType},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@@ -15,6 +15,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="desciption" column="desciption" /> <result property="desciption" column="desciption" />
</resultMap> </resultMap>
<delete id="deleteByTreeId">
delete from treenodeinstance where tree_id=#{treeId}
</delete>
<sql id="selectTreenodeinstanceVo"> <sql id="selectTreenodeinstanceVo">
select id, tree_id, template_id, instance_name, is_root, precondition_templete_id, uuid,desciption from treenodeinstance select id, tree_id, template_id, instance_name, is_root, precondition_templete_id, uuid,desciption from treenodeinstance
</sql> </sql>