where a.DELETE_FLAG = '0' and a.dept_no = #{deptNo}
where a.DELETE_FLAG = '0' and a.project_status = 0 and a.dept_no = #{deptNo} order by a.CREATE_TIME desc
</select>
</select>
<!--生成数据封装-->
<!--生成数据封装-->
...
@@ -205,7 +205,6 @@
...
@@ -205,7 +205,6 @@
e.EMP_PHONE empPhone,
e.EMP_PHONE empPhone,
e.EMP_REGIS_TYPE empRegisType,
e.EMP_REGIS_TYPE empRegisType,
e.FILE_PROVINCE fileProvince,
e.FILE_PROVINCE fileProvince,
e.FILE_CITY fileCity,
e.IS_COLLEGE isCollege,
e.IS_COLLEGE isCollege,
e.HIGN_EDUCATION hignEducation,
e.HIGN_EDUCATION hignEducation,
e.SCHOOL,
e.SCHOOL,
...
@@ -229,7 +228,7 @@
...
@@ -229,7 +228,7 @@
d.id as contactInfoId,
d.id as contactInfoId,
if(ifnull(f.OCCUPATIONAL_DISEASE_FLAG,1) != 1 and ifnull(f.INFECTIOUS_DISEASE_FLAG,1) != 1 and ifnull(f.DISABILITY_FLAG,1) != 1 and ifnull(f.OTHER_FLAG,1) != 1,'1',null) as disabilityFlag,
if(ifnull(f.OCCUPATIONAL_DISEASE_FLAG,'6') != '6' and ifnull(f.INFECTIOUS_DISEASE_FLAG,'6') != '6' and ifnull(f.DISABILITY_FLAG,'6') != '6' and ifnull(f.OTHER_FLAG,'6') != '6','1',null) as disabilityFlag,
if(ifnull(b.REMARK,1) != 1,'1',null) as badRecordFlag,
if(ifnull(b.REMARK,1) != 1,'1',null) as badRecordFlag,
...
@@ -252,7 +251,6 @@
...
@@ -252,7 +251,6 @@
ee.EMP_PHONE,
ee.EMP_PHONE,
ee.EMP_REGIS_TYPE,
ee.EMP_REGIS_TYPE,
ee.FILE_PROVINCE,
ee.FILE_PROVINCE,
ee.FILE_CITY,
ee.IS_COLLEGE,
ee.IS_COLLEGE,
ee.HIGN_EDUCATION,
ee.HIGN_EDUCATION,
ee.SCHOOL,
ee.SCHOOL,
...
@@ -272,8 +270,8 @@
...
@@ -272,8 +270,8 @@
left join t_emp_bad_record b on a.EMP_IDCARD = b.EMP_IDCARD
left join t_emp_bad_record b on a.EMP_IDCARD = b.EMP_IDCARD
left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID
left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID
left join t_emp_contact_info d on a.EMP_IDCARD = d.EMP_IDCARD
left join t_emp_contact_info d on a.EMP_IDCARD = d.EMP_IDCARD
left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '1'
left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '0'
left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '1' group by EMP_ID) g on a.EMP_ID = g.EMP_ID
left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '0' group by EMP_ID) g on a.EMP_ID = g.EMP_ID
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join view_sys_dict_item emp_natrue on emp_natrue.value=a.emp_Natrue and emp_natrue.type='emp_natrue'
left join view_sys_dict_item emp_natrue on emp_natrue.value=a.emp_Natrue and emp_natrue.type='emp_natrue'
...
@@ -322,7 +323,7 @@
...
@@ -322,7 +323,7 @@
left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area cf on cf.id=e.FILE_CITY
left join sys_area tf on tf.id=e.FILE_TOWN
left join sys_area tf on tf.id=e.FILE_TOWN
left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID
left join t_pre_employee_project p on a.id=p.PRE_MAIN_ID
left join view_sys_dict_item contractType on contractType.value=p.CONTRACT_TYPE and contractType.type='employee_contract_type'
left join view_sys_dict_item contractType on contractType.value=p.CONTRACT_TYPE and contractType.type='personnel_type'
left join view_sys_dict_item workingHours on workingHours.value=p.WORKING_HOURS and workingHours.type='working_hours'
left join view_sys_dict_item workingHours on workingHours.value=p.WORKING_HOURS and workingHours.type='working_hours'
left join t_pre_emp_contact_info ec on a.id=ec.PRE_MAIN_ID
left join t_pre_emp_contact_info ec on a.id=ec.PRE_MAIN_ID
left join t_pre_emp_education ee on a.id=ee.PRE_MAIN_ID
left join t_pre_emp_education ee on a.id=ee.PRE_MAIN_ID
...
@@ -336,7 +337,7 @@
...
@@ -336,7 +337,7 @@
,SUBSTRING_INDEX(GROUP_CONCAT(ee.END_DATE ORDER BY ee.create_time desc),',',1) END_DATE
,SUBSTRING_INDEX(GROUP_CONCAT(ee.END_DATE ORDER BY ee.create_time desc),',',1) END_DATE
from t_pre_emp_work_recording ee
from t_pre_emp_work_recording ee
GROUP BY ee.PRE_MAIN_ID
GROUP BY ee.PRE_MAIN_ID
) ew on e.id=ew.PRE_MAIN_ID
) ew on a.id=ew.PRE_MAIN_ID
left join (
left join (
select
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
...
@@ -345,7 +346,8 @@
...
@@ -345,7 +346,8 @@
,SUBSTRING_INDEX(GROUP_CONCAT(ee.CONTRACT_TEL ORDER BY ee.create_time desc),',',1) CONTRACT_TEL
,SUBSTRING_INDEX(GROUP_CONCAT(ee.CONTRACT_TEL ORDER BY ee.create_time desc),',',1) CONTRACT_TEL
from t_pre_emp_family ee
from t_pre_emp_family ee
GROUP BY ee.PRE_MAIN_ID
GROUP BY ee.PRE_MAIN_ID
) ef on e.id=ef.PRE_MAIN_ID
) ef on a.id=ef.PRE_MAIN_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
left join (
left join (
select
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
SUBSTRING_INDEX(GROUP_CONCAT(ee.PRE_MAIN_ID ORDER BY ee.create_time desc),',',1) PRE_MAIN_ID
...
@@ -353,10 +355,11 @@
...
@@ -353,10 +355,11 @@
,SUBSTRING_INDEX(GROUP_CONCAT(ee.QUALIFICATION_TYPE ORDER BY ee.create_time desc),',',1) QUALIFICATION_TYPE
,SUBSTRING_INDEX(GROUP_CONCAT(ee.QUALIFICATION_TYPE ORDER BY ee.create_time desc),',',1) QUALIFICATION_TYPE
from t_pre_emp_professional_qualification ee
from t_pre_emp_professional_qualification ee
GROUP BY ee.PRE_MAIN_ID
GROUP BY ee.PRE_MAIN_ID
) ep on e.id=ep.PRE_MAIN_ID
) ep on a.id=ep.PRE_MAIN_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
left join t_pre_emp_disability_info ed on a.id=ed.PRE_MAIN_ID
left join t_pre_emp_disability_info ed on a.id=ed.PRE_MAIN_ID
left join view_sys_dict_item disability_grade on disability_grade.value=ed.DISABILITY_LEVEL and disability_grade.type='disability_grade'
left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID
left join t_pre_emp_bad_record eb on a.id=eb.PRE_MAIN_ID
<where>
<where>
a.STATUS != '5'
a.STATUS != '5'
...
@@ -381,10 +384,10 @@
...
@@ -381,10 +384,10 @@
count(1)
count(1)
FROM t_pre_emp_main a
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_work_recording ew on e.id=ew.EMP_ID
left join t_pre_emp_work_recording ew on a.id=ew.PRE_MAIN_ID
<where>
<where>
a.STATUS != '5' and ew.id is not null and EXISTS (
a.STATUS != '5' and ew.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id
select 1 from (select a.EMP_IDCARD from t_pre_emp_work_recording a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ew.EMP_IDCARD
)
)
<includerefid="tPreEmpMain_where"/>
<includerefid="tPreEmpMain_where"/>
</where>
</where>
...
@@ -397,13 +400,14 @@
...
@@ -397,13 +400,14 @@
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
FROM t_pre_emp_main a
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_work_recording ew on e.id=ew.EMP_ID
left join t_pre_emp_work_recording ew on a.id=ew.PRE_MAIN_ID
<where>
<where>
a.STATUS != '5' and ew.id is not null and EXISTS (
a.STATUS != '5' and ew.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id
select 1 from (select a.EMP_IDCARD from t_pre_emp_work_recording a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ew.EMP_IDCARD
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_family ef on e.id=ef.EMP_ID
left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID
<where>
<where>
a.STATUS != '5' and ef.id is not null and EXISTS (
a.STATUS != '5' and ef.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
select 1 from (select a.EMP_IDCARD from t_pre_emp_family a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ef.EMP_IDCARD
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_family ef on e.id=ef.EMP_ID
left join t_pre_emp_family ef on a.id=ef.PRE_MAIN_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
<where>
<where>
a.STATUS != '5' and ef.id is not null and EXISTS (
a.STATUS != '5' and ef.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
select 1 from (select a.EMP_IDCARD from t_pre_emp_family a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ef.EMP_IDCARD
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on e.id=ep.EMP_ID
left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID
<where>
<where>
a.STATUS != '5' and ep.id is not null and EXISTS (
a.STATUS != '5' and ep.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id
select 1 from (select a.EMP_IDCARD from t_pre_emp_professional_qualification a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ep.EMP_IDCARD
)
)
<includerefid="tPreEmpMain_where"/>
<includerefid="tPreEmpMain_where"/>
</where>
</where>
...
@@ -467,14 +473,15 @@
...
@@ -467,14 +473,15 @@
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
FROM t_pre_emp_main a
FROM t_pre_emp_main a
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_employee_info e on a.id=e.PRE_MAIN_ID
left join t_pre_emp_professional_qualification ep on e.id=ep.EMP_ID
left join t_pre_emp_professional_qualification ep on a.id=ep.PRE_MAIN_ID
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
left join view_sys_dict_item qualification_type on qualification_type.value=ep.QUALIFICATION_TYPE and qualification_type.type='qualification_type'
<where>
<where>
a.STATUS != '5' and ep.id is not null and EXISTS (
a.STATUS != '5' and ep.id is not null and EXISTS (
select 1 from (select a.emp_id from t_pre_emp_professional_qualification a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ep.emp_id
select 1 from (select a.EMP_IDCARD from t_pre_emp_professional_qualification a left join t_pre_emp_main p on a.PRE_MAIN_ID=p.id where p.STATUS != '5' and p.id is not null GROUP BY a.EMP_IDCARD HAVING count(1)>1) ea where ea.EMP_IDCARD=ep.EMP_IDCARD