UPDATE: fk
This commit is contained in:
@@ -18,6 +18,8 @@ public class Nodeconnection extends BaseEntity
|
||||
/** 连接ID (主键) */
|
||||
private Long id;
|
||||
|
||||
private Long treeId;
|
||||
|
||||
/** 父节点 (外键: TreeInstanceNode.id) */
|
||||
@Excel(name = "父节点 (外键: TreeInstanceNode.id)")
|
||||
private Long parentNodeId;
|
||||
@@ -40,6 +42,14 @@ public class Nodeconnection extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getTreeId() {
|
||||
return treeId;
|
||||
}
|
||||
|
||||
public void setTreeId(Long treeId) {
|
||||
this.treeId = treeId;
|
||||
}
|
||||
|
||||
public void setParentNodeId(Long parentNodeId)
|
||||
{
|
||||
this.parentNodeId = parentNodeId;
|
||||
|
||||
@@ -18,6 +18,8 @@ public class Nodeparameter extends BaseEntity
|
||||
/** 节点参数ID (主键) */
|
||||
private Long id;
|
||||
|
||||
private Long treeId;
|
||||
|
||||
/** 关联到哪个节点实例 (外键: TreeInstanceNode.id) */
|
||||
@Excel(name = "关联到哪个节点实例 (外键: TreeInstanceNode.id)")
|
||||
private Long nodeInstanceId;
|
||||
@@ -40,6 +42,14 @@ public class Nodeparameter extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getTreeId() {
|
||||
return treeId;
|
||||
}
|
||||
|
||||
public void setTreeId(Long treeId) {
|
||||
this.treeId = treeId;
|
||||
}
|
||||
|
||||
public void setNodeInstanceId(Long nodeInstanceId)
|
||||
{
|
||||
this.nodeInstanceId = nodeInstanceId;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Nodetemplate extends BaseEntity
|
||||
|
||||
/** 模版类型,节点模版或者条件判断,例如“node”,precondition“ */
|
||||
@Excel(name = "模版类型,节点模版或者条件判断,例如“node”,precondition“")
|
||||
private String templeteType;
|
||||
private String templateType;
|
||||
|
||||
public Nodetemplate() {
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class Nodetemplate extends BaseEntity
|
||||
this.logicHandler = template.logicHandler;
|
||||
this.description = template.description;
|
||||
this.englishName = template.englishName;
|
||||
this.templeteType = template.templeteType;
|
||||
this.templateType = template.templateType;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
@@ -115,14 +115,14 @@ public class Nodetemplate extends BaseEntity
|
||||
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
|
||||
@@ -134,7 +134,7 @@ public class Nodetemplate extends BaseEntity
|
||||
.append("logicHandler", getLogicHandler())
|
||||
.append("description", getDescription())
|
||||
.append("englishName", getEnglishName())
|
||||
.append("templeteType", getTempleteType())
|
||||
.append("templateType", getTemplateType())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.solution.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.solution.system.domain.Nodeconnection;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 节点连接Mapper接口
|
||||
@@ -11,6 +12,8 @@ import com.solution.system.domain.Nodeconnection;
|
||||
*/
|
||||
public interface NodeconnectionMapper
|
||||
{
|
||||
void deleteByTreeId(@Param("treeId") Long treeId);
|
||||
|
||||
/**
|
||||
* 查询节点连接
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.solution.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.solution.system.domain.Nodeparameter;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 节点参数Mapper接口
|
||||
@@ -11,6 +12,8 @@ import com.solution.system.domain.Nodeparameter;
|
||||
*/
|
||||
public interface NodeparameterMapper
|
||||
{
|
||||
void deleteByTreeId(@Param("treeId") Long treeId);
|
||||
|
||||
/**
|
||||
* 查询节点参数
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.solution.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.solution.system.domain.Treenodeinstance;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 行为树实例节点Mapper接口
|
||||
@@ -11,6 +12,8 @@ import com.solution.system.domain.Treenodeinstance;
|
||||
*/
|
||||
public interface TreenodeinstanceMapper
|
||||
{
|
||||
void deleteByTreeId(@Param(value = "treeId") Long treeId);
|
||||
|
||||
/**
|
||||
* 查询行为树实例节点
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.solution.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.solution.system.domain.Nodeconnection;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 节点连接Service接口
|
||||
@@ -11,6 +12,9 @@ import com.solution.system.domain.Nodeconnection;
|
||||
*/
|
||||
public interface INodeconnectionService
|
||||
{
|
||||
|
||||
void deleteByTreeId(@Param("treeId") Long treeId);
|
||||
|
||||
/**
|
||||
* 查询节点连接
|
||||
*
|
||||
|
||||
@@ -11,6 +11,9 @@ import com.solution.system.domain.Nodeparameter;
|
||||
*/
|
||||
public interface INodeparameterService
|
||||
{
|
||||
|
||||
void deleteByTreeId(Long treeId);
|
||||
|
||||
/**
|
||||
* 查询节点参数
|
||||
*
|
||||
|
||||
@@ -11,6 +11,9 @@ import com.solution.system.domain.Treenodeinstance;
|
||||
*/
|
||||
public interface ITreenodeinstanceService
|
||||
{
|
||||
|
||||
void deleteByTreeId(Long treeId);
|
||||
|
||||
/**
|
||||
* 查询行为树实例节点
|
||||
*
|
||||
|
||||
@@ -19,6 +19,11 @@ public class NodeconnectionServiceImpl implements INodeconnectionService
|
||||
@Autowired
|
||||
private NodeconnectionMapper nodeconnectionMapper;
|
||||
|
||||
@Override
|
||||
public void deleteByTreeId(Long treeId) {
|
||||
nodeconnectionMapper.deleteByTreeId(treeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询节点连接
|
||||
*
|
||||
|
||||
@@ -19,6 +19,11 @@ public class NodeparameterServiceImpl implements INodeparameterService
|
||||
@Autowired
|
||||
private NodeparameterMapper nodeparameterMapper;
|
||||
|
||||
@Override
|
||||
public void deleteByTreeId(Long treeId) {
|
||||
nodeparameterMapper.deleteByTreeId(treeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询节点参数
|
||||
*
|
||||
|
||||
@@ -19,6 +19,11 @@ public class TreenodeinstanceServiceImpl implements ITreenodeinstanceService
|
||||
@Autowired
|
||||
private TreenodeinstanceMapper treenodeinstanceMapper;
|
||||
|
||||
@Override
|
||||
public void deleteByTreeId(Long treeId) {
|
||||
treenodeinstanceMapper.deleteByTreeId(treeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询行为树实例节点
|
||||
*
|
||||
|
||||
@@ -6,18 +6,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<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, 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>
|
||||
|
||||
<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>
|
||||
@@ -32,11 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
@@ -46,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
|
||||
@@ -6,13 +6,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="Nodeparameter" id="NodeparameterResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="treeId" column="tree_id" />
|
||||
<result property="nodeInstanceId" column="node_instance_id" />
|
||||
<result property="paramDefId" column="param_def_id" />
|
||||
<result property="value" column="value" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteByTreeId">
|
||||
delete from nodeparameter where tree_id=#{treeId}
|
||||
</delete>
|
||||
|
||||
<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>
|
||||
|
||||
<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 into nodeparameter
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="treeId != null">tree_id,</if>
|
||||
<if test="nodeInstanceId != null">node_instance_id,</if>
|
||||
<if test="paramDefId != null">param_def_id,</if>
|
||||
<if test="value != null">value,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="treeId != null">#{treeId},</if>
|
||||
<if test="nodeInstanceId != null">#{nodeInstanceId},</if>
|
||||
<if test="paramDefId != null">#{paramDefId},</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 nodeparameter
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="treeId != null">tree_id = #{treeId},</if>
|
||||
<if test="nodeInstanceId != null">node_instance_id = #{nodeInstanceId},</if>
|
||||
<if test="paramDefId != null">param_def_id = #{paramDefId},</if>
|
||||
<if test="value != null">value = #{value},</if>
|
||||
|
||||
@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="logicHandler" column="logic_handler" />
|
||||
<result property="description" column="description" />
|
||||
<result property="englishName" column="english_name" />
|
||||
<result property="templeteType" column="templete_type" />
|
||||
<result property="templateType" column="templete_type" />
|
||||
</resultMap>
|
||||
|
||||
<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="description != null and description != ''"> and description = #{description}</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>
|
||||
</select>
|
||||
|
||||
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="logicHandler != null">logic_handler,</if>
|
||||
<if test="description != null">description,</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 prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<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="description != null">#{description},</if>
|
||||
<if test="englishName != null">#{englishName},</if>
|
||||
<if test="templeteType != null and templeteType != ''">#{templeteType},</if>
|
||||
<if test="templateType != null and templateType != ''">#{templateType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="logicHandler != null">logic_handler = #{logicHandler},</if>
|
||||
<if test="description != null">description = #{description},</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>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
@@ -15,6 +15,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="desciption" column="desciption" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteByTreeId">
|
||||
delete from treenodeinstance where tree_id=#{treeId}
|
||||
</delete>
|
||||
|
||||
<sql id="selectTreenodeinstanceVo">
|
||||
select id, tree_id, template_id, instance_name, is_root, precondition_templete_id, uuid,desciption from treenodeinstance
|
||||
</sql>
|
||||
|
||||
Reference in New Issue
Block a user