feat:接口自动注册进入x_permission表

This commit is contained in:
xiang
2025-09-01 00:26:50 +08:00
parent bce483507c
commit 01e3445937
10 changed files with 259 additions and 4 deletions

View File

@@ -16,6 +16,7 @@
<result column="updated_time" property="updatedTime" />
<result column="update_by" property="updateBy" />
<result column="del_flag" property="delFlag" />
<result column="service_name" property="serviceName"/>
</resultMap>
<sql id="Base_Column_List">
@@ -30,7 +31,8 @@
create_by,
updated_time,
update_by,
del_flag
del_flag,
service_name
</sql>
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.xiang.xservice.auth.service.entity.XPermission">
@@ -67,7 +69,10 @@
update_by,
</if>
<if test="null != delFlag ">
del_flag
del_flag,
</if>
<if test="serviceName != null and serviceName != ''">
service_name
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -102,10 +107,22 @@
#{updateBy},
</if>
<if test="null != delFlag ">
#{delFlag}
#{delFlag},
</if>
<if test="serviceName != null and serviceName != ''">
#{serviceName}
</if>
</trim>
</insert>
<insert id="addBatch">
insert into x_permission(name, code, type, api_path, method, created_time,
create_by, updated_time, update_by, service_name)
values
<foreach collection="list" item="item" separator=",">
(#{item.name}, #{item.code}, #{item.type}, #{item.apiPath}, #{item.method}, #{item.createdTime},
#{item.createBy}, #{item.updatedTime}, #{item.updateBy}, #{item.serviceName})
</foreach>
</insert>
<update id="delBatch" >
update x_permission set del_flag = 1, update_by = #{operator}, update_time = NOW()
@@ -128,10 +145,14 @@
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != updatedTime ">updated_time = #{updatedTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != delFlag ">del_flag = #{delFlag}</if>
<if test="null != delFlag ">del_flag = #{delFlag},</if>
<if test="null != serviceName and serviceName != ''">service_name = #{serviceName}</if>
</set>
WHERE id = #{id}
</update>
<delete id="delByServiceName">
delete from x_permission where service_name = #{serviceName}
</delete>
<select id="getPermissionList" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from x_permission