feat: ASW-22 workspace 接口开发

1.workspace 接口开发
2.新增 application delete, edit, add 按钮
This commit is contained in:
zhangshuai
2024-08-05 15:01:35 +08:00
parent aaff071420
commit ba87a497bb
16 changed files with 506 additions and 1 deletions

View File

@@ -0,0 +1,55 @@
<?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="net.geedge.asw.module.workspace.dao.WorkspaceDao">
<resultMap id="workspaceResultMap" type="net.geedge.asw.module.workspace.entity.WorkspaceEntity">
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="tags" column="tags"/>
<result property="visibility" column="visibility"/>
<result property="description" column="description"/>
<result property="createTimestamp" column="create_timestamp"/>
<result property="updateTimestamp" column="update_timestamp"/>
<result property="createUserId" column="create_user_id"/>
<result property="updateUserId" column="update_user_id"/>
<association property="createUser" columnPrefix="cu_" javaType="net.geedge.asw.module.sys.entity.SysUserEntity">
<id property="id" column="id"/>
<result property="name" column="name"/>
</association>
<association property="updateUser" columnPrefix="uu_" javaType="net.geedge.asw.module.sys.entity.SysUserEntity">
<id property="id" column="id"/>
<result property="name" column="name"/>
</association>
</resultMap>
<select id="queryList" resultMap="workspaceResultMap">
SELECT
ws.*,
cu.id AS cu_id,
cu.name AS cu_name,
uu.id AS uu_id,
uu.name AS uu_name
FROM
workspace ws
LEFT JOIN sys_user cu ON ws.create_user_id = cu.id
LEFT JOIN sys_user uu ON ws.update_user_id = uu.id
<where>
<if test="params.ids != null and params.ids != ''">
ws.id in
<foreach item="id" collection="params.ids.split(',')" separator="," open="(" close=")">
#{id}
</foreach>
</if>
<if test="params.q != null and params.q != ''">
AND ( locate(#{params.q}, ws.name) OR locate(#{params.q}, ws.description) OR locate(#{params.q},
ws.tags) )
</if>
</where>
<if test="params.orderBy == null or params.orderBy == ''">
ORDER BY ws.id
</if>
</select>
</mapper>

View File

@@ -0,0 +1,49 @@
<?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="net.geedge.asw.module.workspace.dao.WorkspaceMemberDao">
<resultMap id="workspaceMemberResultMap" type="net.geedge.asw.module.workspace.entity.WorkspaceMemberEntity">
<result property="workspaceId" column="workspace_id"/>
<result property="userId" column="user_id"/>
<result property="roleId" column="role_id"/>
<result property="createTimestamp" column="create_timestamp"/>
<result property="createUserId" column="create_user_id"/>
<association property="createUser" columnPrefix="cu_" javaType="net.geedge.asw.module.sys.entity.SysUserEntity">
<id property="id" column="id"/>
<result property="name" column="name"/>
</association>
<association property="user" columnPrefix="su_" javaType="net.geedge.asw.module.sys.entity.SysUserEntity">
<id property="id" column="id"/>
<result property="name" column="name"/>
</association>
<association property="role" columnPrefix="sr_" javaType="net.geedge.asw.module.sys.entity.SysRoleEntity">
<id property="id" column="id"/>
<result property="name" column="name"/>
</association>
</resultMap>
<select id="queryList" resultMap="workspaceMemberResultMap">
SELECT
wm.*,
cu.id AS cu_id,
cu.name AS cu_name,
su.id AS su_id,
su.name AS su_name,
sr.id AS sr_id,
sr.name AS sr_name
FROM
workspace_member wm
LEFT JOIN sys_user cu ON wm.create_user_id = cu.id
LEFT JOIN sys_user su ON wm.user_id = su.id
LEFT JOIN sys_role sr ON wm.role_id = sr.id
<where>
<if test="workspaceId != null and workspaceId != ''">
wm.workspace_id = #{workspaceId}
</if>
</where>
</select>
</mapper>