添加项目数据隔离逻辑

This commit is contained in:
mi9688
2024-10-17 18:17:06 +08:00
parent 0fb3e4bd8d
commit a5c5d88b46
12 changed files with 227 additions and 24 deletions

View File

@ -26,10 +26,11 @@
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
<result property="ownerId" column="owner_id" />
<result property="parentId" column="parent_id" />
</resultMap>
<sql id="selectProjectVo">
select project_id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id from project
select project_id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id, parent_id from project
</sql>
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
@ -50,6 +51,7 @@
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
<if test="ownerId != null "> and owner_id = #{ownerId}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
</where>
</select>
@ -82,6 +84,7 @@
<if test="tenantId != null">tenant_id,</if>
<if test="tenantName != null">tenant_name,</if>
<if test="ownerId != null">owner_id,</if>
<if test="parentId != null">parent_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectId != null">#{projectId},</if>
@ -105,6 +108,7 @@
<if test="tenantId != null">#{tenantId},</if>
<if test="tenantName != null">#{tenantName},</if>
<if test="ownerId != null">#{ownerId},</if>
<if test="parentId != null">#{parentId},</if>
</trim>
</insert>
@ -131,6 +135,7 @@
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="tenantName != null">tenant_name = #{tenantName},</if>
<if test="ownerId != null">owner_id = #{ownerId},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
</trim>
where project_id = #{projectId}
</update>