feat(behaviour): 添加行为树系统核心功能模块
- 创建行为树主对象实体类Behaviortree,包含ID、名称、描述、创建时间、更新时间、英文名和XML内容字段 - 实现行为树控制器BehaviortreeController,提供增删改查和导出功能接口 - 开发行为树数据访问层,包括Mapper接口和MyBatis XML映射文件 - 构建行为树服务层接口及实现类,封装业务逻辑处理 - 添加节点连接、节点参数、节点模板、模板参数定义和行为树实例节点等相关实体和服务接口 - 实现节点连接管理功能,支持父子节点关系建立和执行顺序配置 - 提供完整的CRUD操作和权限控制,集成Excel导出功能
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?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.BehaviortreeMapper">
|
||||
|
||||
<resultMap type="Behaviortree" id="BehaviortreeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="englishName" column="english_name" />
|
||||
<result property="xmlContent" column="xml_content" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBehaviortreeVo">
|
||||
select id, name, description, created_at, updated_at, english_name, xml_content from behaviortree
|
||||
</sql>
|
||||
|
||||
<select id="selectBehaviortreeList" parameterType="Behaviortree" resultMap="BehaviortreeResult">
|
||||
<include refid="selectBehaviortreeVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||
<if test="englishName != null and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
|
||||
<if test="xmlContent != null and xmlContent != ''"> and xml_content = #{xmlContent}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBehaviortreeById" parameterType="Long" resultMap="BehaviortreeResult">
|
||||
<include refid="selectBehaviortreeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBehaviortree" parameterType="Behaviortree" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into behaviortree
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="createdAt != null">created_at,</if>
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
<if test="englishName != null and englishName != ''">english_name,</if>
|
||||
<if test="xmlContent != null">xml_content,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="createdAt != null">#{createdAt},</if>
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
<if test="englishName != null and englishName != ''">#{englishName},</if>
|
||||
<if test="xmlContent != null">#{xmlContent},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBehaviortree" parameterType="Behaviortree">
|
||||
update behaviortree
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||
<if test="englishName != null and englishName != ''">english_name = #{englishName},</if>
|
||||
<if test="xmlContent != null">xml_content = #{xmlContent},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBehaviortreeById" parameterType="Long">
|
||||
delete from behaviortree where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBehaviortreeByIds" parameterType="String">
|
||||
delete from behaviortree where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user