Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gf_back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianchao
gf_back
Commits
d52bb949
Commit
d52bb949
authored
Nov 22, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得到的
parent
0289239f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
18 deletions
+73
-18
C02-system/pps-core-system/src/main/resources/mybatis/mapper/pps/core/system/SysOrganizationViewMapper.xml
...atis/mapper/pps/core/system/SysOrganizationViewMapper.xml
+73
-18
No files found.
C02-system/pps-core-system/src/main/resources/mybatis/mapper/pps/core/system/SysOrganizationViewMapper.xml
View file @
d52bb949
...
@@ -37,6 +37,15 @@
...
@@ -37,6 +37,15 @@
<result
column=
"ELEVATION"
property=
"elevation"
/>
<result
column=
"ELEVATION"
property=
"elevation"
/>
</resultMap>
</resultMap>
<sql
id=
"now"
databaseId=
"Oracle"
>
SYSDATE
</sql>
<sql
id=
"now"
databaseId=
"MySQL"
>
NOW()
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
ID
ID
,
,
...
@@ -84,7 +93,7 @@
...
@@ -84,7 +93,7 @@
</select>
</select>
<select
id=
"selectSysOrganizationList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
<select
id=
"selectSysOrganizationList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
resultMap=
"BaseResultMap"
>
resultMap=
"BaseResultMap"
databaseId=
"Oracle"
>
SELECT
SELECT
OU.ID,
OU.ID,
OU.OU_CODE,
OU.OU_CODE,
...
@@ -110,7 +119,52 @@
...
@@ -110,7 +119,52 @@
SYS_ORGANIZATION_REL SOR
SYS_ORGANIZATION_REL SOR
LEFT JOIN SYS_ORGANIZATION OU ON OU.ID = SOR.OU_ID
LEFT JOIN SYS_ORGANIZATION OU ON OU.ID = SOR.OU_ID
<where>
<where>
SOR.END_TIME >= NOW()
SOR.END_TIME >= SYSDATE
AND OU.IS_DELETED = #{isDeleted}
<if
test=
"id != null and id != ''"
>
AND SOR.PARENT_OU_ID = #{id}
</if>
<if
test=
"ouCode != null and ouCode != ''"
>
AND OU.OU_CODE LIKE '%' || #{ouCode} || '%'
</if>
<if
test=
"ouName != null and ouName != ''"
>
AND OU.OU_NAME LIKE '%' || #{ouName} || '%'
</if>
<if
test=
"shortName != null and shortName != ''"
>
AND OU.SHORT_NAME LIKE '%' || #{shortName} || '%'
</if>
</where>
ORDER BY SOR.SORT ASC
</select>
<select
id=
"selectSysOrganizationList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
resultMap=
"BaseResultMap"
databaseId=
"MySQL"
>
SELECT
OU.ID,
OU.OU_CODE,
OU.OU_NAME,
OU.SHORT_NAME,
OU.OU_LEVEL,
OU.DESCRIPTION,
OU.POST_CODE,
OU.POST_ADDRESS,
OU.FAX_NO,
OU.PHONE,
OU.COUNTRY,
OU.PROVINCE,
SOR.ID AS SOR_ID,
SOR.SORT,
SOR.PARENT_OU_ID,
SOR.IS_HAS_CHILDREN,
OU.LONGITUDE,
OU.LATITUDE,
OU.ELEVATION,
( SELECT SO.OU_NAME FROM SYS_ORGANIZATION SO WHERE SOR.PARENT_OU_ID = SO.ID ) AS PARTENT_NAME
FROM
SYS_ORGANIZATION_REL SOR
LEFT JOIN SYS_ORGANIZATION OU ON OU.ID = SOR.OU_ID
<where>
SOR.END_TIME >=
<include
refid=
"now"
/>
AND OU.IS_DELETED = #{isDeleted}
AND OU.IS_DELETED = #{isDeleted}
<if
test=
"id != null and id != ''"
>
<if
test=
"id != null and id != ''"
>
AND SOR.PARENT_OU_ID = #{id}
AND SOR.PARENT_OU_ID = #{id}
...
@@ -172,7 +226,7 @@
...
@@ -172,7 +226,7 @@
'ou' AS TYPE
'ou' AS TYPE
FROM SYS_ORGANIZATION SO
FROM SYS_ORGANIZATION SO
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
WHERE SO.IS_DELETED = #{isDeleted} AND SOR.END_TIME >=
NOW()
WHERE SO.IS_DELETED = #{isDeleted} AND SOR.END_TIME >=
<include
refid=
"now"
/>
<if
test=
"parentOuId != null and parentOuId != ''"
>
<if
test=
"parentOuId != null and parentOuId != ''"
>
AND PARENT_OU_ID =#{parentOuId}
AND PARENT_OU_ID =#{parentOuId}
</if>
</if>
...
@@ -192,7 +246,7 @@
...
@@ -192,7 +246,7 @@
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
<where>
<where>
SO.IS_DELETED = #{isDeleted}
SO.IS_DELETED = #{isDeleted}
AND SOR.EFFECT_TIME
<
=
NOW() AND SOR.END_TIME
>
= NOW()
AND SOR.EFFECT_TIME
<
=
<include
refid=
"now"
/>
AND SOR.END_TIME
>
=
<include
refid=
"now"
/>
AND SOR.PARENT_OU_ID=#{id}
AND SOR.PARENT_OU_ID=#{id}
OR SO.ID=#{id}
OR SO.ID=#{id}
</where>
</where>
...
@@ -211,7 +265,7 @@
...
@@ -211,7 +265,7 @@
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
<where>
<where>
SO.IS_DELETED = #{isDeleted}
SO.IS_DELETED = #{isDeleted}
AND SOR.EFFECT_TIME
<
=
NOW() AND SOR.END_TIME
>
= NOW()
AND SOR.EFFECT_TIME
<
=
<include
refid=
"now"
/>
AND SOR.END_TIME
>
=
<include
refid=
"now"
/>
AND SOR.PARENT_OU_ID=#{id}
AND SOR.PARENT_OU_ID=#{id}
</where>
</where>
</select>
</select>
...
@@ -238,7 +292,7 @@
...
@@ -238,7 +292,7 @@
SELECT R.OU_ID AS ID,R.PARENT_OU_ID,S.OU_NAME,S.SHORT_NAME FROM SYS_ORGANIZATION_REL R
SELECT R.OU_ID AS ID,R.PARENT_OU_ID,S.OU_NAME,S.SHORT_NAME FROM SYS_ORGANIZATION_REL R
LEFT JOIN SYS_ORGANIZATION S ON R.OU_ID = S.ID
LEFT JOIN SYS_ORGANIZATION S ON R.OU_ID = S.ID
WHERE S.IS_DELETED = 1
WHERE S.IS_DELETED = 1
AND R.EFFECT_TIME
<
=
NOW() AND R.END_TIME
>
= NOW()
AND R.EFFECT_TIME
<
=
<include
refid=
"now"
/>
AND R.END_TIME
>
=
<include
refid=
"now"
/>
AND R.OU_ID IN
AND R.OU_ID IN
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
","
item=
"item"
>
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
#{item}
...
@@ -462,7 +516,7 @@
...
@@ -462,7 +516,7 @@
FROM SYS_ORGANIZATION SO
FROM SYS_ORGANIZATION SO
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.PARENT_OU_ID = SO.ID
LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.PARENT_OU_ID = SO.ID
<where>
<where>
SOR.END_TIME >=
NOW()
SOR.END_TIME >=
<include
refid=
"now"
/>
AND SOR.OU_ID IN
AND SOR.OU_ID IN
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
","
item=
"item"
>
<foreach
collection=
"list"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
#{item}
...
@@ -530,7 +584,7 @@
...
@@ -530,7 +584,7 @@
SYS_ORGANIZATION O
SYS_ORGANIZATION O
WHERE
WHERE
R.OU_ID = O.ID
R.OU_ID = O.ID
AND R.END_TIME >=
NOW()
AND R.END_TIME >=
<include
refid=
"now"
/>
AND O.IS_DELETED = 1
AND O.IS_DELETED = 1
<if
test=
"parentOuId != null and parentOuId != ''"
>
<if
test=
"parentOuId != null and parentOuId != ''"
>
AND R.PARENT_OU_ID = #{parentOuId}
AND R.PARENT_OU_ID = #{parentOuId}
...
@@ -597,7 +651,7 @@
...
@@ -597,7 +651,7 @@
FROM SYS_ORGANIZATION O
FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE R.PARENT_OU_ID = #{id}
WHERE R.PARENT_OU_ID = #{id}
AND R.END_TIME >=
NOW()
AND R.END_TIME >=
<include
refid=
"now"
/>
AND O.IS_DELETED = 1
AND O.IS_DELETED = 1
ORDER BY R.SORT)
ORDER BY R.SORT)
UNION ALL
UNION ALL
...
@@ -634,7 +688,7 @@
...
@@ -634,7 +688,7 @@
FROM SYS_ORGANIZATION O
FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE R.PARENT_OU_ID = #{id}
WHERE R.PARENT_OU_ID = #{id}
AND R.END_TIME >=
NOW()
AND R.END_TIME >=
<include
refid=
"now"
/>
AND O.IS_DELETED = 1
AND O.IS_DELETED = 1
ORDER BY R.SORT)
ORDER BY R.SORT)
UNION ALL
UNION ALL
...
@@ -673,15 +727,16 @@
...
@@ -673,15 +727,16 @@
<select
id=
"selectOrgList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
<select
id=
"selectOrgList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
resultMap=
"ExtendResultMap"
>
resultMap=
"ExtendResultMap"
>
SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
O.OU_NAME AS OU_NAME,
O.OU_NAME AS OU_NAME,
''
AS LINE_ID,
''
AS LINE_ID,
'ORG'
AS OU_LEVEL,
'ORG'
AS OU_LEVEL,
''
AS GRID_TYPE_KEY
''
AS GRID_TYPE_KEY
FROM SYS_ORGANIZATION O
FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE O.ID = #{id}
WHERE O.ID = #{id}
AND R.END_TIME >= NOW()
AND R.END_TIME >=
AND O.IS_DELETED = 1
<include
refid=
"now"
/>
AND O.IS_DELETED = 1
ORDER BY R.SORT
ORDER BY R.SORT
</select>
</select>
...
@@ -695,7 +750,7 @@
...
@@ -695,7 +750,7 @@
FROM SYS_ORGANIZATION O
FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE O.ID = #{id}
WHERE O.ID = #{id}
AND R.END_TIME >=
NOW()
AND R.END_TIME >=
<include
refid=
"now"
/>
AND O.IS_DELETED = 1
AND O.IS_DELETED = 1
ORDER BY R.SORT
ORDER BY R.SORT
</select>
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment