first commit
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
<?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.linke.product.domain.appConfig.repository.mapper.AppConfigMapper">
|
||||
|
||||
<resultMap type="com.mhd.common.core.domain.po.AppConfigPO" id="AppConfigResult">
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="appName" column="app_name" />
|
||||
<result property="appPackage" column="app_package" />
|
||||
<result property="appRangeCode" column="app_range_code" />
|
||||
<result property="appRangeName" column="app_range_name" />
|
||||
<result property="appRoleId" column="app_role_id" />
|
||||
<result property="appRoleCode" column="app_role_code" />
|
||||
<result property="appRoleName" column="app_role_name" />
|
||||
<result property="appIcon" column="app_icon" />
|
||||
<result property="appRemark" column="app_remark" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectAppConfigPo">
|
||||
select app_id, app_name, app_package, app_range_code, app_range_name,app_role_id, app_role_code, app_role_name, app_icon, app_remark, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag, organization_linkage, organization_id, organization_name, top_organization_id from app_config
|
||||
</sql>
|
||||
|
||||
<sql id="selectAppConfigPo1">
|
||||
<where>
|
||||
<if test="appName != null and appName != ''">
|
||||
and app_name like concat('%', #{appName}, '%')
|
||||
</if>
|
||||
<if test="appPackage != null and appPackage != ''">
|
||||
and app_package = #{appPackage}
|
||||
</if>
|
||||
<if test="appRangeCode != null and appRangeCode != ''">
|
||||
and app_range_code like concat('%', #{appRangeCode}, '%')
|
||||
</if>
|
||||
<if test="appRangeName != null and appRangeName != ''">
|
||||
and app_range_name like concat('%', #{appRangeName}, '%')
|
||||
</if>
|
||||
<if test="appRoleId != null and appRoleId != ''">
|
||||
and app_role_id = #{appRoleId}
|
||||
</if>
|
||||
<if test="appRoleCode != null and appRoleCode != ''">
|
||||
and app_role_code = #{appRoleCode}
|
||||
</if>
|
||||
<if test="appRoleName != null and appRoleName != ''">
|
||||
and app_role_name like concat('%', #{appRoleName}, '%')
|
||||
</if>
|
||||
<if test="appIcon != null and appIcon != ''">
|
||||
and app_icon = #{appIcon}
|
||||
</if>
|
||||
<if test="appRemark != null and appRemark != ''">
|
||||
and app_remark = #{appRemark}
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="delFlag == null "> and del_Flag = 1 </when>
|
||||
<otherwise> and del_Flag = #{delFlag} </otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.appConfig.repository.todo.AppConfigDO" resultMap="AppConfigResult">
|
||||
<include refid="selectAppConfigPo"/>
|
||||
<include refid="selectAppConfigPo1"/>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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.linke.product.domain.appMenu.repository.mapper.AppMenuMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.appMenu.repository.po.AppMenuPO" id="AppMenuResult">
|
||||
<result property="appMenuId" column="app_menu_id" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectAppMenuPo">
|
||||
select app_menu_id, app_id, menu_id, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag from app_menu
|
||||
</sql>
|
||||
|
||||
<sql id="selectAppMenuPo1">
|
||||
<where>
|
||||
<if test="appId != null ">
|
||||
and app_id = #{appId}
|
||||
</if>
|
||||
<if test="menuId != null ">
|
||||
and menu_id = #{menuId}
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<choose>
|
||||
<when test="delFlag == null "> and del_Flag = 1 </when>
|
||||
<otherwise> and del_Flag = #{delFlag} </otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.appMenu.repository.todo.AppMenuDO" resultMap="AppMenuResult">
|
||||
<include refid="selectAppMenuPo"/>
|
||||
<include refid="selectAppMenuPo1"/>
|
||||
</select>
|
||||
|
||||
<select id="queryModulesList" parameterType="com.linke.product.domain.appMenu.repository.todo.AppMenuDO" resultType="com.linke.product.domain.appMenu.repository.po.AppModulePO">
|
||||
select
|
||||
a.app_menu_id, a.app_id, me.modules_id
|
||||
from app_menu a
|
||||
left join `sys_menu` me ON me.menu_id = a.menu_id
|
||||
where
|
||||
a.del_Flag = 1
|
||||
and me.del_Flag = 1
|
||||
and a.app_id = #{appId}
|
||||
<if test="modulesId != null and modulesId != ''">
|
||||
and me.modules_id = #{modulesId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryMenuListByApp" parameterType="com.linke.product.domain.appMenu.repository.todo.AppMenuDO" resultType="com.linke.product.domain.menu.repository.po.MenuPo">
|
||||
select
|
||||
me.menu_id,
|
||||
me.parent_menu_id,
|
||||
me.modules_id,
|
||||
me.product_id,
|
||||
me.menu_client,
|
||||
me.menu_type,
|
||||
me.menu_name,
|
||||
me.menu_show_name,
|
||||
me.menu_path,
|
||||
me.micro_service_path,
|
||||
me.menu_component,
|
||||
me.menu_redirect_path,
|
||||
me.menu_icon,
|
||||
me.menu_sort,
|
||||
me.menu_avatar,
|
||||
me.app_location_code,
|
||||
me.app_location_name,
|
||||
me.menu_hidden,
|
||||
me.menu_visible,
|
||||
me.menu_cache_status,
|
||||
me.menu_always_show,
|
||||
me.menu_internal_or_external,
|
||||
me.menu_remark,
|
||||
me.menu_linkage,
|
||||
me.menu_show,
|
||||
me.menu_perms
|
||||
from app_menu a
|
||||
left join `app_config` co ON co.app_id = a.app_id
|
||||
left join `sys_menu` me ON me.menu_id = a.menu_id
|
||||
where
|
||||
a.del_flag = 1
|
||||
and me.del_flag = 1
|
||||
and me.menu_show = 1
|
||||
and co.app_package = #{appPackage}
|
||||
and me.app_location_code = #{appLocationCode}
|
||||
and me.top_organization_id = #{topOrganizationId}
|
||||
order by me.menu_sort,me.create_time asc
|
||||
</select>
|
||||
</mapper>
|
||||
+96
@@ -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.linke.product.domain.appUserMenuSettings.repository.mapper.AppUserMenuSettingsMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.appUserMenuSettings.repository.po.AppUserMenuSettingsPO" id="AppUserMenuSettingsResult">
|
||||
<result property="aumsId" column="aums_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="appLocationCode" column="app_location_code" />
|
||||
<result property="appLocationName" column="app_location_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectAppUserMenuSettingsPo">
|
||||
select aums_id, user_id, menu_id, app_location_code, app_location_name, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag from app_user_menu_settings
|
||||
</sql>
|
||||
|
||||
<sql id="selectAppUserMenuSettingsPo1">
|
||||
<where>
|
||||
<if test="userId != null ">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="menuId != null ">
|
||||
and menu_id = #{menuId}
|
||||
</if>
|
||||
<if test="appLocationCode != null and appLocationCode != ''">
|
||||
and app_location_code = #{appLocationCode}
|
||||
</if>
|
||||
<if test="appLocationName != null and appLocationName != ''">
|
||||
and app_location_name like concat('%', #{appLocationName}, '%')
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.appUserMenuSettings.repository.todo.AppUserMenuSettingsDO" resultMap="AppUserMenuSettingsResult">
|
||||
<include refid="selectAppUserMenuSettingsPo"/>
|
||||
<include refid="selectAppUserMenuSettingsPo1"/>
|
||||
</select>
|
||||
|
||||
<select id="queryAppMenuListByUserId" parameterType="com.linke.product.domain.appUserMenuSettings.repository.todo.AppUserMenuSettingsDO" resultType="com.linke.product.domain.menu.repository.po.MenuPo">
|
||||
select
|
||||
me.menu_id,
|
||||
me.parent_menu_id,
|
||||
me.modules_id,
|
||||
me.product_id,
|
||||
me.menu_client,
|
||||
me.menu_type,
|
||||
me.menu_name,
|
||||
me.menu_show_name,
|
||||
me.menu_path,
|
||||
me.micro_service_path,
|
||||
me.menu_component,
|
||||
me.menu_redirect_path,
|
||||
me.menu_icon,
|
||||
me.menu_sort,
|
||||
me.menu_avatar,
|
||||
a.app_location_code,
|
||||
a.app_location_name,
|
||||
me.menu_hidden,
|
||||
me.menu_visible,
|
||||
me.menu_cache_status,
|
||||
me.menu_always_show,
|
||||
me.menu_internal_or_external,
|
||||
me.menu_remark,
|
||||
me.menu_linkage,
|
||||
me.menu_show,
|
||||
me.menu_perms
|
||||
from app_user_menu_settings a
|
||||
left join `sys_menu` me ON me.menu_id = a.menu_id
|
||||
where
|
||||
a.del_flag = 1
|
||||
and me.del_flag = 1
|
||||
and me.menu_show = 1
|
||||
and a.user_id = #{userId}
|
||||
and me.top_organization_id = #{topOrganizationId}
|
||||
<if test="appLocationCode != '' and appLocationCode != ''">
|
||||
and a.app_location_code = #{appLocationCode}
|
||||
</if>
|
||||
order by me.menu_sort,me.create_time asc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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.linke.product.domain.commonFunctions.repository.mapper.CommonFunctionsMapper">
|
||||
|
||||
<sql id="selectCommonFunctionsPo1">
|
||||
<if test="commonFunctionsDO.createByName != null and commonFunctionsDO.createByName != ''">
|
||||
and create_by_name like concat('%', #{commonFunctionsDO.createByName}, '%')
|
||||
</if>
|
||||
<if test="commonFunctionsDO.updateByName != null and commonFunctionsDO.updateByName != ''">
|
||||
and update_by_name like concat('%', #{commonFunctionsDO.updateByName}, '%')
|
||||
</if>
|
||||
<if test="commonFunctionsDO.topOrganizationId != null ">
|
||||
and top_organization_id = #{commonFunctionsDO.topOrganizationId}
|
||||
</if>
|
||||
<if test="commonFunctionsDO.organizationId != null ">
|
||||
and organization_id = #{commonFunctionsDO.organizationId}
|
||||
</if>
|
||||
<if test="commonFunctionsDO.organizationName != null and commonFunctionsDO.organizationName != ''">
|
||||
and organization_name like concat('%', #{commonFunctionsDO.organizationName}, '%')
|
||||
</if>
|
||||
<if test="commonFunctionsDO.userId != null ">
|
||||
and user_id = #{commonFunctionsDO.userId}
|
||||
</if>
|
||||
<if test="commonFunctionsDO.menuId != null ">
|
||||
and menu_id = #{commonFunctionsDO.menuId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.commonFunctions.repository.todo.CommonFunctionsDO"
|
||||
resultType="com.linke.product.domain.commonFunctions.repository.po.CommonFunctionsPO">
|
||||
select
|
||||
*
|
||||
from common_functions
|
||||
where del_flag = 1
|
||||
<include refid="selectCommonFunctionsPo1"/>
|
||||
order by create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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.linke.product.domain.commonProblem.repository.mapper.CommonProblemMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.commonProblem.entity.CommonProblem" id="CommonProblemResult">
|
||||
<result property="commonProblemId" column="common_problem_id"/>
|
||||
<result property="dictCode" column="dict_code"/>
|
||||
<result property="dictLabel" column="dict_label"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="topOrganizationId" column="top_organization_id"/>
|
||||
<result property="organizationId" column="organization_id"/>
|
||||
<result property="organizationName" column="organization_name"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createByName" column="create_by_name"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateByName" column="update_by_name"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectCommonProblemPo">
|
||||
select common_problem_id,
|
||||
dict_code,
|
||||
dict_label,
|
||||
title,
|
||||
content,
|
||||
status,
|
||||
top_organization_id,
|
||||
organization_id,
|
||||
organization_name,
|
||||
create_time,
|
||||
create_by,
|
||||
create_by_name,
|
||||
update_time,
|
||||
update_by,
|
||||
update_by_name,
|
||||
del_flag
|
||||
from common_problem
|
||||
</sql>
|
||||
|
||||
<sql id="selectCommonProblemPo1">
|
||||
<where>
|
||||
del_flag = 1
|
||||
<if test="topOrganizationId != null">
|
||||
and organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">
|
||||
and dict_label like concat('%', #{dictLabel}, '%')
|
||||
</if>
|
||||
<if test="title != null and title != ''">
|
||||
and title like concat('%', #{title}, '%')
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.commonProblem.repository.todo.CommonProblemDO"
|
||||
resultMap="CommonProblemResult">
|
||||
<include refid="selectCommonProblemPo"/>
|
||||
<include refid="selectCommonProblemPo1"/>
|
||||
</select>
|
||||
|
||||
<select id="queryListApp" parameterType="com.linke.product.domain.commonProblem.repository.todo.CommonProblemDO"
|
||||
resultMap="CommonProblemResult">
|
||||
<include refid="selectCommonProblemPo"/>
|
||||
<include refid="selectCommonProblemPo1"/>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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.linke.product.domain.commonWeb.repository.mapper.CommonWebMapper">
|
||||
|
||||
|
||||
<sql id="selectCommonWebPo1">
|
||||
<if test="commonWebDO.createByName != null and commonWebDO.createByName != ''">
|
||||
and create_by_name like concat('%', #{commonWebDO.createByName}, '%')
|
||||
</if>
|
||||
<if test="commonWebDO.updateByName != null and commonWebDO.updateByName != ''">
|
||||
and update_by_name like concat('%', #{commonWebDO.updateByName}, '%')
|
||||
</if>
|
||||
<if test="commonWebDO.topOrganizationId != null ">
|
||||
and top_organization_id = #{commonWebDO.topOrganizationId}
|
||||
</if>
|
||||
<if test="commonWebDO.organizationId != null ">
|
||||
and organization_id = #{commonWebDO.organizationId}
|
||||
</if>
|
||||
<if test="commonWebDO.organizationName != null and commonWebDO.organizationName != ''">
|
||||
and organization_name like concat('%', #{commonWebDO.organizationName}, '%')
|
||||
</if>
|
||||
<if test="commonWebDO.userId != null ">
|
||||
and user_id = #{commonWebDO.userId}
|
||||
</if>
|
||||
<if test="commonWebDO.webName != null and commonWebDO.webName != ''">
|
||||
and web_name like concat('%', #{commonWebDO.webName}, '%')
|
||||
</if>
|
||||
<if test="commonWebDO.webIcon != null and commonWebDO.webIcon != ''">
|
||||
and web_icon = #{commonWebDO.webIcon}
|
||||
</if>
|
||||
<if test="commonWebDO.webAddress != null and commonWebDO.webAddress != ''">
|
||||
and web_address = #{commonWebDO.webAddress}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.commonWeb.repository.todo.CommonWebDO"
|
||||
resultType="com.linke.product.domain.commonWeb.repository.po.CommonWebPO">
|
||||
select
|
||||
*
|
||||
from common_web
|
||||
where del_flag = 1
|
||||
<include refid="selectCommonWebPo1"/>
|
||||
order by sort
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,138 @@
|
||||
<?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.linke.product.domain.customAuth.repository.mapper.CustomAuthMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.customAuth.entity.CustomAuth" id="CustomAuthResult">
|
||||
<result property="customAuthId" column="custom_auth_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="tableJson" column="table_json" />
|
||||
<result property="formJson" column="form_json" />
|
||||
<result property="buttonJson" column="button_json" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustomAuthVo">
|
||||
SELECT
|
||||
custom_auth_id,
|
||||
menu_id,
|
||||
table_json,
|
||||
form_json,
|
||||
button_json,
|
||||
create_time,
|
||||
create_by,
|
||||
create_by_name,
|
||||
update_time,
|
||||
update_by,
|
||||
update_by_name,
|
||||
del_flag
|
||||
FROM
|
||||
custom_auth
|
||||
</sql>
|
||||
|
||||
<select id="selectCustomAuthList" parameterType="com.linke.product.domain.customAuth.entity.CustomAuth" resultMap="CustomAuthResult">
|
||||
<include refid="selectCustomAuthVo"/>
|
||||
<where>
|
||||
<if test="menuId != null "> and menu_id = #{menuId}</if>
|
||||
<if test="tableJson != null and tableJson != ''"> and table_json = #{tableJson}</if>
|
||||
<if test="formJson != null and formJson != ''"> and form_json = #{formJson}</if>
|
||||
<if test="buttonJson != null and buttonJson != ''"> and button_json = #{buttonJson}</if>
|
||||
<if test="createByName != null and createByName != ''"> and create_by_name like concat('%', #{createByName}, '%')</if>
|
||||
<if test="updateByName != null and updateByName != ''"> and update_by_name like concat('%', #{updateByName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustomAuthByCustomAuthId" parameterType="Long" resultMap="CustomAuthResult">
|
||||
<include refid="selectCustomAuthVo"/>
|
||||
where custom_auth_id = #{customAuthId}
|
||||
</select>
|
||||
|
||||
<select id="selectCustomAuthByCustomAuthMenuId" parameterType="Long" resultMap="CustomAuthResult">
|
||||
<include refid="selectCustomAuthVo"/>
|
||||
where menu_id = #{values} and del_flag=1
|
||||
</select>
|
||||
|
||||
<insert id="insertCustomAuth" parameterType="com.linke.product.domain.customAuth.entity.CustomAuth" >
|
||||
insert into custom_auth
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="menuId != null">menu_id,</if>
|
||||
<if test="tableJson != null">table_json,</if>
|
||||
<if test="formJson != null">form_json,</if>
|
||||
<if test="buttonJson != null">button_json,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createByName != null">create_by_name,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateByName != null">update_by_name,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="menuId != null">#{menuId},</if>
|
||||
<if test="tableJson != null">#{tableJson},</if>
|
||||
<if test="formJson != null">#{formJson},</if>
|
||||
<if test="buttonJson != null">#{buttonJson},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createByName != null">#{createByName},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateByName != null">#{updateByName},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCustomAuth" parameterType="com.linke.product.domain.customAuth.entity.CustomAuth">
|
||||
update custom_auth
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="menuId != null">menu_id = #{menuId},</if>
|
||||
<if test="tableJson != null">table_json = #{tableJson},</if>
|
||||
<if test="formJson != null">form_json = #{formJson},</if>
|
||||
<if test="buttonJson != null">button_json = #{buttonJson},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createByName != null">create_by_name = #{createByName},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateByName != null">update_by_name = #{updateByName},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where custom_auth_id = #{customAuthId}
|
||||
</update>
|
||||
|
||||
<update id="updateCustomAuthByMenuId" parameterType="com.linke.product.domain.customAuth.entity.CustomAuth">
|
||||
update custom_auth
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="menuId != null">menu_id = #{menuId},</if>
|
||||
<if test="tableJson != null">table_json = #{tableJson},</if>
|
||||
<if test="formJson != null">form_json = #{formJson},</if>
|
||||
<if test="buttonJson != null">button_json = #{buttonJson},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createByName != null">create_by_name = #{createByName},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateByName != null">update_by_name = #{updateByName},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCustomAuthByCustomAuthId" parameterType="Long">
|
||||
delete from custom_auth where custom_auth_id = #{customAuthId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCustomAuthByCustomAuthIds" parameterType="String">
|
||||
delete from custom_auth where custom_auth_id in
|
||||
<foreach item="customAuthId" collection="array" open="(" separator="," close=")">
|
||||
#{customAuthId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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.linke.product.domain.customAuth.repository.mapper.CustomAuthOrganizationMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.customAuth.entity.CustomAuthOrganization" id="CustomAuthOrganizationResult">
|
||||
<id property="customAuthOrganizationId" column="custom_auth_organization_id" />
|
||||
<result property="customAuthId" column="custom_auth_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="tenantsId" column="tenants_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustomAuthOrganizationVo">
|
||||
SELECT
|
||||
custom_auth_organization_id,
|
||||
menu_id,
|
||||
organization_id,
|
||||
tenants_id,
|
||||
table_json,
|
||||
form_json,
|
||||
button_json,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`custom_auth_organization`
|
||||
</sql>
|
||||
|
||||
<select id="selectCustomAuthByOrganization" parameterType="com.linke.product.domain.customAuth.entity.CustomAuthOrganization" resultMap="CustomAuthOrganizationResult">
|
||||
<include refid="selectCustomAuthOrganizationVo"/>
|
||||
where organization_id = #{organizationId} AND menu_id = #{menuId} and del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="selectCustomAuthByOrganizationId" parameterType="com.linke.product.domain.customAuth.entity.CustomAuthOrganization" resultMap="CustomAuthOrganizationResult">
|
||||
<include refid="selectCustomAuthOrganizationVo"/>
|
||||
<where>
|
||||
del_flag = 1
|
||||
<if test="organizationId != null "> and organization_id = #{organizationId}</if>
|
||||
<if test="tenantsId != null "> and tenants_id = #{tenantsId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCustomAuthByTenants" parameterType="com.linke.product.domain.customAuth.entity.CustomAuthOrganization" resultMap="CustomAuthOrganizationResult">
|
||||
<include refid="selectCustomAuthOrganizationVo"/>
|
||||
where tenants_id = #{tenantsId} AND menu_id = #{menuId} and del_flag = 1
|
||||
</select>
|
||||
|
||||
<update id="updateCustomAuthOrganization" parameterType="com.linke.product.domain.customAuth.entity.CustomAuthOrganization">
|
||||
update custom_auth_organization
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="organizationId != null">organization_id = #{organizationId},</if>
|
||||
<if test="tenantsId != null">tenants_id = #{tenantsId},</if>
|
||||
<if test="menuId != null">menu_id = #{menuId},</if>
|
||||
<if test="tableJson != null">table_json = #{tableJson},</if>
|
||||
<if test="formJson != null">form_json = #{formJson},</if>
|
||||
<if test="buttonJson != null">button_json = #{buttonJson},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createByName != null">create_by_name = #{createByName},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateByName != null">update_by_name = #{updateByName},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where custom_auth_organization_id = #{customAuthOrganizationId}
|
||||
</update>
|
||||
|
||||
<insert id="insertCustomAuthOrganization" parameterType="com.linke.product.domain.customAuth.entity.CustomAuthOrganization" >
|
||||
insert into custom_auth_organization
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="organizationId != null">organization_id,</if>
|
||||
<if test="tenantsId != null">tenants_id,</if>
|
||||
<if test="menuId != null">menu_id,</if>
|
||||
<if test="tableJson != null">table_json,</if>
|
||||
<if test="formJson != null">form_json,</if>
|
||||
<if test="buttonJson != null">button_json,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createByName != null">create_by_name,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateByName != null">update_by_name,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="organizationId != null">#{organizationId},</if>
|
||||
<if test="tenantsId != null">#{tenantsId},</if>
|
||||
<if test="menuId != null">#{menuId},</if>
|
||||
<if test="tableJson != null">#{tableJson},</if>
|
||||
<if test="formJson != null">#{formJson},</if>
|
||||
<if test="buttonJson != null">#{buttonJson},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createByName != null">#{createByName},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateByName != null">#{updateByName},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteCustomAuthOrganizationById" parameterType="java.lang.Long">
|
||||
delete from custom_auth_organization where custom_auth_organization_id = #{values}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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.linke.example.domain.elasticJob.repository.mapper.ElasticJobMapper">
|
||||
|
||||
<resultMap type="com.mhd.common.core.domain.ElasticJob" id="ElasticJobResult">
|
||||
<id property="elasticJobId" column="elastic_job_id" />
|
||||
<result property="applicationName" column="application_name" />
|
||||
<result property="jobName" column="job_name" />
|
||||
<result property="cron" column="cron" />
|
||||
<result property="totalCount" column="total_count" />
|
||||
<result property="itemParam" column="item_param" />
|
||||
<result property="className" column="class_name" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,513 @@
|
||||
<?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.linke.product.domain.menu.repository.mapper.MenuMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.menu.repository.po.MenuPo" id="MenuResult">
|
||||
<id property="menuId" column="menu_id" />
|
||||
<result property="parentMenuId" column="parent_menu_id" />
|
||||
<result property="modulesId" column="modules_id" />
|
||||
<result property="modulesName" column="modules_name" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="menuClient" column="menu_client" />
|
||||
<result property="menuType" column="menu_type" />
|
||||
<result property="menuName" column="menu_name" />
|
||||
<result property="menuShowName" column="menu_show_name" />
|
||||
<result property="menuPath" column="menu_path" />
|
||||
<result property="microServicePath" column="micro_service_path" />
|
||||
<result property="menuComponent" column="menu_component" />
|
||||
<result property="menuRedirectPath" column="menu_redirect_path" />
|
||||
<result property="menuIcon" column="menu_icon" />
|
||||
<result property="menuSort" column="menu_sort" />
|
||||
<result property="menuAvatar" column="menu_avatar" />
|
||||
<result property="menuHidden" column="menu_hidden" />
|
||||
<result property="menuVisible" column="menu_visible" />
|
||||
<result property="menuCacheStatus" column="menu_cache_status" />
|
||||
<result property="menuAlwaysShow" column="menu_always_show" />
|
||||
<result property="menuInternalOrExternal" column="menu_internal_or_external" />
|
||||
<result property="menuRemark" column="menu_remark" />
|
||||
<result property="menuPerms" column="menu_perms" />
|
||||
<result property="menuLinkage" column="menu_linkage" />
|
||||
<result property="menuShow" column="menu_show" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMenuVo">
|
||||
SELECT
|
||||
me.menu_id,
|
||||
me.parent_menu_id,
|
||||
me.modules_id,
|
||||
mo.modules_name,
|
||||
me.product_id,
|
||||
me.menu_client,
|
||||
me.menu_type,
|
||||
me.menu_name,
|
||||
me.menu_show_name,
|
||||
me.menu_path,
|
||||
me.micro_service_path,
|
||||
me.menu_component,
|
||||
me.menu_redirect_path,
|
||||
me.menu_icon,
|
||||
me.menu_sort,
|
||||
me.menu_avatar,
|
||||
me.app_location_code,
|
||||
me.app_location_name,
|
||||
me.menu_hidden,
|
||||
me.menu_visible,
|
||||
me.menu_cache_status,
|
||||
me.menu_always_show,
|
||||
me.menu_internal_or_external,
|
||||
me.menu_remark,
|
||||
me.menu_linkage,
|
||||
me.menu_show,
|
||||
me.menu_perms,
|
||||
me.create_time,
|
||||
me.create_by,
|
||||
me.update_time,
|
||||
me.update_by,
|
||||
me.source_id,
|
||||
me.del_flag,
|
||||
so.organization_name,
|
||||
me.top_organization_id,
|
||||
me.home_show_flag
|
||||
FROM
|
||||
`sys_menu` me
|
||||
LEFT JOIN
|
||||
sys_modules mo
|
||||
ON me.modules_id = mo.modules_id
|
||||
LEFT JOIN sys_organization so ON me.top_organization_id = so.organization_id
|
||||
AND so.del_flag = 1
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="com.linke.product.domain.menu.repository.po.MenuPo" resultMap="MenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
me.del_flag = 1
|
||||
<if test="modulesName != null and modulesName != ''">
|
||||
and mo.modules_name like concat('%' , #{modulesName} , '%')
|
||||
</if>
|
||||
<if test="menuClient != null">
|
||||
and me.menu_client = #{menuClient}
|
||||
</if>
|
||||
<if test="sourceId != null">
|
||||
and me.source_id = #{sourceId}
|
||||
</if>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
and me.menu_name like concat('%' , #{menuName} , '%')
|
||||
</if>
|
||||
<if test="menuRemark != null and menuRemark != ''">
|
||||
and me.menu_remark like concat('%' , #{menuRemark} , '%')
|
||||
</if>
|
||||
<if test="modulesId != null and modulesId != '-1'.toString()">
|
||||
and mo.modules_id = #{modulesId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null">
|
||||
and me.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="moduleIdList != null and moduleIdList.size > 0">
|
||||
and mo.modules_id in
|
||||
<foreach item="modulesId" collection="moduleIdList" open="(" separator="," close=")">
|
||||
#{modulesId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="menuIdList != null and menuIdList.size > 0">
|
||||
and me.menu_id in
|
||||
<foreach item="menuId" collection="menuIdList" open="(" separator="," close=")">
|
||||
#{menuId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryButtonlistById" parameterType="com.linke.product.domain.menu.repository.po.MenuPo" resultMap="MenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
me.del_flag = 1 and me.menu_type=3
|
||||
<if test="modulesId != null and modulesId != '-1'.toString()">
|
||||
and mo.modules_id = #{modulesId}
|
||||
</if>
|
||||
<if test="menuId != null">
|
||||
and me.parent_menu_id = #{menuId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null">
|
||||
and me.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="moduleIdList != null and moduleIdList.size > 0">
|
||||
and mo.modules_id in
|
||||
<foreach item="modulesId" collection="moduleIdList" open="(" separator="," close=")">
|
||||
#{modulesId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="menuIdList != null and menuIdList.size > 0">
|
||||
and me.menu_id in
|
||||
<foreach item="menuId" collection="menuIdList" open="(" separator="," close=")">
|
||||
#{menuId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectMenuTreeList" parameterType="com.linke.product.domain.menu.entity.Menu" resultMap="MenuResult">
|
||||
SELECT
|
||||
me.menu_id,
|
||||
me.parent_menu_id,
|
||||
mo.modules_name,
|
||||
me.menu_client,
|
||||
me.menu_type,
|
||||
me.menu_name,
|
||||
me.menu_show_name,
|
||||
me.menu_icon,
|
||||
me.menu_sort,
|
||||
me.menu_linkage,
|
||||
me.menu_internal_or_external,
|
||||
me.menu_show,
|
||||
me.menu_visible,
|
||||
me.menu_remark,
|
||||
me.menu_perms
|
||||
FROM
|
||||
`sys_menu` me
|
||||
LEFT JOIN
|
||||
sys_modules mo
|
||||
ON me.modules_id = mo.modules_id
|
||||
<where>
|
||||
me.menu_show = 1
|
||||
and me.del_flag = 1
|
||||
<if test="modulesId != null and modulesId != '-1'.toString()">
|
||||
and mo.modules_id = #{modulesId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null">
|
||||
and me.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="modulesId == null">
|
||||
and 1 != 1
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY me.menu_sort
|
||||
</select>
|
||||
|
||||
<select id="selectMenuIdListByTenantsId" parameterType="java.lang.Long" resultMap="MenuResult">
|
||||
SELECT DISTINCT
|
||||
m.menu_id,
|
||||
m.menu_name,
|
||||
m.menu_show_name,
|
||||
m.menu_icon,
|
||||
m.menu_sort,
|
||||
m.parent_menu_id,
|
||||
m.menu_remark,
|
||||
m.source_id,
|
||||
mo.modules_name,
|
||||
m.menu_client,
|
||||
m.modules_id
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN sys_organization p ON p.tenants_id = t.tenants_id
|
||||
INNER JOIN sys_menu m ON m.top_organization_id = p.organization_id
|
||||
LEFT JOIN sys_modules mo ON m.modules_id = mo.modules_id
|
||||
WHERE
|
||||
t.tenants_id = #{tenantsId}
|
||||
AND m.del_flag = 1
|
||||
AND m.menu_client = 1
|
||||
<if test="menuShow != null">
|
||||
AND m.menu_show = #{menuShow}
|
||||
</if>
|
||||
ORDER BY
|
||||
m.menu_sort
|
||||
</select>
|
||||
|
||||
<select id="selectMenuIdListByTenantsIdTwo" parameterType="java.lang.Long" resultMap="MenuResult">
|
||||
SELECT
|
||||
DISTINCT m.menu_id,
|
||||
m.menu_name,
|
||||
m.menu_show_name,
|
||||
m.menu_icon,
|
||||
m.menu_sort,
|
||||
m.parent_menu_id,
|
||||
m.menu_remark,
|
||||
mo.modules_name,
|
||||
m.menu_client
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN
|
||||
`tenants_menu` tm
|
||||
ON t.tenants_id = tm.tenants_id
|
||||
INNER JOIN
|
||||
sys_menu m
|
||||
ON m.menu_id = tm.menu_id
|
||||
LEFT JOIN
|
||||
sys_modules mo
|
||||
ON m.modules_id = mo.modules_id
|
||||
WHERE
|
||||
t.tenants_id = #{values}
|
||||
and m.menu_show = 1
|
||||
and m.del_flag = 1
|
||||
ORDER BY
|
||||
m.menu_sort
|
||||
</select>
|
||||
|
||||
<select id="selectMenuIdListByOrganizationId" parameterType="java.lang.Long" resultMap="MenuResult">
|
||||
SELECT
|
||||
DISTINCT m.menu_id,
|
||||
m.parent_menu_id,
|
||||
m.menu_name,
|
||||
m.menu_show_name,
|
||||
m.menu_icon,
|
||||
m.menu_sort,
|
||||
om.organization_id,
|
||||
m.modules_id
|
||||
FROM
|
||||
`organization_menu` om
|
||||
LEFT JOIN
|
||||
sys_menu m
|
||||
ON om.menu_id = m.menu_id
|
||||
WHERE
|
||||
om.organization_id = #{values}
|
||||
and m.menu_show = 1
|
||||
and m.del_flag = 1
|
||||
and m.menu_client = 1
|
||||
ORDER BY
|
||||
m.menu_sort
|
||||
</select>
|
||||
|
||||
<select id="selectMenuComponent" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
menu_component AS menuComponent,
|
||||
menu_redirect_path AS menuRedirectPath
|
||||
FROM
|
||||
`sys_menu`
|
||||
where
|
||||
del_flag = 1
|
||||
and menu_show = 1
|
||||
AND menu_component IS NOT NULL
|
||||
AND menu_component != ""
|
||||
</select>
|
||||
|
||||
<select id="selectMenuById" parameterType="java.lang.Long" resultMap="MenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where me.menu_id = #{value}
|
||||
and me.del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByIds" parameterType="java.lang.Long" resultMap="MenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where me.menu_id in
|
||||
<foreach item="menuId" collection="menuIds" open="(" separator="," close=")">
|
||||
#{menuId}
|
||||
</foreach>
|
||||
and me.del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="selectModulesByMenuId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
DISTINCT modules_id
|
||||
FROM
|
||||
`sys_menu`
|
||||
WHERE
|
||||
del_flag = 1
|
||||
AND menu_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
and menu_client = 1
|
||||
</select>
|
||||
|
||||
<select id="selectUseMenuId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
m.menu_id
|
||||
FROM
|
||||
`sys_menu` m
|
||||
LEFT JOIN
|
||||
`sys_menu` mp
|
||||
ON m.parent_menu_id = mp.menu_id
|
||||
LEFT JOIN
|
||||
sys_modules mo
|
||||
ON mo.modules_id = m.modules_id
|
||||
LEFT JOIN
|
||||
sys_modules mpo
|
||||
ON mpo.modules_id = mp.modules_id
|
||||
WHERE
|
||||
mo.use_status = 1
|
||||
AND m.menu_show = 1
|
||||
AND IFNULL(mpo.use_status,1) = 1
|
||||
AND m.menu_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectAllMenuId" resultType="java.lang.Long">
|
||||
SELECT
|
||||
menu_id
|
||||
FROM
|
||||
`sys_menu`
|
||||
WHERE
|
||||
del_flag = 1
|
||||
and menu_show = 1
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</select>
|
||||
|
||||
<select id="selectParentMenuId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
DISTINCT parent_menu_id
|
||||
FROM
|
||||
`sys_menu`
|
||||
WHERE
|
||||
parent_menu_id != 0
|
||||
AND menu_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectListByProductIdList" resultType="com.linke.product.domain.menu.entity.Menu">
|
||||
SELECT
|
||||
m.*
|
||||
FROM
|
||||
sys_menu m
|
||||
LEFT JOIN sys_modules mo ON m.modules_id = mo.modules_id
|
||||
LEFT JOIN sys_product_details d ON mo.modules_id = d.modules_id
|
||||
LEFT JOIN sys_product p ON d.product_id = p.product_id
|
||||
WHERE
|
||||
m.del_flag = 1
|
||||
AND m.top_organization_id = 1
|
||||
AND p.product_id IN
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getMenuIdByTenantsId" resultType="java.lang.Long">
|
||||
SELECT menu_id FROM sys_menu a
|
||||
LEFT JOIN sys_organization b ON a.top_organization_id = b.organization_id
|
||||
WHERE a.del_flag = 1
|
||||
AND a.menu_client = 1
|
||||
<if test="tenantsId != null">
|
||||
and b.tenants_id = #{tenantsId}
|
||||
</if>
|
||||
<if test="menuShow != null">
|
||||
and a.menu_show = #{menuShow}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getMenuByTenantsId" resultType="com.linke.product.domain.menu.entity.Menu">
|
||||
SELECT a.* FROM sys_menu a
|
||||
LEFT JOIN sys_organization b ON a.top_organization_id = b.organization_id
|
||||
WHERE a.del_flag = 1
|
||||
AND a.menu_client = 1
|
||||
<if test="tenantsId != null">
|
||||
and b.tenants_id = #{tenantsId}
|
||||
</if>
|
||||
<if test="menuShow != null">
|
||||
and a.menu_show = #{menuShow}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertMenu" parameterType="com.linke.product.domain.menu.entity.Menu" >
|
||||
insert into sys_menu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentMenuId != null">parent_menu_id,</if>
|
||||
<if test="modulesId != null">modules_id,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="menuClient != null">menu_client,</if>
|
||||
<if test="menuType != null">menu_type,</if>
|
||||
<if test="menuName != null">menu_name,</if>
|
||||
<if test="menuShowName != null">menu_show_name,</if>
|
||||
<if test="menuPath != null">menu_path,</if>
|
||||
<if test="microServicePath != null">micro_service_path,</if>
|
||||
<if test="menuComponent != null">menu_component,</if>
|
||||
<if test="menuRedirectPath != null">menu_redirect_path,</if>
|
||||
<if test="menuIcon != null">menu_icon,</if>
|
||||
<if test="menuSort != null">menu_sort,</if>
|
||||
<if test="menuAvatar != null">menu_avatar,</if>
|
||||
<if test="menuHidden != null">menu_hidden,</if>
|
||||
<if test="menuVisible != null">menu_visible,</if>
|
||||
<if test="menuCacheStatus != null">menu_cache_status,</if>
|
||||
<if test="menuAlwaysShow != null">menu_always_show,</if>
|
||||
<if test="menuInternalOrExternal != null">menu_internal_or_external,</if>
|
||||
<if test="menuRemark != null">menu_remark,</if>
|
||||
<if test="menuPerms != null">menu_perms,</if>
|
||||
<if test="menuLinkage != null">menu_linkage,</if>
|
||||
<if test="menuShow != null">menu_show,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentMenuId != null">#{parentMenuId},</if>
|
||||
<if test="modulesId != null">#{modulesId},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="menuClient != null">#{menuClient},</if>
|
||||
<if test="menuType != null">#{menuType},</if>
|
||||
<if test="menuName != null">#{menuName},</if>
|
||||
<if test="menuShowName != null">#{menuShowName},</if>
|
||||
<if test="menuPath != null">#{menuPath},</if>
|
||||
<if test="microServicePath != null">#{microServicePath},</if>
|
||||
<if test="menuComponent != null">#{menuComponent},</if>
|
||||
<if test="menuRedirectPath != null">#{menuRedirectPath},</if>
|
||||
<if test="menuIcon != null">#{menuIcon},</if>
|
||||
<if test="menuSort != null">#{menuSort},</if>
|
||||
<if test="menuAvatar != null">#{menuAvatar},</if>
|
||||
<if test="menuHidden != null">#{menuHidden},</if>
|
||||
<if test="menuVisible != null">#{menuVisible},</if>
|
||||
<if test="menuCacheStatus != null">#{menuCacheStatus},</if>
|
||||
<if test="menuAlwaysShow != null">#{menuAlwaysShow},</if>
|
||||
<if test="menuInternalOrExternal != null">#{menuInternalOrExternal},</if>
|
||||
<if test="menuRemark != null">#{menuRemark},</if>
|
||||
<if test="menuPerms != null">#{menuPerms},</if>
|
||||
<if test="menuLinkage != null">#{menuLinkage},</if>
|
||||
<if test="menuShow != null">#{menuShow},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMenu" parameterType="com.linke.product.domain.menu.entity.Menu">
|
||||
update sys_menu
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentMenuId != null">parent_menu_id = #{parentMenuId},</if>
|
||||
<if test="modulesId != null">modules_id = #{modulesId},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="menuClient != null">menu_client = #{menuClient},</if>
|
||||
<if test="menuType != null">menu_type = #{menuType},</if>
|
||||
<if test="menuName != null">menu_name = #{menuName},</if>
|
||||
<if test="menuShowName != null">menu_show_name = #{menuShowName},</if>
|
||||
<if test="menuPath != null">menu_path = #{menuPath},</if>
|
||||
<if test="microServicePath != null">micro_service_path = #{microServicePath},</if>
|
||||
<if test="menuComponent != null">menu_component = #{menuComponent},</if>
|
||||
<if test="menuRedirectPath != null">menu_redirect_path = #{menuRedirectPath},</if>
|
||||
<if test="menuIcon != null">menu_icon = #{menuIcon},</if>
|
||||
<if test="menuSort != null">menu_sort = #{menuSort},</if>
|
||||
<if test="menuAvatar != null">menu_avatar = #{menuAvatar},</if>
|
||||
<if test="menuHidden != null">menu_hidden = #{menuHidden},</if>
|
||||
<if test="menuVisible != null">menu_visible = #{menuVisible},</if>
|
||||
<if test="menuCacheStatus != null">menu_cache_status = #{menuCacheStatus},</if>
|
||||
<if test="menuAlwaysShow != null">menu_always_show = #{menuAlwaysShow},</if>
|
||||
<if test="menuInternalOrExternal != null">menu_internal_or_external = #{menuInternalOrExternal},</if>
|
||||
<if test="menuRemark != null">menu_remark = #{menuRemark},</if>
|
||||
<if test="menuPerms != null">menu_perms = #{menuPerms},</if>
|
||||
<if test="menuLinkage != null">menu_linkage = #{menuLinkage},</if>
|
||||
<if test="menuShow != null">menu_show = #{menuShow},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMenuById" parameterType="java.lang.Long">
|
||||
delete from sys_menu where menu_id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMenuByIds" parameterType="java.lang.Long">
|
||||
delete from sys_menu where menu_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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.linke.product.domain.modules.repository.mapper.ModulesMenuMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.modules.entity.ModulesMenu" id="ModulesMenuResult">
|
||||
<id property="modulesId" column="modules_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectModulesMenuVo">
|
||||
SELECT
|
||||
modules_menu_id,
|
||||
modules_id,
|
||||
menu_id,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`modules_menu`
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByModulesId" parameterType="java.lang.Long" resultMap="ModulesMenuResult">
|
||||
<include refid="selectModulesMenuVo"/>
|
||||
where modules_id = #{value} and del_flag = 1
|
||||
</select>
|
||||
|
||||
<insert id="batchAddModulesMenu" parameterType="java.util.List">
|
||||
insert into modules_menu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
modules_id,
|
||||
menu_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{item.modulesId},
|
||||
#{item.menuId},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteModulesMenuById" parameterType="java.lang.Long">
|
||||
delete from modules_menu where modules_id = #{values}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,210 @@
|
||||
<?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.linke.product.domain.modules.repository.mapper.SysModulesMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.modules.entity.SysModules" id="SysModulesResult">
|
||||
<id property="modulesId" column="modules_id" />
|
||||
<result property="parentModulesId" column="parent_modules_id" />
|
||||
<result property="modulesName" column="modules_name" />
|
||||
<result property="modulesNumber" column="modules_number" />
|
||||
<result property="modulesRemark" column="modules_remark" />
|
||||
<result property="useStatus" column="use_status" />
|
||||
<result property="modulesSort" column="modules_sort" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysModulesVo">
|
||||
SELECT
|
||||
modules_id,
|
||||
parent_modules_id,
|
||||
modules_name,
|
||||
modules_number,
|
||||
modules_remark,
|
||||
use_status,
|
||||
modules_sort,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
modules_client,
|
||||
del_flag
|
||||
FROM
|
||||
sys_modules
|
||||
</sql>
|
||||
|
||||
<sql id="common_where">
|
||||
del_flag = 1
|
||||
</sql>
|
||||
|
||||
<select id="selectSysModulesList" parameterType="com.linke.product.domain.modules.entity.SysModules" resultMap="SysModulesResult">
|
||||
<include refid="selectSysModulesVo"/>
|
||||
<where>
|
||||
<include refid="common_where"></include>
|
||||
<if test="modulesName != null and modulesName != ''"> and modules_name like concat('%', #{modulesName}, '%')</if>
|
||||
<if test="modulesNumber != null and modulesNumber != ''"> and modules_number like concat('%', #{modulesNumber}, '%')</if>
|
||||
<if test="modulesRemark != null and modulesRemark != ''"> and modules_remark like concat('%', #{modulesRemark}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectModulesTreeList" resultMap="SysModulesResult">
|
||||
SELECT
|
||||
modules_id,
|
||||
parent_modules_id,
|
||||
modules_name,
|
||||
modules_number,
|
||||
modules_remark,
|
||||
modules_client,
|
||||
modules_sort
|
||||
FROM
|
||||
sys_modules
|
||||
where
|
||||
del_flag = 1
|
||||
and modules_name like concat('%', #{modulesName}, '%')
|
||||
<choose>
|
||||
<when test="modulesClient != null">
|
||||
and modules_client = #{modulesClient}
|
||||
</when>
|
||||
<otherwise>
|
||||
and modules_client = 1
|
||||
</otherwise>
|
||||
</choose>
|
||||
ORDER BY
|
||||
modules_sort
|
||||
</select>
|
||||
|
||||
<select id="selectModulesList" resultType="java.util.Map">
|
||||
SELECT
|
||||
modules_id as id,
|
||||
modules_name as name
|
||||
FROM
|
||||
sys_modules
|
||||
where
|
||||
del_flag = 1
|
||||
-- and parent_modules_id != 0
|
||||
and use_status = 1
|
||||
and modules_client = #{modulesClient}
|
||||
</select>
|
||||
|
||||
<select id="selectSysModulesByModulesId" parameterType="java.lang.Long" resultMap="SysModulesResult">
|
||||
<include refid="selectSysModulesVo"/>
|
||||
where modules_id = #{modulesId} and del_flag = 1
|
||||
</select>
|
||||
|
||||
<insert id="insertSysModules" parameterType="com.linke.product.domain.modules.entity.SysModules" useGeneratedKeys="true" keyProperty="modulesId">
|
||||
insert into sys_modules
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentModulesId != null">parent_modules_id,</if>
|
||||
<if test="modulesName != null">modules_name,</if>
|
||||
<if test="modulesNumber != null">modules_number,</if>
|
||||
<if test="modulesRemark != null">modules_remark,</if>
|
||||
<if test="useStatus != null">use_status,</if>
|
||||
<if test="modulesSort != null">modules_sort,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentModulesId != null">#{parentModulesId},</if>
|
||||
<if test="modulesName != null">#{modulesName},</if>
|
||||
<if test="modulesNumber != null">#{modulesNumber},</if>
|
||||
<if test="modulesRemark != null">#{modulesRemark},</if>
|
||||
<if test="useStatus != null">#{useStatus},</if>
|
||||
<if test="modulesSort != null">#{modulesSort},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysModules" parameterType="com.linke.product.domain.modules.entity.SysModules">
|
||||
update sys_modules
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentModulesId != null">parent_modules_id = #{parentModulesId},</if>
|
||||
<if test="modulesName != null">modules_name = #{modulesName},</if>
|
||||
<if test="modulesNumber != null">modules_number = #{modulesNumber},</if>
|
||||
<if test="modulesRemark != null">modules_remark = #{modulesRemark},</if>
|
||||
<if test="useStatus != null">use_status = #{useStatus},</if>
|
||||
<if test="modulesSort != null">modules_sort = #{modulesSort},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where modules_id = #{modulesId}
|
||||
</update>
|
||||
|
||||
<update id="sortAdd" >
|
||||
update sys_modules SET modules_sort = (modules_sort+1) WHERE parent_modules_id = #{parentModulesId} AND modules_sort = #{modulesSort}
|
||||
</update>
|
||||
|
||||
<update id="sortSubtract" >
|
||||
update sys_modules SET modules_sort = IF(( modules_sort - 1 ) > 0,( modules_sort - 1 ),1) WHERE parent_modules_id = #{parentModulesId} AND modules_sort = #{modulesSort}
|
||||
</update>
|
||||
|
||||
<update id="sortAddById" >
|
||||
update sys_modules SET modules_sort = (modules_sort+1) WHERE modules_id = #{value}
|
||||
</update>
|
||||
|
||||
<update id="sortSubtractById" >
|
||||
update sys_modules SET modules_sort = IF(( modules_sort - 1 ) > 0,( modules_sort - 1 ),1) WHERE modules_id = #{value}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysModulesByModulesId" parameterType="java.lang.Long">
|
||||
delete from sys_modules where modules_id = #{modulesId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysModulesByModulesIds" parameterType="java.lang.Long">
|
||||
delete from sys_modules where modules_id in
|
||||
<foreach item="modulesId" collection="array" open="(" separator="," close=")">
|
||||
#{modulesId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="findModulesByModuleIds" parameterType="java.lang.Long" resultType="com.linke.product.domain.modules.repository.po.SysModulesPO">
|
||||
<include refid="selectSysModulesVo"/>
|
||||
where
|
||||
del_flag = 1
|
||||
and modules_id in
|
||||
<foreach item="modulesId" collection="modulesIds" open="(" separator="," close=")">
|
||||
#{modulesId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="findRecursionModulesByModuleId" parameterType="java.lang.Long" resultType="com.linke.product.domain.modules.repository.po.SysModulesPO">
|
||||
WITH RECURSIVE recursion ( modules_id, modules_name, use_status ) AS (
|
||||
SELECT
|
||||
a.modules_id,
|
||||
a.modules_name,
|
||||
a.use_status
|
||||
FROM
|
||||
sys_modules a
|
||||
WHERE
|
||||
a.modules_id = #{modulesId} UNION ALL
|
||||
SELECT
|
||||
b.modules_id,
|
||||
b.modules_name,
|
||||
b.use_status
|
||||
FROM
|
||||
sys_modules b,
|
||||
recursion c
|
||||
WHERE
|
||||
b.parent_modules_id = c.modules_id
|
||||
) SELECT
|
||||
d.modules_id,
|
||||
d.modules_name,
|
||||
d.use_status
|
||||
FROM
|
||||
recursion d
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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.linke.product.domain.organization.repository.mapper.OrganizationCorrelationMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.organization.entity.OrganizationCorrelation" id="OrganizationCorrelationResult">
|
||||
<result property="orgCorrelationId" column="org_correlation_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="associationOrganizationId" column="association_organization_id" />
|
||||
<result property="associationOrganizationName" column="association_organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="topOrganizationName" column="top_organization_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectOrganizationCorrelationPo">
|
||||
select org_correlation_id, organization_id, organization_name, association_organization_id, association_organization_name, association_platform_type, top_organization_id, top_organization_name, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag from sys_organization_correlation
|
||||
</sql>
|
||||
|
||||
<sql id="selectOrganizationCorrelationPo1">
|
||||
<where>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="associationOrganizationId != null ">
|
||||
and association_organization_id = #{associationOrganizationId}
|
||||
</if>
|
||||
<if test="associationOrganizationName != null and associationOrganizationName != ''">
|
||||
and association_organization_name like concat('%', #{associationOrganizationName}, '%')
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="topOrganizationName != null and topOrganizationName != ''">
|
||||
and top_organization_name like concat('%', #{topOrganizationName}, '%')
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.organization.repository.po.OrganizationCorrelationPO" resultMap="OrganizationCorrelationResult">
|
||||
<include refid="selectOrganizationCorrelationPo"/>
|
||||
<include refid="selectOrganizationCorrelationPo1"/>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,362 @@
|
||||
<?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.linke.product.domain.organization.repository.mapper.OrganizationMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.organization.repository.po.OrganizationPo" id="OrganizationResult">
|
||||
<id property="organizationId" column="organization_id" />
|
||||
<result property="parentOrganizationId" column="parent_organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="employeeNum" column="employee_num" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userAccount" column="user_account" />
|
||||
<result property="parentOrganizationName" column="parent_organization_name" />
|
||||
<result property="tenantsId" column="tenants_id" />
|
||||
<result property="principalId" column="principal_id" />
|
||||
<result property="principalName" column="principal_name" />
|
||||
<result property="principalAccount" column="principal_account" />
|
||||
<result property="organizationState" column="organization_state" />
|
||||
<result property="organizationRemark" column="organization_remark" />
|
||||
<result property="organizationLinkage" column="organization_linkage" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="taxpayerNumber" column="taxpayer_number" />
|
||||
<result property="legalPerson" column="legal_person" />
|
||||
<result property="legalPersonIdNo" column="legal_person_id_no" />
|
||||
<result property="companyAddress" column="company_address" />
|
||||
<result property="companyCode" column="company_code" />
|
||||
<result property="taxCompanyCode" column="tax_company_code" />
|
||||
<result property="esignType" column="esign_type" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="socialCreditCode" column="social_credit_code" />
|
||||
<result property="systemName" column="system_name" />
|
||||
<result property="systemDescription" column="system_description"/>
|
||||
<result property="serviceHotline" column="service_hotline"/>
|
||||
<result property="city" column="city"/>
|
||||
<result property="systemAddress" column="system_address"/>
|
||||
<result property="mailbox" column="mailbox"/>
|
||||
<result property="recordNumber" column="record_number"/>
|
||||
<result property="companyLogo" column="company_logo"/>
|
||||
<result property="webIcon" column="web_icon"/>
|
||||
<result property="aboutUs" column="about_us"/>
|
||||
<result property="receivingAccount" column="receiving_account"/>
|
||||
<result property="receivingBank" column="receiving_bank"/>
|
||||
<result property="receivingNumber" column="receiving_number"/>
|
||||
<result property="interbankNumber" column="interbank_number"/>
|
||||
<result property="templateSeal" column="template_seal"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrganizationVo">
|
||||
SELECT
|
||||
o1.organization_id,
|
||||
o1.parent_organization_id,
|
||||
o1.organization_name,
|
||||
o2.organization_name AS parent_organization_name,
|
||||
o1.employee_num,
|
||||
o1.tenants_id,
|
||||
o1.principal_id,
|
||||
o1.principal_name,
|
||||
o1.principal_account,
|
||||
o1.organization_state,
|
||||
o1.organization_remark,
|
||||
o1.organization_linkage,
|
||||
o1.create_time,
|
||||
o1.create_by,
|
||||
o1.update_time,
|
||||
o1.update_by,
|
||||
o1.platefrom_type,
|
||||
o1.del_flag,
|
||||
o1.taxpayer_number,
|
||||
o1.legal_person,
|
||||
o1.legal_person_id_no,
|
||||
o1.company_address,
|
||||
o1.company_code,
|
||||
o1.tax_company_code,
|
||||
o1.esign_type,
|
||||
o1.account_id,
|
||||
o1.social_credit_code,
|
||||
o1.electric_signature,
|
||||
o1.system_name,
|
||||
o1.system_description,
|
||||
o1.service_hotline,
|
||||
o1.city,
|
||||
o1.system_address,
|
||||
o1.mailbox,
|
||||
o1.record_number,
|
||||
o1.company_logo,
|
||||
o1.web_icon,
|
||||
o1.about_us,
|
||||
o1.receiving_account,
|
||||
o1.receiving_bank,
|
||||
o1.receiving_number,
|
||||
o1.interbank_number,
|
||||
o1.template_seal
|
||||
FROM
|
||||
`sys_organization` o1
|
||||
LEFT JOIN
|
||||
`sys_organization` o2
|
||||
ON o1.parent_organization_id = o2.organization_id
|
||||
</sql>
|
||||
|
||||
<select id="selectOrganizationList" parameterType="com.linke.product.domain.organization.repository.po.OrganizationPo" resultMap="OrganizationResult">
|
||||
<include refid="selectOrganizationVo"/>
|
||||
where o1.del_flag = 1
|
||||
<if test="organizationName != null and organizationName != ''"> and o1.organization_name like concat('%', #{organizationName}, '%')</if>
|
||||
<if test="createBy != null"> and o1.create_by = #{createBy}</if>
|
||||
<if test="organizationIdList != null ">
|
||||
AND o1.organization_id in
|
||||
<foreach item="id" collection="organizationIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="organizationIdNotList != null ">
|
||||
AND o1.organization_id not in
|
||||
<foreach item="id" collection="organizationIdNotList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" isCorrelation != null and isCorrelation == 1 and organizationId != null ">
|
||||
AND o1.organization_id NOT IN ( SELECT organization_id FROM `sys_organization_correlation` WHERE organization_id = #{organizationId} )
|
||||
</if>
|
||||
order by o1.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectOrganizationById" parameterType="java.lang.Long" resultMap="OrganizationResult">
|
||||
<include refid="selectOrganizationVo"/>
|
||||
where o1.organization_id = #{value} and o1.del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="selectOrganizationIdByTenants" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
organization_id
|
||||
FROM
|
||||
`sys_organization`
|
||||
where tenants_id = #{value} and del_flag = 1
|
||||
and organization_state = 1
|
||||
</select>
|
||||
<select id="selectTopIdByTenantsDomainName" parameterType="java.lang.String" resultType="com.linke.product.domain.tenants.repository.po.SysTenantsPo">
|
||||
SELECT
|
||||
a.organization_id AS organizationId,
|
||||
a.organization_name AS organizationName,
|
||||
b.tenants_status AS tenantsStatus,
|
||||
b.logo_url,
|
||||
b.tenants_name,
|
||||
b.tenants_simple_name,
|
||||
b.user_id
|
||||
FROM
|
||||
`sys_organization` a
|
||||
LEFT JOIN `sys_tenants` b ON a.tenants_id = b.tenants_id AND b.del_flag = 1
|
||||
LEFT JOIN `tenants_domain_name` c ON b.tenants_id = c.tenants_id AND c.del_flag = 1
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
AND (b.tenants_domain_name = #{value}
|
||||
OR c.domain_name = #{value})
|
||||
and organization_state = 1
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectTopId" parameterType="java.lang.Long" resultMap="OrganizationResult">
|
||||
WITH RECURSIVE tree ( organization_id, organization_name, parent_organization_id ) AS (
|
||||
SELECT
|
||||
organization_id,
|
||||
organization_name,
|
||||
parent_organization_id
|
||||
FROM
|
||||
sys_organization
|
||||
WHERE
|
||||
organization_id = #{value} UNION ALL
|
||||
SELECT
|
||||
t.organization_id,
|
||||
t.organization_name,
|
||||
t.parent_organization_id
|
||||
FROM
|
||||
tree p,
|
||||
sys_organization t
|
||||
WHERE
|
||||
p.parent_organization_id = t.organization_id
|
||||
) SELECT
|
||||
*
|
||||
FROM
|
||||
tree
|
||||
WHERE
|
||||
parent_organization_id = 0
|
||||
</select>
|
||||
|
||||
<select id="selectTopOrganizationList" parameterType="java.lang.Long" resultMap="OrganizationResult">
|
||||
WITH RECURSIVE tree ( organization_id, organization_name, parent_organization_id ) AS (
|
||||
SELECT
|
||||
organization_id,
|
||||
organization_name,
|
||||
parent_organization_id
|
||||
FROM
|
||||
sys_organization
|
||||
WHERE
|
||||
organization_id = #{value}
|
||||
UNION ALL
|
||||
SELECT
|
||||
t.organization_id,
|
||||
t.organization_name,
|
||||
t.parent_organization_id
|
||||
FROM
|
||||
tree p,
|
||||
sys_organization t
|
||||
WHERE
|
||||
p.parent_organization_id = t.organization_id
|
||||
) SELECT
|
||||
*
|
||||
FROM
|
||||
tree
|
||||
</select>
|
||||
|
||||
<select id="selectAllOrganizationId" resultType="Long">
|
||||
SELECT
|
||||
organization_id
|
||||
FROM
|
||||
`sys_organization`
|
||||
where
|
||||
del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="selectOrganizationIdByParent" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
organization_id
|
||||
FROM
|
||||
`sys_organization`
|
||||
where
|
||||
del_flag = 1
|
||||
AND parent_organization_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectChildByOrganization" resultType="java.lang.Long">
|
||||
select organization_id from (
|
||||
select
|
||||
t1.organization_id,
|
||||
if(find_in_set(parent_organization_id, @pids) > 0, @pids := concat(@pids, ',', organization_id), 0) as ischild
|
||||
from (
|
||||
select
|
||||
organization_id,
|
||||
parent_organization_id
|
||||
from sys_organization t order by parent_organization_id, organization_id
|
||||
) t1,
|
||||
(select @pids := #{id}) t2
|
||||
) t3 where ischild != 0 OR organization_id = #{id}
|
||||
order by organization_id
|
||||
</select>
|
||||
|
||||
<select id="selectAllOrganizationById" resultType="java.lang.Long" parameterType="java.lang.Long">
|
||||
SELECT
|
||||
organization_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
t1.organization_id,
|
||||
t1.organization_name,
|
||||
t1.parent_organization_id,
|
||||
IF
|
||||
(
|
||||
find_in_set( parent_organization_id, @pids ) > 0,
|
||||
@pids := concat( @pids, ',', organization_id ),
|
||||
IF
|
||||
( t1.organization_id = #{organizationId}, #{organizationId}, - 1 )
|
||||
) AS ischild
|
||||
FROM
|
||||
( SELECT organization_id, parent_organization_id, organization_name FROM sys_organization t ) t1,
|
||||
( SELECT @pids := #{organizationId} ) t2
|
||||
) t3
|
||||
WHERE
|
||||
ischild != - 1
|
||||
</select>
|
||||
<select id="getAllOrganization"
|
||||
resultType="com.linke.product.domain.organization.repository.po.OrganizationPo">
|
||||
SELECT
|
||||
organization_id,
|
||||
organization_name
|
||||
FROM
|
||||
sys_organization
|
||||
WHERE
|
||||
del_flag = 1
|
||||
AND tenants_id = (
|
||||
SELECT
|
||||
tenants_id
|
||||
FROM
|
||||
sys_organization
|
||||
WHERE
|
||||
organization_id = #{topOrganizationId})
|
||||
</select>
|
||||
|
||||
<insert id="insertOrganization" parameterType="com.linke.product.domain.organization.entity.Organization" useGeneratedKeys="true" keyProperty="organizationId">
|
||||
insert into sys_organization
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentOrganizationId != null">parent_organization_id,</if>
|
||||
<if test="organizationName != null">organization_name,</if>
|
||||
<if test="employeeNum != null">employee_num,</if>
|
||||
<if test="tenantsId != null">tenants_id,</if>
|
||||
<if test="principalId != null">principal_id,</if>
|
||||
<if test="principalName != null">principal_name,</if>
|
||||
<if test="principalAccount != null">principal_account,</if>
|
||||
<if test="organizationState != null">organization_state,</if>
|
||||
<if test="organizationRemark != null">organization_remark,</if>
|
||||
<if test="organizationLinkage != null">organization_linkage,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentOrganizationId != null">#{parentOrganizationId},</if>
|
||||
<if test="organizationName != null">#{organizationName},</if>
|
||||
<if test="employeeNum != null">#{employeeNum},</if>
|
||||
<if test="tenantsId != null">#{tenantsId},</if>
|
||||
<if test="principalId != null">#{principalId},</if>
|
||||
<if test="principalName != null">#{principalName},</if>
|
||||
<if test="principalAccount != null">#{principalAccount},</if>
|
||||
<if test="organizationState != null">#{organizationState},</if>
|
||||
<if test="organizationRemark != null">#{organizationRemark},</if>
|
||||
<if test="organizationLinkage != null">#{organizationLinkage},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateOrganization" parameterType="com.linke.product.domain.organization.entity.Organization">
|
||||
update sys_organization
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentOrganizationId != null">parent_organization_id = #{parentOrganizationId},</if>
|
||||
<if test="organizationName != null">organization_name = #{organizationName},</if>
|
||||
<if test="employeeNum != null">employee_num = #{employeeNum},</if>
|
||||
<if test="tenantsId != null">tenants_id = #{tenantsId},</if>
|
||||
<if test="principalId != null">principal_id = #{principalId},</if>
|
||||
<if test="principalName != null">principal_name = #{principalName},</if>
|
||||
<if test="principalAccount != null">principal_account = #{principalAccount},</if>
|
||||
<if test="organizationState != null">organization_state = #{organizationState},</if>
|
||||
<if test="organizationRemark != null">organization_remark = #{organizationRemark},</if>
|
||||
<if test="organizationLinkage != null">organization_linkage = #{organizationLinkage},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where organization_id = #{organizationId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOrganizationById" parameterType="java.lang.Long">
|
||||
delete from sys_organization where organization_id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOrganizationByIds" parameterType="java.lang.Long">
|
||||
delete from sys_organization where organization_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?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.linke.product.domain.organization.repository.mapper.OrganizationMenuMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.organization.entity.OrganizationMenu" id="OrganizationMenuResult">
|
||||
<id property="organizationMenuId" column="organization_menu_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrganizationMenuVo">
|
||||
SELECT
|
||||
organization_menu_id,
|
||||
organization_id,
|
||||
menu_id,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`organization_menu`
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByOrganizationId" parameterType="java.lang.Long" resultMap="OrganizationMenuResult">
|
||||
<include refid="selectOrganizationMenuVo"/>
|
||||
where organization_id = #{value} and del_flag = 1
|
||||
</select>
|
||||
<select id="getMenuListByOrganizationId" resultType="com.linke.product.domain.menu.entity.Menu">
|
||||
SELECT
|
||||
a.*
|
||||
FROM
|
||||
sys_menu a
|
||||
LEFT JOIN organization_menu b ON a.menu_id = b.menu_id and b.del_flag = 1
|
||||
WHERE a.del_flag = 1 and a.menu_type!=3
|
||||
<if test="menuClient != null">
|
||||
AND a.menu_client = #{menuClient}
|
||||
</if>
|
||||
AND b.organization_id = #{organizationId}
|
||||
</select>
|
||||
<select id="getTenantsList"
|
||||
resultType="com.linke.product.domain.organization.repository.po.OrganizationPo">
|
||||
SELECT
|
||||
t.tenants_id,
|
||||
t.tenants_name,
|
||||
o.organization_id
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN sys_organization o ON o.tenants_id = t.tenants_id
|
||||
AND t.del_flag = 1
|
||||
WHERE
|
||||
o.del_flag = 1
|
||||
AND o.organization_state = 1
|
||||
<if test="organizationId != null">
|
||||
AND o.organization_id = #{organizationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="batchAddOrganizationMenu" parameterType="java.util.List">
|
||||
insert into organization_menu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
organization_id,
|
||||
menu_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{item.organizationId},
|
||||
#{item.menuId},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteOrganizationMenuById" parameterType="java.lang.Long">
|
||||
delete from organization_menu where organization_id = #{values}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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.linke.product.domain.product.repository.mapper.ProductDetailsMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.product.entity.ProductDetails" id="ProductDetailsResult">
|
||||
<id property="productDetailsId" column="product_details_id" />
|
||||
<result property="modulesId" column="modules_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDetailsMenuVo">
|
||||
SELECT
|
||||
spd.product_details_id,
|
||||
spd.product_id,
|
||||
spd.modules_id,
|
||||
spd.create_time,
|
||||
spd.create_by,
|
||||
spd.update_time,
|
||||
spd.update_by,
|
||||
spd.del_flag
|
||||
FROM
|
||||
`sys_product_details` spd
|
||||
LEFT JOIN sys_modules sm ON spd.modules_id = sm.modules_id
|
||||
AND sm.del_flag = 1
|
||||
</sql>
|
||||
|
||||
<select id="selectDetailsListByProductId" resultMap="ProductDetailsResult">
|
||||
<include refid="selectDetailsMenuVo"/>
|
||||
where spd.product_id = #{id} and spd.del_flag = 1
|
||||
and sm.modules_client = #{modulesClient}
|
||||
</select>
|
||||
|
||||
<select id="selectDetailsListByProductIds" resultMap="ProductDetailsResult">
|
||||
<include refid="selectDetailsMenuVo"/>
|
||||
where spd.product_id in
|
||||
<foreach item="productId" collection="productIds" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
and spd.del_flag = 1
|
||||
and sm.modules_client = #{modulesClient}
|
||||
</select>
|
||||
|
||||
<insert id="batchAddProductDetails" parameterType="java.util.List">
|
||||
insert into sys_product_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
product_id,
|
||||
modules_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{item.productId},
|
||||
#{item.modulesId},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteProductDetailsById">
|
||||
DELETE
|
||||
FROM
|
||||
sys_product_details
|
||||
WHERE
|
||||
product_id = #{id}
|
||||
AND modules_id IN (
|
||||
SELECT
|
||||
modules_id
|
||||
FROM
|
||||
sys_modules
|
||||
WHERE
|
||||
del_flag = 1
|
||||
AND modules_client = #{dataSource})
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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.linke.product.domain.product.repository.mapper.ProductMenuMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.product.entity.ProductMenu" id="ProductMenuResult">
|
||||
<id property="productMenuId" column="product_menu_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProductMenuVo">
|
||||
SELECT
|
||||
product_menu_id,
|
||||
product_id,
|
||||
menu_id,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`product_menu`
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByProductId" parameterType="java.lang.Long" resultMap="ProductMenuResult">
|
||||
<include refid="selectProductMenuVo"/>
|
||||
where product_id = #{value} and del_flag = 1
|
||||
</select>
|
||||
|
||||
<insert id="batchAddProductMenu" parameterType="java.util.List">
|
||||
insert into product_menu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
product_id,
|
||||
menu_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{item.productId},
|
||||
#{item.menuId},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteProductMenuById" parameterType="java.lang.Long">
|
||||
delete from product_menu where product_id = #{values}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,254 @@
|
||||
<?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.linke.product.domain.product.repository.mapper.SysProductMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.product.repository.po.SysProductPo" id="SysProductResult">
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productShowName" column="product_show_name" />
|
||||
<result property="productNum" column="product_num" />
|
||||
<result property="productRemark" column="product_remark" />
|
||||
<result property="modulesNames" column="modules_names" />
|
||||
<result property="modulesIds" column="modules_ids" />
|
||||
<result property="productIcon" column="product_icon" />
|
||||
<result property="productSort" column="product_sort" />
|
||||
<result property="productStatus" column="product_status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="productHomeRoute" column="product_home_route" />
|
||||
<result property="productHomeName" column="product_home_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysProductVo">
|
||||
SELECT
|
||||
p.product_id,
|
||||
p.product_name,
|
||||
p.product_show_name,
|
||||
m.modules_names,
|
||||
m.modules_ids,
|
||||
p.product_icon,
|
||||
p.product_sort,
|
||||
p.product_status,
|
||||
p.product_num,
|
||||
p.product_remark,
|
||||
p.create_time,
|
||||
p.create_by,
|
||||
p.update_time,
|
||||
p.update_by,
|
||||
p.del_flag,
|
||||
p.product_home_route,
|
||||
p.product_home_name,
|
||||
p.route_status,
|
||||
ma.app_modules_names,
|
||||
ma.app_modules_ids,
|
||||
p.product_photo
|
||||
FROM
|
||||
sys_product p
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
p.product_id,
|
||||
GROUP_CONCAT(m.modules_name) as modules_names,
|
||||
GROUP_CONCAT(m.modules_id) as modules_ids
|
||||
FROM
|
||||
sys_product p
|
||||
LEFT JOIN
|
||||
sys_product_details d
|
||||
ON p.product_id = d.product_id
|
||||
LEFT JOIN
|
||||
sys_modules m
|
||||
ON d.modules_id = m.modules_id
|
||||
GROUP BY
|
||||
p.product_id) m
|
||||
ON m.product_id = p.product_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
p.product_id AS app_product_id,
|
||||
GROUP_CONCAT( m.modules_name ) AS app_modules_names,
|
||||
GROUP_CONCAT( m.modules_id ) AS app_modules_ids
|
||||
FROM
|
||||
sys_product p
|
||||
LEFT JOIN sys_product_details d ON p.product_id = d.product_id
|
||||
LEFT JOIN sys_modules m ON d.modules_id = m.modules_id AND m.modules_client = 2
|
||||
GROUP BY
|
||||
p.product_id
|
||||
) ma ON ma.app_product_id = p.product_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysProductList" parameterType="com.linke.product.domain.product.repository.po.SysProductPo" resultMap="SysProductResult">
|
||||
<include refid="selectSysProductVo"/>
|
||||
<where>
|
||||
p.del_flag = 1
|
||||
<if test="modulesNames != null and modulesNames != ''"> and m.modules_names like concat('%', #{modulesNames}, '%')</if>
|
||||
<if test="tenantsId != null">
|
||||
and p.product_id in (select product_id from tenants_product where tenants_id = #{tenantsId})
|
||||
</if>
|
||||
<if test="productName != null and productName != ''"> and p.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="productShowName != null and productShowName != ''"> and p.product_show_name like concat('%', #{productShowName}, '%')</if>
|
||||
<if test="isStatus == '1'.toString() and isStatus != null and isStatus != ''">
|
||||
and p.product_status = 1
|
||||
</if>
|
||||
<if test="appModulesNames != null and appModulesNames != ''"> and ma.app_modules_names like concat('%', #{appModulesNames}, '%')</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
p.product_sort
|
||||
</select>
|
||||
|
||||
<select id="selectSysProductByProductId" parameterType="java.lang.Long" resultMap="SysProductResult">
|
||||
<include refid="selectSysProductVo"/>
|
||||
where p.product_id = #{productId} and p.del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="selectProductByModulesId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
DISTINCT p.product_id
|
||||
FROM
|
||||
sys_product p
|
||||
LEFT JOIN
|
||||
sys_product_details d
|
||||
ON p.product_id = d.product_id
|
||||
LEFT JOIN
|
||||
sys_modules m
|
||||
ON d.modules_id = m.modules_id
|
||||
WHERE
|
||||
p.del_flag = 1
|
||||
and p.product_status = 1
|
||||
and m.modules_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectModulesByProductId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
DISTINCT m.menu_id
|
||||
FROM
|
||||
`sys_product` p
|
||||
LEFT JOIN
|
||||
sys_product_details d
|
||||
ON p.product_id = d.product_id
|
||||
LEFT JOIN
|
||||
sys_menu m
|
||||
ON m.modules_id = d.modules_id
|
||||
WHERE
|
||||
p.del_flag = 1
|
||||
and p.product_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertSysProduct" parameterType="com.linke.product.domain.product.entity.SysProduct" >
|
||||
insert into sys_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="productShowName != null">product_show_name,</if>
|
||||
<if test="productIcon != null">product_icon,</if>
|
||||
<if test="productSort != null">product_sort,</if>
|
||||
<if test="productStatus != null">product_status,</if>
|
||||
<if test="productNum != null">product_num,</if>
|
||||
<if test="productRemark != null">product_remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="productShowName != null">#{productShowName},</if>
|
||||
<if test="productIcon != null">#{productIcon},</if>
|
||||
<if test="productSort != null">#{productSort},</if>
|
||||
<if test="productStatus != null">#{productStatus},</if>
|
||||
<if test="productNum != null">#{productNum},</if>
|
||||
<if test="productRemark != null">#{productRemark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysProduct" parameterType="com.linke.product.domain.product.entity.SysProduct">
|
||||
update sys_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="productShowName != null">product_show_name = #{productShowName},</if>
|
||||
<if test="productIcon != null">product_icon = #{productIcon},</if>
|
||||
<if test="productSort != null">product_sort = #{productSort},</if>
|
||||
<if test="productStatus != null">product_status = #{productStatus},</if>
|
||||
<if test="productNum != null">product_num = #{productNum},</if>
|
||||
<if test="productRemark != null">product_remark = #{productRemark},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where product_id = #{productId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysProductByProductId" parameterType="java.lang.Long">
|
||||
delete from sys_product where product_id = #{productId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysProductByProductIds" parameterType="java.lang.Long">
|
||||
delete from sys_product where product_id in
|
||||
<foreach item="productId" collection="array" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectProductListByTopOrganizationId" parameterType="com.linke.product.domain.product.repository.po.SysProductPo" resultMap="SysProductResult">
|
||||
SELECT
|
||||
p.product_id,
|
||||
p.product_name,
|
||||
p.product_show_name,
|
||||
p.product_icon,
|
||||
p.product_sort,
|
||||
p.product_status,
|
||||
p.product_num,
|
||||
p.product_remark,
|
||||
p.create_time,
|
||||
p.create_by,
|
||||
p.update_time,
|
||||
p.update_by,
|
||||
p.del_flag,
|
||||
p.product_home_route,
|
||||
p.product_home_name,
|
||||
p.route_status
|
||||
FROM
|
||||
`sys_product` p
|
||||
LEFT JOIN tenants_product tp ON tp.product_id = p.product_id
|
||||
LEFT JOIN sys_organization o ON o.tenants_id = tp.tenants_id
|
||||
WHERE
|
||||
p.del_flag = 0
|
||||
AND o.organization_id = #{topOrganizationId}
|
||||
</select>
|
||||
<select id="getProductIdList" resultType="java.lang.Long">
|
||||
SELECT
|
||||
a.product_id
|
||||
FROM
|
||||
`sys_product` a
|
||||
LEFT JOIN sys_product_details b ON a.product_id = b.product_id
|
||||
AND b.del_flag = 1
|
||||
LEFT JOIN sys_menu c ON b.modules_id = c.modules_id
|
||||
AND c.del_flag = 1
|
||||
LEFT JOIN tenants_product d ON d.product_id = a.product_id
|
||||
AND d.del_flag = 1
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
AND c.menu_id IN
|
||||
<foreach collection="menuIdList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND d.tenants_id = #{tenantsId}
|
||||
GROUP BY
|
||||
a.product_id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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.linke.product.domain.projectManagement.repository.mapper.ProjectManagementMapper">
|
||||
|
||||
<resultMap type="com.mhd.common.core.domain.po.projectManagement.ProjectManagementPO" id="ProjectManagementResult">
|
||||
<result property="projectManagementId" column="project_management_id" />
|
||||
<result property="projectManagementName" column="project_management_name" />
|
||||
<result property="affiliateCompanyName" column="affiliate_company_name" />
|
||||
<result property="affiliateAccount" column="affiliate_account" />
|
||||
<result property="productStatus" column="product_status" />
|
||||
<result property="affiliateCompanyStatus" column="affiliate_company_status" />
|
||||
<result property="projectManagementRemark" column="project_management_remark" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectProjectManagementPo">
|
||||
select * from project_management
|
||||
</sql>
|
||||
|
||||
<sql id="selectProjectManagementPo1">
|
||||
<where>
|
||||
<if test="projectManagementName != null and projectManagementName != ''">
|
||||
and project_management_name like concat('%', #{projectManagementName}, '%')
|
||||
</if>
|
||||
<if test="affiliateCompanyName != null and affiliateCompanyName != ''">
|
||||
and affiliate_company_name like concat('%', #{affiliateCompanyName}, '%')
|
||||
</if>
|
||||
<if test="affiliateAccount != null and affiliateAccount != ''">
|
||||
and affiliate_account = #{affiliateAccount}
|
||||
</if>
|
||||
<if test="productStatus != null ">
|
||||
and product_status = #{productStatus}
|
||||
</if>
|
||||
<if test="projectManagementRemark != null and projectManagementRemark != ''">
|
||||
and project_management_remark = #{projectManagementRemark}
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<if test="projectManagementIdList != null">
|
||||
AND project_management_id in
|
||||
<foreach item="id" collection="projectManagementIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.projectManagement.repository.todo.ProjectManagementDO" resultMap="ProjectManagementResult">
|
||||
<include refid="selectProjectManagementPo"/>
|
||||
<include refid="selectProjectManagementPo1"/>
|
||||
</select>
|
||||
<select id="selectBindOrganization"
|
||||
resultType="com.mhd.common.core.domain.po.projectManagement.ProjectOrganizationPO">
|
||||
|
||||
</select>
|
||||
<select id="getAllProject"
|
||||
resultType="com.mhd.common.core.domain.po.projectManagement.ProjectManagementPO">
|
||||
SELECT
|
||||
a.*
|
||||
FROM
|
||||
project_management a
|
||||
LEFT JOIN project_organization b ON a.project_management_id = b.project_management_id
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
AND a.product_status = 1
|
||||
AND b.organization_id = #{organizationId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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.linke.product.domain.projectManagement.repository.mapper.ProjectOrganizationMapper">
|
||||
|
||||
<resultMap type="com.mhd.common.core.domain.po.projectManagement.ProjectOrganizationPO" id="ProjectOrganizationResult">
|
||||
<result property="projectOrganizationId" column="project_organization_id" />
|
||||
<result property="projectManagementId" column="project_management_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createByName" column="create_by_name" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectProjectOrganizationPo">
|
||||
select project_organization_id, project_management_id, organization_id, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag from project_organization
|
||||
</sql>
|
||||
|
||||
<sql id="selectProjectOrganizationPo1">
|
||||
<where>
|
||||
<if test="projectManagementId != null ">
|
||||
and project_management_id = #{projectManagementId}
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.projectManagement.repository.todo.ProjectOrganizationDO" resultMap="ProjectOrganizationResult">
|
||||
<include refid="selectProjectOrganizationPo"/>
|
||||
<include refid="selectProjectOrganizationPo1"/>
|
||||
</select>
|
||||
</mapper>
|
||||
+49
@@ -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="com.linke.product.domain.sysInformationPlatform.repository.mapper.SysInformationPlatformMapper">
|
||||
|
||||
|
||||
|
||||
<sql id="common_where">
|
||||
<if test="sysInformationPlatformDo.interfaceTabs != null and sysInformationPlatformDo.interfaceTabs != ''">
|
||||
and interface_tabs = #{sysInformationPlatformDo.interfaceTabs}
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.interfaceTabsKey != null and sysInformationPlatformDo.interfaceTabsKey != ''">
|
||||
and interface_tabs_key = #{sysInformationPlatformDo.interfaceTabsKey}
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.interfaceTabsValue != null and sysInformationPlatformDo.interfaceTabsValue != ''">
|
||||
and interface_tabs_value = #{sysInformationPlatformDo.interfaceTabsValue}
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.interfaceTabsName != null and sysInformationPlatformDo.interfaceTabsName != ''">
|
||||
and interface_tabs_name like concat('%', #{sysInformationPlatformDo.interfaceTabsName}, '%')
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.updateCount != null ">
|
||||
and update_count = #{sysInformationPlatformDo.updateCount}
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.createByName != null and sysInformationPlatformDo.createByName != ''">
|
||||
and create_by_name like concat('%', #{sysInformationPlatformDo.createByName}, '%')
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.updateByName != null and sysInformationPlatformDo.updateByName != ''">
|
||||
and update_by_name like concat('%', #{sysInformationPlatformDo.updateByName}, '%')
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.tenantsId != null ">
|
||||
and tenants_id = #{sysInformationPlatformDo.tenantsId}
|
||||
</if>
|
||||
<if test="sysInformationPlatformDo.tenantsName != null and sysInformationPlatformDo.tenantsName != ''">
|
||||
and tenants_name like concat('%', #{sysInformationPlatformDo.tenantsName}, '%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.linke.product.domain.sysInformationPlatform.entity.SysInformationPlatform"
|
||||
resultType="com.linke.product.domain.sysInformationPlatform.repository.po.SysInformationPlatformPo">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sys_information_platform
|
||||
WHERE
|
||||
del_flag = 1
|
||||
<include refid="common_where"/>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,199 @@
|
||||
<?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.linke.product.domain.tenants.repository.mapper.SysTenantsMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.tenants.repository.po.SysTenantsPo" id="SysTenantsResult">
|
||||
<result property="tenantsId" column="tenants_id" />
|
||||
<result property="tenantsName" column="tenants_name" />
|
||||
<result property="tenantsSimpleName" column="tenants_simple_name" />
|
||||
<result property="tenantsDomainName" column="tenants_domain_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="userAccount" column="user_account" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="tenantsBalance" column="tenants_balance" />
|
||||
<result property="tenantsDueDate" column="tenants_due_date" />
|
||||
<result property="tenantsStatus" column="tenants_status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="logoUrl" column="logo_url" />
|
||||
<result property="logoUrlPc" column="logo_url_pc" />
|
||||
<result property="hotline" column="hotline" />
|
||||
<result property="themeColors" column="theme_colors" />
|
||||
<result property="themeImage" column="theme_image" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysTenantsVo">
|
||||
SELECT
|
||||
t.tenants_id,
|
||||
t.tenants_name,
|
||||
t.tenants_simple_name,
|
||||
t.tenants_domain_name,
|
||||
t.remark,
|
||||
o.organization_id,
|
||||
o.principal_id,
|
||||
o.principal_name,
|
||||
o.principal_account,
|
||||
p.product_name,
|
||||
t.tenants_balance,
|
||||
t.tenants_due_date,
|
||||
t.tenants_status,
|
||||
t.create_time,
|
||||
t.create_by,
|
||||
t.update_time,
|
||||
t.update_by,
|
||||
t.platefrom_type,
|
||||
t.user_account,
|
||||
t.logo_url,
|
||||
t.logo_url_pc,
|
||||
t.user_id,
|
||||
t.hotline,
|
||||
t.theme_colors,
|
||||
t.theme_image,
|
||||
t.del_flag
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN
|
||||
`sys_organization` o
|
||||
ON t.tenants_id = o.tenants_id AND o.parent_organization_id = 0
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
t.tenants_id,
|
||||
GROUP_CONCAT(p.product_name) as product_name
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN
|
||||
tenants_product pt
|
||||
ON pt.tenants_id = t.tenants_id
|
||||
LEFT JOIN
|
||||
sys_product p
|
||||
ON p.product_id = pt.product_id
|
||||
GROUP BY
|
||||
t.tenants_id) p
|
||||
ON p.tenants_id = t.tenants_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysTenantsList" parameterType="com.linke.product.domain.tenants.repository.po.SysTenantsPo" resultMap="SysTenantsResult">
|
||||
<include refid="selectSysTenantsVo"/>
|
||||
<where>
|
||||
t.del_flag = 1
|
||||
<if test="tenantsName != null and tenantsName != ''"> and (t.tenants_name like concat('%', #{tenantsName}, '%') OR t.tenants_simple_name like concat('%', #{tenantsName}, '%'))</if>
|
||||
<if test="productName != null and productName != ''"> and p.product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="tenantsDomainName != null and tenantsDomainName != ''"> and t.tenants_domain_name = #{tenantsDomainName}</if>
|
||||
</where>
|
||||
GROUP BY t.tenants_id
|
||||
</select>
|
||||
|
||||
<select id="selectSysTenantsByTenantsId" parameterType="java.lang.Long" resultMap="SysTenantsResult">
|
||||
<include refid="selectSysTenantsVo"/>
|
||||
where t.tenants_id = #{tenantsId} and t.del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="selectProductListByTenantsId" parameterType="java.lang.Long" resultType="java.lang.Long">
|
||||
SELECT
|
||||
p.product_id
|
||||
FROM
|
||||
`sys_tenants` t
|
||||
LEFT JOIN
|
||||
sys_organization o
|
||||
ON t.tenants_id = o.tenants_id
|
||||
LEFT JOIN
|
||||
tenants_product p
|
||||
ON p.tenants_id = t.tenants_id
|
||||
LEFT JOIN
|
||||
sys_product po
|
||||
ON po.product_id = p.product_id
|
||||
WHERE
|
||||
o.organization_id = #{values} and t.del_flag = 1 and po.product_status = 1
|
||||
</select>
|
||||
<select id="selectByDomainName" resultType="com.linke.product.domain.tenants.entity.SysTenants">
|
||||
SELECT * FROM `sys_tenants`
|
||||
where del_flag = 1
|
||||
and tenants_domain_name = #{tenantsDomainName}
|
||||
<if test="tenantsId != null and tenantsId != ''">
|
||||
and tenants_id != #{tenantsId}
|
||||
</if>
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="getTenantsByDomainName" resultType="com.linke.product.domain.tenants.repository.po.SysTenantsPo">
|
||||
SELECT
|
||||
b.*,
|
||||
c.organization_id
|
||||
FROM
|
||||
`tenants_domain_name` a
|
||||
LEFT JOIN sys_tenants b ON a.tenants_id = b.tenants_id
|
||||
LEFT JOIN sys_organization c ON b.tenants_id = c.tenants_id and c.organization_state =1
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
AND a.domain_name = #{tenantsDomainName}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getTenantsByOrgan" resultType="com.linke.product.domain.tenants.repository.po.SysTenantsPo" parameterType="java.lang.Long">
|
||||
SELECT
|
||||
st.*,
|
||||
ss.organization_id as topOrganizationId,
|
||||
ss.organization_name as topOrganizationName,
|
||||
so.organization_name
|
||||
FROM
|
||||
sys_organization so
|
||||
LEFT JOIN sys_tenants st ON so.tenants_id = st.tenants_id AND st.del_flag = 1
|
||||
LEFT JOIN sys_organization ss on st.tenants_id = ss.tenants_id AND ss.organization_state = 1 AND ss.del_flag = 1
|
||||
WHERE
|
||||
so.del_flag = 1
|
||||
AND so.organization_id = #{organizationId}
|
||||
</select>
|
||||
|
||||
<select id="getTenantsInfoByOpen" resultType="com.linke.product.domain.tenants.repository.po.SysTenantsPo" parameterType="java.lang.Long">
|
||||
SELECT so.organization_id,
|
||||
so.organization_name,
|
||||
ss.principal_id,
|
||||
ss.principal_name,
|
||||
ss.organization_id as topOrganizationId,
|
||||
ss.organization_name as topOrganizationName
|
||||
FROM sys_organization so
|
||||
LEFT JOIN sys_tenants st ON so.tenants_id = st.tenants_id AND st.del_flag = 1
|
||||
LEFT JOIN sys_organization ss
|
||||
on st.tenants_id = ss.tenants_id AND ss.organization_state = 1 AND ss.del_flag = 1
|
||||
WHERE so.del_flag = 1
|
||||
AND so.organization_id = #{organizationId}
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateSysTenants" parameterType="com.linke.product.domain.tenants.entity.SysTenants">
|
||||
update sys_tenants
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantsName != null">tenants_name = #{tenantsName},</if>
|
||||
<if test="tenantsSimpleName != null">tenants_simple_name = #{tenantsSimpleName},</if>
|
||||
<if test="tenantsDomainName != null">tenants_domain_name = #{tenantsDomainName},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="tenantsBalance != null">tenants_balance = #{tenantsBalance},</if>
|
||||
<if test="tenantsDueDate != null">tenants_due_date = #{tenantsDueDate},</if>
|
||||
<if test="tenantsStatus != null">tenants_status = #{tenantsStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where tenants_id = #{tenantsId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysTenantsByTenantsId" parameterType="java.lang.Long">
|
||||
UPDATE `sys_tenants` SET `del_flag` = 2 WHERE `tenants_id` = #{tenantsId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysTenantsByTenantsIds" parameterType="java.lang.String">
|
||||
delete from sys_tenants where tenants_id in
|
||||
<foreach item="tenantsId" collection="array" open="(" separator="," close=")">
|
||||
#{tenantsId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?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.linke.product.domain.tenants.repository.mapper.TenantsDomainNameMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.linke.product.domain.tenants.repository.po.TenantsDomainNamePo" >
|
||||
<result column="tenants_domain_name_id" property="tenantsDomainNameId" />
|
||||
<result column="domain_name" property="domainName" />
|
||||
<result column="tenants_id" property="tenantsId" />
|
||||
<result column="show_flag" property="showFlag" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_by_name" property="createByName" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_by_name" property="updateByName" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
tenants_domain_name_id,
|
||||
domain_name,
|
||||
tenants_id,
|
||||
show_flag,
|
||||
remark,
|
||||
create_time,
|
||||
create_by,
|
||||
create_by_name,
|
||||
update_time,
|
||||
update_by,
|
||||
update_by_name,
|
||||
del_flag
|
||||
</sql>
|
||||
<select id="checkUniqueness" parameterType = "com.linke.product.domain.tenants.repository.po.TenantsDomainNamePo" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List" />
|
||||
FROM tenants_domain_name
|
||||
where del_flag = 1
|
||||
<if test="tenantsId != null">
|
||||
and (( tenants_id = #{tenantsId}
|
||||
and show_flag != 2)
|
||||
or tenants_id != #{tenantsId})
|
||||
</if>
|
||||
and domain_name = #{domainName}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="pageList" resultMap="BaseResultMap" parameterType = "com.linke.product.domain.tenants.repository.po.TenantsDomainNamePo">
|
||||
SELECT <include refid="Base_Column_List" />
|
||||
FROM tenants_domain_name
|
||||
where del_flag = 1
|
||||
<if test="tenantsId != null">
|
||||
and tenants_id = #{tenantsId}
|
||||
</if>
|
||||
<if test="showFlag != null">
|
||||
and show_flag = #{showFlag}
|
||||
</if>
|
||||
<if test="domainName != null and domainName != ''">
|
||||
and domain_name = #{showFlag}
|
||||
</if>
|
||||
order by show_flag desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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.linke.product.domain.tenants.repository.mapper.TenantsMenuMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.tenants.entity.TenantsMenu" id="TenantsMenuResult">
|
||||
<id property="tenantsMenuId" column="tenants_menu_id" />
|
||||
<result property="tenantsId" column="tenants_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTenantsMenuVo">
|
||||
SELECT
|
||||
tenants_menu_id,
|
||||
menu_id,
|
||||
tenants_id,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`tenants_menu`
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByTenantsId" parameterType="java.lang.Long" resultMap="TenantsMenuResult">
|
||||
<include refid="selectTenantsMenuVo"/>
|
||||
where tenants_id = #{value} and del_flag = 1
|
||||
</select>
|
||||
|
||||
<insert id="batchAddTenantsMenu" parameterType="java.util.List">
|
||||
insert into tenants_menu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
menu_id,
|
||||
tenants_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{item.menuId},
|
||||
#{item.tenantsId},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteTenantsMenuById" parameterType="java.lang.Long">
|
||||
delete from tenants_menu where tenants_id = #{values}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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.linke.product.domain.tenants.repository.mapper.TenantsProductMapper">
|
||||
|
||||
<resultMap type="com.linke.product.domain.tenants.entity.TenantsProduct" id="TenantsProductResult">
|
||||
<id property="tenantsProductId" column="tenants_product_id" />
|
||||
<result property="tenantsId" column="tenants_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productIcon" column="product_icon" />
|
||||
<result property="productPhoto" column="product_photo" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTenantsProductVo">
|
||||
SELECT
|
||||
p.tenants_product_id,
|
||||
p.product_id,
|
||||
p.tenants_id,
|
||||
p.create_time,
|
||||
p.create_by,
|
||||
p.update_time,
|
||||
p.update_by,
|
||||
p.del_flag,
|
||||
p.product_name,
|
||||
p.product_icon,
|
||||
p.product_photo
|
||||
FROM
|
||||
`tenants_product` p
|
||||
LEFT JOIN
|
||||
sys_product po
|
||||
ON po.product_id = p.product_id
|
||||
</sql>
|
||||
|
||||
<select id="selectProductListByTenantsId" parameterType="java.lang.Long" resultMap="TenantsProductResult">
|
||||
<include refid="selectTenantsProductVo"/>
|
||||
where p.tenants_id = #{value} and p.del_flag = 1 and po.product_status = 1
|
||||
</select>
|
||||
|
||||
<insert id="batchAddTenantsProduct" parameterType="java.util.List">
|
||||
insert into tenants_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
product_id,
|
||||
tenants_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
product_name,
|
||||
product_icon,
|
||||
product_photo
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{item.productId},
|
||||
#{item.tenantsId},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
#{item.productName},
|
||||
#{item.productIcon},
|
||||
#{item.productPhoto},
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteTenantsProductById" parameterType="java.lang.Long">
|
||||
delete from tenants_product where tenants_id = #{values}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user