Commit 3f79db0f authored by 李秀明's avatar 李秀明

消防人员持证统计规则修改

parent c8839608
......@@ -73,8 +73,11 @@
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
AND concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
AND (
concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
OR concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 0
OR concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1426,1427,1428,1429,1430,1431', ',', ',|' ), ',' ) > 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>
......@@ -151,8 +154,8 @@
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 REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(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', ''),'1426', ''),'1427', ''),'1428', ''),'1429', ''),'1430', ''),'1431', '') IS NOT NULL
AND REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(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', ''),'1426', ''),'1427', ''),'1428', ''),'1429', ''),'1430', ''),'1431', '') != ''
AND cfp.post_qualification_code IS NOT NULL
AND cfp.post_qualification_code != ''
AND c.is_delete = 0
......@@ -188,7 +191,32 @@
) a
WHERE
a.peopleType = '1601'
) as xfNum
) as xfNum,
(
SELECT
COUNT( 1 ) AS xfssczyNum
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 ( '1426,1427,1428,1429,1430,1431', ',', ',|' ), ',' ) > 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 xfssczyNum
)
</select>
......@@ -484,7 +512,8 @@
(
(
concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1823,1824,1825,1826,1827', ',', ',|' ), ',' ) > 0
AND concat( fp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1421,1422,1423,1424,1425', ',', ',|' ), ',' ) > 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
......
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