新增规则模块 新增规则模块CRUD

This commit is contained in:
zouju
2026-02-05 17:12:53 +08:00
parent c8a889815d
commit 000f8d4bc5
9 changed files with 637 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
<?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.algo.mapper.SysAlgoConfigMapper">
<resultMap type="SysAlgoConfig" id="SysAlgoConfigResult">
<result property="id" column="id" />
<result property="algoType" column="algo_type" />
<result property="algoName" column="algo_name" />
<result property="engineType" column="engine_type" />
<result property="inputSchema" column="input_schema" />
<result property="scriptContent" column="script_content" />
<result property="description" column="description" />
<result property="status" column="status" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectSysAlgoConfigVo">
select id, algo_type, algo_name, engine_type, input_schema, script_content, description, status, created_at, updated_at from sys_algo_config
</sql>
<select id="selectSysAlgoConfigList" parameterType="SysAlgoConfig" resultMap="SysAlgoConfigResult">
<include refid="selectSysAlgoConfigVo"/>
<where>
<if test="algoType != null and algoType != ''"> and algo_type = #{algoType}</if>
<if test="algoName != null and algoName != ''"> and algo_name like concat('%', #{algoName}, '%')</if>
<if test="engineType != null and engineType != ''"> and engine_type = #{engineType}</if>
<if test="inputSchema != null and inputSchema != ''"> and input_schema = #{inputSchema}</if>
<if test="scriptContent != null and scriptContent != ''"> and script_content = #{scriptContent}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="status != null "> and status = #{status}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
</where>
</select>
<select id="selectSysAlgoConfigById" parameterType="Long" resultMap="SysAlgoConfigResult">
<include refid="selectSysAlgoConfigVo"/>
where id = #{id}
</select>
<insert id="insertSysAlgoConfig" parameterType="SysAlgoConfig" useGeneratedKeys="true" keyProperty="id">
insert into sys_algo_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="algoType != null and algoType != ''">algo_type,</if>
<if test="algoName != null and algoName != ''">algo_name,</if>
<if test="engineType != null and engineType != ''">engine_type,</if>
<if test="inputSchema != null">input_schema,</if>
<if test="scriptContent != null">script_content,</if>
<if test="description != null">description,</if>
<if test="status != null">status,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="algoType != null and algoType != ''">#{algoType},</if>
<if test="algoName != null and algoName != ''">#{algoName},</if>
<if test="engineType != null and engineType != ''">#{engineType},</if>
<if test="inputSchema != null">#{inputSchema},</if>
<if test="scriptContent != null">#{scriptContent},</if>
<if test="description != null">#{description},</if>
<if test="status != null">#{status},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateSysAlgoConfig" parameterType="SysAlgoConfig">
update sys_algo_config
<trim prefix="SET" suffixOverrides=",">
<if test="algoType != null and algoType != ''">algo_type = #{algoType},</if>
<if test="algoName != null and algoName != ''">algo_name = #{algoName},</if>
<if test="engineType != null and engineType != ''">engine_type = #{engineType},</if>
<if test="inputSchema != null">input_schema = #{inputSchema},</if>
<if test="scriptContent != null">script_content = #{scriptContent},</if>
<if test="description != null">description = #{description},</if>
<if test="status != null">status = #{status},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysAlgoConfigById" parameterType="Long">
delete from sys_algo_config where id = #{id}
</delete>
<delete id="deleteSysAlgoConfigByIds" parameterType="String">
delete from sys_algo_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>