Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
ca7e9143
Commit
ca7e9143
authored
Nov 21, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员统计优化
parent
eaef1c40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
121 deletions
+71
-121
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+71
-121
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
ca7e9143
...
@@ -1757,131 +1757,81 @@
...
@@ -1757,131 +1757,81 @@
<select
id=
"getCenterPersonInfoPage"
resultType=
"Map"
>
<select
id=
"getCenterPersonInfoPage"
resultType=
"Map"
>
SELECT
SELECT
LEFT (
LEFT(a.biz_org_code,18) AS bizOrgCode,
a.biz_org_code,
(
18) AS bizOrgCode,
CASE WHEN LENGTH(a.biz_org_code) > 18
(
THEN (SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT(a.biz_org_code, 18) AND cou.biz_org_type = 'COMPANY')
CASE
ELSE (SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT(a.biz_org_code, 6) AND cou.biz_org_type = 'COMPANY')
WHEN LENGTH( a.biz_org_code ) > 18 THEN
END
( SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT ( a.biz_org_code, 18 ) AND
) AS bizOrgName,
cou.biz_org_type = 'COMPANY' ) ELSE ( SELECT cou.biz_org_name FROM cb_org_usr cou WHERE cou.biz_org_code = LEFT
ibsi.station_type AS stationType,
( a.biz_org_code, 6 ) AND cou.biz_org_type = 'COMPANY' )
SUM(IF(a.peopleType = '1601', 1, 0)) AS fireNum,
END
SUM(IF(a.peopleType = '1602', 1, 0)) AS ywNum,
) AS bizOrgName,
SUM(
SUM(
IF(a.peopleType = '1601' AND (
IF
CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE('1823,1824,1825,1826,1827', ',', ',|'), ',') > 0
( a.peopleType = '1601', 1, 0 )) AS fireNum,
OR CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE('1421,1422,1423,1424,1425', ',', ',|'), ',') > 0
SUM(
OR CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE('1426,1427,1428,1429,1430,1431', ',', ',|'), ',') > 0
IF
),1,0)
( a.peopleType = '1602', 1, 0 )) AS ywNum,
) AS fireIsOk,
ibsi.station_type AS stationType,
(
SUM(
SUM(IF(a.peopleType = '1601', 1, 0)) -
IF
SUM(
(
IF(a.peopleType = '1601' AND (
a.peopleType = '1601'
CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE('1823,1824,1825,1826,1827', ',', ',|'), ',') > 0
AND (
OR CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE('1421,1422,1423,1424,1425', ',', ',|'), ',' ) > 0
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',') > 0
OR CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE('1426,1427,1428,1429,1430,1431', ',', ',|'), ',' ) > 0
OR concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
), 1, 0)
OR concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1426,1427,1428,1429,1430,1431', ',', ',|' ), ',' ) > 0
)
),
) AS fireNoCard,
1,
SUM(
0
IF((a.peopleType = '1602' AND (SELECT CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE('1427,1428,1429,1430,1431', ',', ',|'), ',')) > 0), 1, 0)
)) AS fireIsOk,
) AS ywIsOk,
(
(
SUM(
SUM(IF(a.peopleType = '1602', 1, 0)) -
IF
SUM(
( a.peopleType = '1601', 1, 0 )) - SUM(
IF((a.peopleType = '1602' AND (SELECT CONCAT(fp.post_qualification_code, ',') REGEXP CONCAT(REPLACE ('1427,1428,1429,1430,1431', ',', ',|'), ',')) > 0), 1, 0)
IF
)
(
) AS ywNoCard
a.peopleType = '1601'
AND (
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',') > 0
OR concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
OR concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1426,1427,1428,1429,1430,1431', ',', ',|' ), ',' ) > 0
),
1,
0
))
) AS fireNoCard,
SUM(
IF
((
a.peopleType = '1602'
AND (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ','
)) = 0
OR (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ','
) IS NULL
AND a.peopleType = '1602'
)
),
1,
0
)) AS ywNotOk,
SUM(
IF
((
a.peopleType = '1602'
AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' ) > 0
),
1,
0
)) AS ywCJ,
SUM(
IF
((
a.peopleType = '1602'
AND (
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' )) > 0
),
1,
0
)) AS ywZJ
FROM
(
SELECT
*
FROM
FROM
(
(
SELECT
SELECT
ou.sequence_nbr,
*
ou.biz_org_type,
FROM
ou.biz_org_name,
(
ou.biz_org_code,
SELECT
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.sequence_nbr,
ou.is_delete
ou.biz_org_type,
FROM
ou.biz_org_name,
cb_org_usr ou
ou.biz_org_code,
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
IFNULL(MAX(CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '') AS peopleType,
WHERE
ou.is_delete
ou.is_delete = '0'
FROM
GROUP BY
cb_org_usr ou
ou.sequence_nbr
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
) c
WHERE
WHERE
ou.is_delete = '0'
c.peopleType IN ( '1601', '1602' )
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType IN ('1601', '1602')
) a
) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
LEFT JOIN idx_biz_station_info ibsi ON LEFT ( a.biz_org_code, 18
) = ibsi.biz_org_code
LEFT JOIN idx_biz_station_info ibsi ON LEFT (a.biz_org_code, 18
) = ibsi.biz_org_code
WHERE
WHERE
a.biz_org_name IS NOT NULL
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
AND a.biz_org_type = 'PERSON'
AND fp.is_delete = 0
AND fp.is_delete = 0
AND LENGTH( a.biz_org_code ) > 18
AND LENGTH( a.biz_org_code ) > 18
<if
test=
'bizOrgCode!=null and bizOrgCode!=""'
>
<if
test=
'bizOrgCode!=null and bizOrgCode!=""'
>
and LEFT(a.biz_org_code,18) like concat
(#{bizOrgCode},'%')
AND LEFT(a.biz_org_code,18) LIKE CONCAT
(#{bizOrgCode},'%')
</if>
</if>
<if
test=
'stationType != null and stationType != ""'
>
<if
test=
'stationType != null and stationType != ""'
>
and ibsi.station_type like concat
('%', #{stationType},'%')
AND ibsi.station_type LIKE CONCAT
('%', #{stationType},'%')
</if>
</if>
GROUP BY
GROUP BY
LEFT (
LEFT(a.biz_org_code, 18)
a.biz_org_code,
18)
</select>
</select>
</mapper>
</mapper>
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