Commit d3952724 authored by 张森's avatar 张森

站端人员数据同步idx库是否持证逻辑修改

parent 2b9da949
......@@ -1191,7 +1191,29 @@ LEFT JOIN (
cf.certificate_number certificatesNumber,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'personNumber' AND dfi.instance_id = u.sequence_nbr ) AS employee_number,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'telephone' AND dfi.instance_id = u.sequence_nbr ) AS telephone,
( CASE WHEN cfp.post_qualification IS NULL or cfp.post_qualification = '' THEN 0 ELSE 1 END ) AS is_certificate,
CASE
WHEN ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1602 THEN
(
IF
((
SELECT
concat( cfp.post_qualification_code, ',' ) REGEXP concat( REPLACE ( '1427,1428,1429,1430,1431', ',', ',|' ), ',' )) > 0,
1,
0
)
)
WHEN ( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1601 THEN
(
IF
(
(
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
),
1,
0
)) ELSE 0
END AS is_certificate,
IF
(
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1601,
......
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