达梦适配修改
This commit is contained in:
+6
-1
@@ -74,9 +74,14 @@
|
||||
<artifactId>mhd-common-redis</artifactId>
|
||||
</dependency>
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<!--<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
<version>8.1.1.193</version>
|
||||
</dependency>
|
||||
<!--添加druid连接池 依赖 -->
|
||||
<dependency>
|
||||
|
||||
@@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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
|
||||
left join sys_menu me ON me.menu_id = a.menu_id
|
||||
where
|
||||
a.del_Flag = 1
|
||||
and me.del_Flag = 1
|
||||
@@ -91,8 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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
|
||||
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
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
me.menu_show,
|
||||
me.menu_perms
|
||||
from app_user_menu_settings a
|
||||
left join `sys_menu` me ON me.menu_id = a.menu_id
|
||||
left join sys_menu me ON me.menu_id = a.menu_id
|
||||
where
|
||||
a.del_flag = 1
|
||||
and me.del_flag = 1
|
||||
|
||||
@@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`custom_auth_organization`
|
||||
custom_auth_organization
|
||||
</sql>
|
||||
|
||||
<select id="selectCustomAuthByOrganization" parameterType="com.linke.product.domain.customAuth.entity.CustomAuthOrganization" resultMap="CustomAuthOrganizationResult">
|
||||
|
||||
@@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
me.top_organization_id,
|
||||
me.home_show_flag
|
||||
FROM
|
||||
`sys_menu` me
|
||||
sys_menu me
|
||||
LEFT JOIN
|
||||
sys_modules mo
|
||||
ON me.modules_id = mo.modules_id
|
||||
@@ -168,7 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
me.menu_remark,
|
||||
me.menu_perms
|
||||
FROM
|
||||
`sys_menu` me
|
||||
sys_menu me
|
||||
LEFT JOIN
|
||||
sys_modules mo
|
||||
ON me.modules_id = mo.modules_id
|
||||
@@ -231,7 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN
|
||||
`tenants_menu` tm
|
||||
tenants_menu tm
|
||||
ON t.tenants_id = tm.tenants_id
|
||||
INNER JOIN
|
||||
sys_menu m
|
||||
@@ -258,7 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
om.organization_id,
|
||||
m.modules_id
|
||||
FROM
|
||||
`organization_menu` om
|
||||
organization_menu om
|
||||
LEFT JOIN
|
||||
sys_menu m
|
||||
ON om.menu_id = m.menu_id
|
||||
@@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
menu_component AS menuComponent,
|
||||
menu_redirect_path AS menuRedirectPath
|
||||
FROM
|
||||
`sys_menu`
|
||||
sys_menu
|
||||
where
|
||||
del_flag = 1
|
||||
and menu_show = 1
|
||||
@@ -303,7 +303,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
DISTINCT modules_id
|
||||
FROM
|
||||
`sys_menu`
|
||||
sys_menu
|
||||
WHERE
|
||||
del_flag = 1
|
||||
AND menu_id in
|
||||
@@ -317,9 +317,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
m.menu_id
|
||||
FROM
|
||||
`sys_menu` m
|
||||
sys_menu m
|
||||
LEFT JOIN
|
||||
`sys_menu` mp
|
||||
sys_menu mp
|
||||
ON m.parent_menu_id = mp.menu_id
|
||||
LEFT JOIN
|
||||
sys_modules mo
|
||||
@@ -341,7 +341,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
menu_id
|
||||
FROM
|
||||
`sys_menu`
|
||||
sys_menu
|
||||
WHERE
|
||||
del_flag = 1
|
||||
and menu_show = 1
|
||||
@@ -352,7 +352,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
DISTINCT parent_menu_id
|
||||
FROM
|
||||
`sys_menu`
|
||||
sys_menu
|
||||
WHERE
|
||||
parent_menu_id != 0
|
||||
AND menu_id in
|
||||
|
||||
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`modules_menu`
|
||||
modules_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByModulesId" parameterType="java.lang.Long" resultMap="ModulesMenuResult">
|
||||
|
||||
@@ -96,9 +96,9 @@
|
||||
o1.interbank_number,
|
||||
o1.template_seal
|
||||
FROM
|
||||
`sys_organization` o1
|
||||
sys_organization o1
|
||||
LEFT JOIN
|
||||
`sys_organization` o2
|
||||
sys_organization o2
|
||||
ON o1.parent_organization_id = o2.organization_id
|
||||
</sql>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
</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} )
|
||||
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>
|
||||
@@ -134,7 +134,7 @@
|
||||
SELECT
|
||||
organization_id
|
||||
FROM
|
||||
`sys_organization`
|
||||
sys_organization
|
||||
where tenants_id = #{value} and del_flag = 1
|
||||
and organization_state = 1
|
||||
</select>
|
||||
@@ -148,9 +148,9 @@
|
||||
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
|
||||
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}
|
||||
@@ -216,7 +216,7 @@
|
||||
SELECT
|
||||
organization_id
|
||||
FROM
|
||||
`sys_organization`
|
||||
sys_organization
|
||||
where
|
||||
del_flag = 1
|
||||
</select>
|
||||
@@ -225,7 +225,7 @@
|
||||
SELECT
|
||||
organization_id
|
||||
FROM
|
||||
`sys_organization`
|
||||
sys_organization
|
||||
where
|
||||
del_flag = 1
|
||||
AND parent_organization_id in
|
||||
@@ -234,19 +234,29 @@
|
||||
</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 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 organization_id
|
||||
FROM sys_organization
|
||||
WHERE organization_id = #{id}
|
||||
UNION
|
||||
SELECT organization_id
|
||||
FROM sys_organization
|
||||
START WITH organization_id = #{id}
|
||||
CONNECT BY PRIOR organization_id = parent_organization_id
|
||||
ORDER BY organization_id;
|
||||
</select>
|
||||
|
||||
<select id="selectAllOrganizationById" resultType="java.lang.Long" parameterType="java.lang.Long">
|
||||
@@ -255,6 +265,11 @@
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
t1.organization_id,
|
||||
t1.organization_name,
|
||||
t1.parent_organization_id,
|
||||
|
||||
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`organization_menu`
|
||||
organization_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByOrganizationId" parameterType="java.lang.Long" resultMap="OrganizationMenuResult">
|
||||
|
||||
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
spd.update_by,
|
||||
spd.del_flag
|
||||
FROM
|
||||
`sys_product_details` spd
|
||||
sys_product_details spd
|
||||
LEFT JOIN sys_modules sm ON spd.modules_id = sm.modules_id
|
||||
AND sm.del_flag = 1
|
||||
</sql>
|
||||
|
||||
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`product_menu`
|
||||
product_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByProductId" parameterType="java.lang.Long" resultMap="ProductMenuResult">
|
||||
|
||||
@@ -52,8 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
p.product_id,
|
||||
GROUP_CONCAT(m.modules_name) as modules_names,
|
||||
GROUP_CONCAT(m.modules_id) as modules_ids
|
||||
WM_CONCAT(m.modules_name) as modules_names,
|
||||
WM_CONCAT(m.modules_id) as modules_ids
|
||||
FROM
|
||||
sys_product p
|
||||
LEFT JOIN
|
||||
@@ -68,8 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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
|
||||
WM_CONCAT( m.modules_name ) AS app_modules_names,
|
||||
WM_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
|
||||
@@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
DISTINCT m.menu_id
|
||||
FROM
|
||||
`sys_product` p
|
||||
sys_product p
|
||||
LEFT JOIN
|
||||
sys_product_details d
|
||||
ON p.product_id = d.product_id
|
||||
@@ -223,7 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.product_home_name,
|
||||
p.route_status
|
||||
FROM
|
||||
`sys_product` p
|
||||
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
|
||||
@@ -234,7 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
a.product_id
|
||||
FROM
|
||||
`sys_product` a
|
||||
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
|
||||
|
||||
@@ -60,12 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN
|
||||
`sys_organization` o
|
||||
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
|
||||
WM_CONCAT(p.product_name) as product_name
|
||||
FROM
|
||||
sys_tenants t
|
||||
LEFT JOIN
|
||||
@@ -99,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
p.product_id
|
||||
FROM
|
||||
`sys_tenants` t
|
||||
sys_tenants t
|
||||
LEFT JOIN
|
||||
sys_organization o
|
||||
ON t.tenants_id = o.tenants_id
|
||||
@@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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`
|
||||
SELECT * FROM sys_tenants
|
||||
where del_flag = 1
|
||||
and tenants_domain_name = #{tenantsDomainName}
|
||||
<if test="tenantsId != null and tenantsId != ''">
|
||||
@@ -126,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
b.*,
|
||||
c.organization_id
|
||||
FROM
|
||||
`tenants_domain_name` a
|
||||
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
|
||||
@@ -187,7 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysTenantsByTenantsId" parameterType="java.lang.Long">
|
||||
UPDATE `sys_tenants` SET `del_flag` = 2 WHERE `tenants_id` = #{tenantsId}
|
||||
UPDATE sys_tenants SET del_flag = 2 WHERE tenants_id = #{tenantsId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysTenantsByTenantsIds" parameterType="java.lang.String">
|
||||
|
||||
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update_by,
|
||||
del_flag
|
||||
FROM
|
||||
`tenants_menu`
|
||||
tenants_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuListByTenantsId" parameterType="java.lang.Long" resultMap="TenantsMenuResult">
|
||||
|
||||
@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.product_icon,
|
||||
p.product_photo
|
||||
FROM
|
||||
`tenants_product` p
|
||||
tenants_product p
|
||||
LEFT JOIN
|
||||
sys_product po
|
||||
ON po.product_id = p.product_id
|
||||
|
||||
Reference in New Issue
Block a user