Commit b37161cc authored by 李秀明's avatar 李秀明

人员持证查询修改

parent 7cee520f
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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">
<sql id="orgUsrJoinFirefightersPost">
SELECT
COUNT(1) AS value
FROM
(
SELECT
*
FROM
(
SELECT
ou.sequence_nbr,
ou.biz_org_type,
ou.biz_org_name,
ou.biz_org_code,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType,
ou.is_delete
FROM
cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE
ou.is_delete = 0
GROUP BY
ou.sequence_nbr
) c
WHERE
c.peopleType = '1602'
)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'
AND fp.is_delete = 0
</sql>
<!-- <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 select
...@@ -80,7 +65,7 @@ ...@@ -80,7 +65,7 @@
) )
AND c.is_delete = 0 AND c.is_delete = 0
AND c.biz_org_type = 'person' AND c.biz_org_type = 'person'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and c.biz_org_code like concat (#{bizOrgCode},'%')</if>
GROUP BY GROUP BY
c.sequence_nbr c.sequence_nbr
) a ) a
...@@ -106,7 +91,7 @@ ...@@ -106,7 +91,7 @@
AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0 AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
AND c.is_delete = 0 AND c.is_delete = 0
AND c.biz_org_type = 'person' AND c.biz_org_type = 'person'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and c.biz_org_code like concat (#{bizOrgCode},'%')</if>
GROUP BY GROUP BY
c.sequence_nbr c.sequence_nbr
) a ) a
...@@ -131,7 +116,7 @@ ...@@ -131,7 +116,7 @@
AND cfp.firefighters_id IS NOT NULL AND cfp.firefighters_id IS NOT NULL
AND c.is_delete = 0 AND c.is_delete = 0
and c.biz_org_type = 'person' and c.biz_org_type = 'person'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and c.biz_org_code like concat (#{bizOrgCode},'%')</if>
group by c.sequence_nbr group by c.sequence_nbr
) a ) a
WHERE WHERE
...@@ -160,7 +145,7 @@ ...@@ -160,7 +145,7 @@
AND cfp.post_qualification_code != '' AND cfp.post_qualification_code != ''
AND c.is_delete = 0 AND c.is_delete = 0
AND c.biz_org_type = 'person' AND c.biz_org_type = 'person'
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>and c.biz_org_code like concat (#{bizOrgCode},'%')</if>
GROUP BY GROUP BY
c.sequence_nbr c.sequence_nbr
) a ) a
...@@ -176,18 +161,19 @@ ...@@ -176,18 +161,19 @@
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM FROM
cb_org_usr c cb_org_usr c
LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id LEFT JOIN cb_firefighters cf ON CONCAT( c.sequence_nbr, '' ) = cf.org_usr_id AND cf.is_delete = 0
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_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 LEFT JOIN cb_dynamic_form_instance cfi ON c.sequence_nbr = cfi.instance_id
WHERE WHERE
c.sequence_nbr IS NOT NULL c.sequence_nbr IS NOT NULL
AND cfp.firefighters_id 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 concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
AND c.is_delete = 0 AND c.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and cf.biz_org_code like concat (#{bizOrgCode},'%')</if> <if test='bizOrgCode!=null and bizOrgCode!=""'>
group by c.sequence_nbr AND c.biz_org_code like concat (#{bizOrgCode},'%')
</if>
GROUP BY
c.sequence_nbr
) a ) a
WHERE WHERE
a.peopleType = '1601' a.peopleType = '1601'
...@@ -210,7 +196,7 @@ ...@@ -210,7 +196,7 @@
AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1426,1427,1428,1429,1430,1431', ',', ',|' ), ',' ) > 0 AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1426,1427,1428,1429,1430,1431', ',', ',|' ), ',' ) > 0
AND c.is_delete = 0 AND c.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'> <if test='bizOrgCode!=null and bizOrgCode!=""'>
AND cf.biz_org_code like concat (#{bizOrgCode},'%') AND c.biz_org_code like concat (#{bizOrgCode},'%')
</if> </if>
group by c.sequence_nbr group by c.sequence_nbr
) a ) a
...@@ -227,7 +213,7 @@ ...@@ -227,7 +213,7 @@
( (
( (
SELECT SELECT
count( 1 ) AS total COUNT(1) AS total
FROM FROM
( (
SELECT SELECT
...@@ -245,7 +231,7 @@ ...@@ -245,7 +231,7 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
...@@ -258,11 +244,13 @@ ...@@ -258,11 +244,13 @@
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
<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 total, ) AS total,
( (
SELECT SELECT
count( 1 ) AS cjssczyNum COUNT(1) AS cjssczyNum
FROM FROM
( (
SELECT SELECT
...@@ -280,25 +268,27 @@ ...@@ -280,25 +268,27 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
WHERE WHERE
c.peopleType = '1602' c.peopleType = '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
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427', ',', ',|' ), ',' ) > 0 AND fp.post_qualification_code LIKE '%1427%'
<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,
( (
SELECT SELECT
count( 1 ) AS zjssczyNum COUNT(1) AS zjssczyNum
FROM FROM
( (
SELECT SELECT
...@@ -316,7 +306,7 @@ ...@@ -316,7 +306,7 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
...@@ -329,12 +319,14 @@ ...@@ -329,12 +319,14 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1428', ',', ',|' ), ',' ) > 0 AND fp.post_qualification_code LIKE '%1428%'
<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,
( (
SELECT SELECT
count( 1 ) AS gjssczyNum COUNT(1) AS gjssczyNum
FROM FROM
( (
SELECT SELECT
...@@ -352,7 +344,7 @@ ...@@ -352,7 +344,7 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
...@@ -365,12 +357,14 @@ ...@@ -365,12 +357,14 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1429', ',', ',|' ), ',' ) > 0 AND fp.post_qualification_code LIKE '%1429%'
<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,
( (
SELECT SELECT
count( 1 ) AS yjjzjgxfjsNum COUNT(1) AS yjjzjgxfjsNum
FROM FROM
( (
SELECT SELECT
...@@ -388,7 +382,7 @@ ...@@ -388,7 +382,7 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
...@@ -401,8 +395,10 @@ ...@@ -401,8 +395,10 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1430', ',', ',|' ), ',' ) > 0 AND fp.post_qualification_code LIKE '%1430%'
<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,
( (
SELECT SELECT
...@@ -424,7 +420,7 @@ ...@@ -424,7 +420,7 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
...@@ -437,12 +433,14 @@ ...@@ -437,12 +433,14 @@
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 concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1431', ',', ',|' ), ',' ) > 0 AND fp.post_qualification_code LIKE '%1431%'
<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,
( (
SELECT SELECT
count( 1 ) AS qtNum count(1) AS qtNum
FROM FROM
( (
SELECT SELECT
...@@ -460,7 +458,7 @@ ...@@ -460,7 +458,7 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
...@@ -473,25 +471,14 @@ ...@@ -473,25 +471,14 @@
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 REPLACE ( AND fp.post_qualification_code NOT LIKE '%1427%'
REPLACE ( AND fp.post_qualification_code NOT LIKE '%1428%'
REPLACE ( REPLACE ( REPLACE ( REPLACE ( fp.post_qualification_code, ',', '' ), '1427', '' ), '1428', '' ), '1429', '' ), AND fp.post_qualification_code NOT LIKE '%1429%'
'1430', AND fp.post_qualification_code NOT LIKE '%1430%'
'' AND fp.post_qualification_code NOT LIKE '%1431%'
), <if test='bizOrgCode!=null and bizOrgCode!=""'>
'1431', AND LEFT(a.biz_org_code,18) LIKE concat (#{bizOrgCode},'%')
'' </if>
) IS NOT NULL
AND REPLACE (
REPLACE (
REPLACE ( REPLACE ( REPLACE ( REPLACE ( fp.post_qualification_code, ',', '' ), '1427', '' ), '1428', '' ), '1429', '' ),
'1430',
''
),
'1431',
''
) != ''
<if test='bizOrgCode!=null and bizOrgCode!=""'>and LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')</if>
) as qtNum ) as qtNum
) )
</select> </select>
...@@ -507,17 +494,11 @@ ...@@ -507,17 +494,11 @@
( (
SELECT SELECT
count( 1 ) AS zzTotal, count( 1 ) AS zzTotal,
SUM( SUM(IF((
IF 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
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0 ), 1, 0) ) AS zzHasCard
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 zzHasCard
FROM FROM
( (
SELECT SELECT
...@@ -534,12 +515,10 @@ ...@@ -534,12 +515,10 @@
FROM FROM
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
LEFT JOIN cb_firefighters cf ON CONCAT( ou.sequence_nbr, '' ) = cf.org_usr_id LEFT JOIN cb_firefighters cf ON CONCAT( ou.sequence_nbr, '' ) = cf.org_usr_id AND cf.is_delete = 0
AND cf.is_delete = 0 LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = ou.sequence_nbr AND cfp.is_delete = 0
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = ou.sequence_nbr
AND cfp.is_delete = 0
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
AND cfp.firefighters_id IS NOT NULL AND cfp.firefighters_id IS NOT NULL
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
...@@ -552,7 +531,9 @@ ...@@ -552,7 +531,9 @@
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> <if test='bizOrgCode!=null and bizOrgCode!=""'>
AND LEFT(a.biz_org_code,18) like concat (#{bizOrgCode},'%')
</if>
) d ) d
</select> </select>
<select id="getYWPersonInfo" resultType="Map"> <select id="getYWPersonInfo" resultType="Map">
...@@ -565,15 +546,8 @@ ...@@ -565,15 +546,8 @@
FROM FROM
( (
SELECT SELECT
count( 1 ) AS ywTotal, count(1) AS ywTotal,
SUM( SUM(IF((SELECT concat( fp.post_qualification_code, ',' ) REGEXP CONCAT(REPLACE('1427,1428,1429,1430,1431', ',', ',|'), ',')) > 0, 1, 0)) AS ywHasCard
IF
((
SELECT
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )) > 0,
1,
0
)) AS ywHasCard
FROM FROM
( (
SELECT SELECT
...@@ -591,7 +565,7 @@ ...@@ -591,7 +565,7 @@
cb_org_usr ou cb_org_usr ou
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
WHERE WHERE
ou.is_delete = '0' ou.is_delete = 0
GROUP BY GROUP BY
ou.sequence_nbr ou.sequence_nbr
) c ) c
...@@ -604,7 +578,9 @@ ...@@ -604,7 +578,9 @@
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
<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>
) d ) d
</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