Commit 495b6eeb authored by 张森's avatar 张森

人员bug修改

parent ae75eee4
...@@ -2,53 +2,193 @@ ...@@ -2,53 +2,193 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersPostMapper"> <mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersPostMapper">
<!-- <select id="getFirePersonJobInfo" resultType="Map">-->
<!-- SELECT * FROM (-->
<!-- (SELECT-->
<!-- COUNT(1) AS xfNum-->
<!-- FROM-->
<!-- cb_org_usr c-->
<!-- LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0-->
<!-- LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0-->
<!-- WHERE-->
<!-- c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1421,1422,1423,1424,1425',',',',|'),',') > 0-->
<!-- <if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS xfNum,-->
<!-- (SELECT-->
<!-- COUNT(1) AS ssczyNum-->
<!-- FROM-->
<!-- cb_org_usr c-->
<!-- LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0-->
<!-- LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0-->
<!-- WHERE-->
<!-- c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1427,1428,1429,1430,1431',',',',|'),',') > 0-->
<!-- <if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS ssczyNum,-->
<!-- (SELECT-->
<!-- COUNT(1) AS yjjyNum-->
<!-- FROM-->
<!-- cb_org_usr c-->
<!-- LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0-->
<!-- LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0-->
<!-- WHERE-->
<!-- c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1823,1824,1825,1826,1827',',',',|'),',') > 0-->
<!-- <if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS yjjyNum,-->
<!-- (SELECT-->
<!-- COUNT(1) AS total-->
<!-- FROM-->
<!-- cb_org_usr c-->
<!-- LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0-->
<!-- LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0-->
<!-- WHERE-->
<!-- c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL-->
<!-- <if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS total,-->
<!-- (SELECT-->
<!-- COUNT(1) AS firePersonHasCard-->
<!-- FROM-->
<!-- cb_org_usr c-->
<!-- LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0-->
<!-- LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0-->
<!-- WHERE-->
<!-- c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1421,1422,1423,1424,1425,1823,1824,1825,1826,1827',',',',|'),',') > 0-->
<!-- <if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS firePersonHasCard-->
<!-- )-->
<!-- </select>-->
<select id="getFirePersonJobInfo" resultType="Map"> <select id="getFirePersonJobInfo" resultType="Map">
SELECT * FROM ( select
(SELECT *
COUNT(1) AS xfNum from
FROM (
cb_org_usr c (SELECT
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0 count( 1 ) as firePersonHasCard
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0 FROM
WHERE (
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1421,1422,1423,1424,1425',',',',|'),',') > 0 SELECT
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS xfNum, IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
(SELECT FROM
COUNT(1) AS ssczyNum cb_org_usr c
FROM LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
cb_org_usr c AND cf.is_delete = 0
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0 LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0 AND cfp.is_delete = 0
WHERE LEFT JOIN cb_dynamic_form_instance cfi ON c.sequence_nbr = cfi.instance_id
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1427,1428,1429,1430,1431',',',',|'),',') > 0 WHERE
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS ssczyNum, c.sequence_nbr IS NOT NULL
(SELECT AND cfp.firefighters_id IS NOT NULL
COUNT(1) AS yjjyNum AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
FROM AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
cb_org_usr c AND c.is_delete = 0
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0 AND c.biz_org_type = 'person'
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0 <if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>
WHERE GROUP BY
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1823,1824,1825,1826,1827',',',',|'),',') > 0 c.sequence_nbr
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS yjjyNum, ) a
(SELECT WHERE
COUNT(1) AS total a.peopleType = '1601') as firePersonHasCard,
FROM (
cb_org_usr c SELECT
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0 count( 1 ) AS yjjyNum
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0 FROM
WHERE (
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL SELECT
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS total, IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
(SELECT FROM
COUNT(1) AS firePersonHasCard cb_org_usr c
FROM LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
cb_org_usr c AND cf.is_delete = 0
LEFT JOIN cb_firefighters cf ON CONCAT(c.sequence_nbr, '') = cf.org_usr_id AND cf.is_delete = 0 LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr AND cfp.is_delete = 0 AND cfp.is_delete = 0
WHERE LEFT JOIN cb_dynamic_form_instance cfi ON c.sequence_nbr = cfi.instance_id
c.sequence_nbr IS NOT NULL AND cfp.firefighters_id IS NOT NULL AND concat(cfp.post_qualification_code, ',') regexp concat(replace('1421,1422,1423,1424,1425,1823,1824,1825,1826,1827',',',',|'),',') > 0 WHERE
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>) AS firePersonHasCard c.sequence_nbr IS NOT NULL
AND cfp.firefighters_id IS NOT NULL
AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
AND c.is_delete = 0
AND c.biz_org_type = 'person'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>
GROUP BY
c.sequence_nbr
) a
WHERE
a.peopleType = '1601' ) as yjjyNum,
(
SELECT
count( 1 ) as total
FROM
(
SELECT
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
LEFT JOIN cb_dynamic_form_instance cfi ON c.sequence_nbr = cfi.instance_id
WHERE
c.sequence_nbr IS NOT NULL
AND cfp.firefighters_id IS NOT NULL
AND c.is_delete = 0
and c.biz_org_type = 'person'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>
group by c.sequence_nbr
) a
WHERE
a.peopleType = '1601' ) as total,
(
SELECT
COUNT( 1 ) AS qtNum
FROM
(
SELECT
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
LEFT JOIN cb_dynamic_form_instance cfi ON c.sequence_nbr = cfi.instance_id
WHERE
c.sequence_nbr IS NOT NULL
AND cfp.firefighters_id IS NOT NULL
AND REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(cfp.post_qualification_code,',',''), '1421', ''),'1422', ''),'1423', ''),'1424', ''),'1425', ''),'1823', ''),'1824', ''),'1825', ''),'1826', ''),'1827', '') IS NOT NULL
AND REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(cfp.post_qualification_code,',',''), '1421', ''),'1422', ''),'1423', ''),'1424', ''),'1425', ''),'1823', ''),'1824', ''),'1825', ''),'1826', ''),'1827', '') != ''
AND cfp.post_qualification_code IS NOT NULL
AND cfp.post_qualification_code != ''
AND c.is_delete = 0
AND c.biz_org_type = 'person'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>
GROUP BY
c.sequence_nbr
) a
WHERE
a.peopleType = '1601'
) as qtNum,
(
SELECT
COUNT( 1 ) AS xfNum
FROM
(
SELECT
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id
AND cf.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = c.sequence_nbr
AND cfp.is_delete = 0
LEFT JOIN cb_dynamic_form_instance cfi ON c.sequence_nbr = cfi.instance_id
WHERE
c.sequence_nbr IS NOT NULL
AND cfp.firefighters_id IS NOT NULL
AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
AND c.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if>
group by c.sequence_nbr
) a
WHERE
a.peopleType = '1601'
) as xfNum
) )
</select> </select>
...@@ -89,7 +229,8 @@ ...@@ -89,7 +229,8 @@
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'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> AND fp.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS total, ) AS total,
( (
SELECT SELECT
...@@ -123,6 +264,7 @@ ...@@ -123,6 +264,7 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' ) > 0 AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS cjssczyNum, ) AS cjssczyNum,
...@@ -158,6 +300,7 @@ ...@@ -158,6 +300,7 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' ) > 0 AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS zjssczyNum, ) AS zjssczyNum,
...@@ -193,6 +336,7 @@ ...@@ -193,6 +336,7 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1429', ',', ',|' ), ',' ) > 0 AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1429', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS gjssczyNum, ) AS gjssczyNum,
...@@ -228,6 +372,7 @@ ...@@ -228,6 +372,7 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1430', ',', ',|' ), ',' ) > 0 AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1430', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS yjjzjgxfjsNum, ) AS yjjzjgxfjsNum,
...@@ -263,6 +408,7 @@ ...@@ -263,6 +408,7 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1431', ',', ',|' ), ',' ) > 0 AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1431', ',', ',|' ), ',' ) > 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) AS ejjzjgxfjsNum ) AS ejjzjgxfjsNum
...@@ -271,54 +417,61 @@ ...@@ -271,54 +417,61 @@
<select id="getZZPersonInfo" resultType="Map"> <select id="getZZPersonInfo" resultType="Map">
SELECT SELECT
d.zzTotal, d.zzTotal,
d.zzHasCard, d.zzHasCard,
ABS(d.zzTotal - d.zzHasCard) AS hasNoCard, ABS( d.zzTotal - d.zzHasCard ) AS hasNoCard,
ROUND( d.zzHasCard / d.zzTotal * 100, 2 ) AS percentageHas, ROUND( d.zzHasCard / d.zzTotal * 100, 2 ) AS percentageHas,
ROUND( ABS(d.zzTotal - d.zzHasCard) / d.zzTotal * 100, 2 ) AS percentageNo ROUND( ABS( d.zzTotal - d.zzHasCard ) / d.zzTotal * 100, 2 ) AS percentageNo
FROM FROM
( (
SELECT SELECT
count( 1 ) AS zzTotal, count( 1 ) AS zzTotal,
SUM( SUM(
IF IF
(( (
SELECT (
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' )) > 0, concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
1, AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
0 ),
)) AS zzHasCard 1,
FROM 0
( )) AS zzHasCard
SELECT FROM
* (
FROM SELECT
( *
SELECT FROM
ou.sequence_nbr, (
ou.biz_org_type, SELECT
ou.biz_org_name, ou.sequence_nbr,
ou.biz_org_code, ou.biz_org_type,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType, ou.biz_org_name,
ou.is_delete ou.biz_org_code,
FROM IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
cb_org_usr ou ou.is_delete
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id FROM
WHERE cb_org_usr ou
ou.is_delete = '0' LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY LEFT JOIN cb_firefighters cf ON CONCAT( ou.sequence_nbr, '' ) = cf.org_usr_id
ou.sequence_nbr AND cf.is_delete = 0
) c LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = ou.sequence_nbr
WHERE AND cfp.is_delete = 0
c.peopleType = '1601' WHERE
) a ou.is_delete = '0'
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id AND cfp.firefighters_id IS NOT NULL
WHERE GROUP BY
a.biz_org_name IS NOT NULL ou.sequence_nbr
AND a.is_delete = 0 ) c
AND a.biz_org_type = 'PERSON' WHERE
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> c.peopleType = '1601'
) d ) a
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
WHERE
a.biz_org_name IS NOT NULL
AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) d
</select> </select>
<select id="getYWPersonInfo" resultType="Map"> <select id="getYWPersonInfo" resultType="Map">
SELECT SELECT
...@@ -368,7 +521,8 @@ ...@@ -368,7 +521,8 @@
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'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> AND fp.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) d ) d
</select> </select>
</mapper> </mapper>
...@@ -1724,117 +1724,131 @@ ...@@ -1724,117 +1724,131 @@
<select id="getCenterPersonInfoPage" resultType="Map"> <select id="getCenterPersonInfoPage" resultType="Map">
SELECT SELECT
a.biz_org_code AS bizOrgCode, a.biz_org_code AS bizOrgCode,
( (
CASE CASE
WHEN LENGTH( a.biz_org_code ) > 18 THEN
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
( 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' ) 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' ) cou.biz_org_type = 'COMPANY' ) 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' )
END END
) AS bizOrgName, ) AS bizOrgName,
SUM( SUM(
IF IF
( a.peopleType = '1601', 1, 0 )) AS fireNum, ( a.peopleType = '1601', 1, 0 )) AS fireNum,
SUM( SUM(
IF IF
( a.peopleType = '1602', 1, 0 )) AS ywNum, ( a.peopleType = '1602', 1, 0 )) AS ywNum,
ibsi.station_type AS stationType, ibsi.station_type AS stationType,
SUM( SUM(
IF IF
(( (
a.peopleType = '1601' a.peopleType = '1601'
AND ( AND (
SELECT concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ','
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' )) > 0 ) > 0
), AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ),
1, ',' ) > 0
0 ),
)) AS fireIsOk, 1,
SUM( 0
IF )) AS fireIsOk,
(( (
a.peopleType = '1601' SUM(
AND ( IF
SELECT ( a.peopleType = '1601', 1, 0 )) - SUM(
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' )) = 0 IF
OR ( (
SELECT a.peopleType = '1601'
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425,1823,1824,1825,1826,1827', ',', ',|' ), ',' ) IS NULL AND (
AND a.peopleType = '1601' concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ','
)), ) > 0
1, AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ),
0 ',' ) > 0
)) AS fireNoCard, ),
SUM( 1,
IF 0
(( ))
a.peopleType = '1602' ) AS fireNoCard,
AND ( SUM(
SELECT IF
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )) = 0 ((
OR ( a.peopleType = '1602'
SELECT AND (
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' ) IS NULL SELECT
AND a.peopleType = '1602' concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ','
)), )) = 0
1, OR (
0 SELECT
)) AS ywNotOk, concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ','
SUM( ) IS NULL
IF AND a.peopleType = '1602'
(( )
a.peopleType = '1602' ),
AND ( 1,
SELECT 0
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' )) = 0 )) AS ywNotOk,
), SUM(
1, IF
0 ((
)) AS ywCJ, a.peopleType = '1602'
SUM( AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' ) > 0
IF ),
(( 1,
a.peopleType = '1602' 0
AND ( )) AS ywCJ,
SELECT SUM(
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' )) = 0 IF
), ((
1, a.peopleType = '1602'
0 AND (
)) AS ywZJ SELECT
FROM concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' )) > 0
( ),
SELECT 1,
* 0
FROM )) AS ywZJ
( FROM
SELECT (
ou.sequence_nbr, SELECT
ou.biz_org_type, *
ou.biz_org_name, FROM
ou.biz_org_code, (
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType, SELECT
ou.is_delete ou.sequence_nbr,
FROM ou.biz_org_type,
cb_org_usr ou ou.biz_org_name,
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id ou.biz_org_code,
WHERE IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete = '0' ou.is_delete
GROUP BY FROM
ou.sequence_nbr cb_org_usr ou
) c LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
c.peopleType IN ( '1601', '1602' ) ou.is_delete = '0'
) a GROUP BY
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id ou.sequence_nbr
LEFT JOIN idx_biz_station_info ibsi ON LEFT ( a.biz_org_code, 18 ) = ibsi.biz_org_code ) c
WHERE WHERE
a.biz_org_name IS NOT NULL c.peopleType IN ( '1601', '1602' )
AND a.is_delete = 0 ) a
AND a.biz_org_type = 'PERSON' LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if> LEFT JOIN idx_biz_station_info ibsi ON LEFT ( a.biz_org_code, 18 ) = ibsi.biz_org_code
<if test='stationType != null and stationType != ""'>and ibsi.station_type like concat ('%', #{stationType},'%')</if> WHERE
GROUP BY a.biz_org_name IS NOT NULL
LEFT(a.biz_org_code,18) AND a.is_delete = 0
AND a.biz_org_type = 'PERSON'
AND fp.is_delete = 0
AND LEFT ( a.biz_org_code, 18 ) LIKE concat ( 'LSHLZ1wYXL3mJmHZyG', '%' )
<if test='bizOrgCode!=null and bizOrgCode!=""'>
and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')
</if>
<if test='stationType != null and stationType != ""'>
and ibsi.station_type like concat ('%', #{stationType},'%')
</if>
GROUP BY
LEFT (
a.biz_org_code,
18)
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment