|
@@ -795,19 +795,19 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectPersonnelByList" resultType="com.goafanti.personnel.bo.OutPersonnelListBo">
|
|
<select id="selectPersonnelByList" resultType="com.goafanti.personnel.bo.OutPersonnelListBo">
|
|
|
- select a.id,a.door_id doorId,a.name,a.status,a.`system`,a.company,
|
|
|
|
|
|
|
+ select a.id,a.door_id doorId,a.name,a.status,a.`system`,a.company,dep.name depName,
|
|
|
b.jobs_name jobsName,a.lvl,b.lvl_name starName,date_format(a.entry_time,'%Y-%m-%d')entryTimes,
|
|
b.jobs_name jobsName,a.lvl,b.lvl_name starName,date_format(a.entry_time,'%Y-%m-%d')entryTimes,
|
|
|
- date_format(a.promotion_time,'%Y-%m-%d')promotionTimes,a.birthday,a.entry_time entryTime,
|
|
|
|
|
- a.sex,a.son,a.girl,a.political_outlook politicalOutlook,d.education,d.school,d.major,d.title,
|
|
|
|
|
- e.promotion_remarks promotionRemarks,date_format(e.promotion_time,'%Y-%m-%d') promotionTime,
|
|
|
|
|
|
|
+ date_format(a.promotion_time,'%Y-%m-%d')promotionTimes,date_format(a.birthday,'%Y-%m-%d')birthdays,
|
|
|
|
|
+ a.entry_time entryTime, a.sex,a.son,a.girl,a.political_outlook politicalOutlook,d.education,
|
|
|
|
|
+ d.school,d.major,d.title,e.promotion_remarks promotionRemarks,a.mobile,a.fixed_tel fixedTel,
|
|
|
|
|
+ date_format(e.promotion_time,'%Y-%m-%d') promotionTime,a.id_card idCard,a.birthday,
|
|
|
date_format(f.start_time, '%Y-%m-%d') contractStart,date_format(f.end_time,'%Y-%m-%d')contractEnd,
|
|
date_format(f.start_time, '%Y-%m-%d') contractStart,date_format(f.end_time,'%Y-%m-%d')contractEnd,
|
|
|
- a.mobile,a.fixed_tel fixedTel,a.id_card idCard,a.certification_authority certificationAuthority,
|
|
|
|
|
- a.residence_province residenceProvince,a.residence_city residenceCity,a.residence_area residenceArea,
|
|
|
|
|
- a.residence_address residenceAddress,a.native_place_province nativePlaceProvince,
|
|
|
|
|
- a.native_place_city nativePlaceCity,a.now_province nowProvince,a.now_city nowCity,a.now_area nowArea,
|
|
|
|
|
- a.now_address nowAddress,date_format(g.effect_time,'%Y-%m-%d') quitTime,
|
|
|
|
|
- TIMESTAMPDIFF(year,a.entry_time,now()) workingYear
|
|
|
|
|
|
|
+ a.certification_authority certificationAuthority, a.residence_province residenceProvince,
|
|
|
|
|
+ a.residence_city residenceCity,a.residence_area residenceArea, a.residence_address residenceAddress,
|
|
|
|
|
+ a.native_place_province nativePlaceProvince, a.native_place_city nativePlaceCity,a.now_province nowProvince,
|
|
|
|
|
+ a.now_city nowCity,a.now_area nowArea, a.now_address nowAddress,date_format(g.effect_time,'%Y-%m-%d') quitTime
|
|
|
from personnel_dossier a left join admin_level b on a.jobs=b.jobs and a.star=b.lvl
|
|
from personnel_dossier a left join admin_level b on a.jobs=b.jobs and a.star=b.lvl
|
|
|
|
|
+ left join department dep on a.company = dep.id
|
|
|
left join personnel_entry d on a.id=d.id left join (select id,pd_id,max(create_time)promotion_time,
|
|
left join personnel_entry d on a.id=d.id left join (select id,pd_id,max(create_time)promotion_time,
|
|
|
promotion_remarks from personnel_promotion group by pd_id) e on a.id=e.pd_id
|
|
promotion_remarks from personnel_promotion group by pd_id) e on a.id=e.pd_id
|
|
|
left join (select id,pd_id,start_time,end_time,max(create_time) from personnel_contract group by pd_id)f
|
|
left join (select id,pd_id,start_time,end_time,max(create_time) from personnel_contract group by pd_id)f
|
|
@@ -839,10 +839,10 @@
|
|
|
and a.promotion_time between #{i.promotionStart} and #{i.promotionEnd}
|
|
and a.promotion_time between #{i.promotionStart} and #{i.promotionEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.entryStart !=null and i.entryEnd !=null">
|
|
<if test="i.entryStart !=null and i.entryEnd !=null">
|
|
|
- and g.effect_time between #{i.entryStart} and #{i.entryEnd}
|
|
|
|
|
|
|
+ and a.entry_time between #{i.entryStart} and #{i.entryEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.system !=null">
|
|
<if test="i.system !=null">
|
|
|
- and a.`system`= #{system}
|
|
|
|
|
|
|
+ and a.`system`= #{i.system}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.workingYears ==0">
|
|
<if test="i.workingYears ==0">
|
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 0 and 1
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 0 and 1
|
|
@@ -857,7 +857,10 @@
|
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 10 and 99
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 10 and 99
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.quitStart !=null and i.quitEnd !=null">
|
|
<if test="i.quitStart !=null and i.quitEnd !=null">
|
|
|
- and f.end_time between #{i.quitStart} and #{i.quitEnd}
|
|
|
|
|
|
|
+ and g.effect_time between #{i.quitStart} and #{i.quitEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="i.contractStart !=null and i.contractEnd !=null">
|
|
|
|
|
+ and f.end_time between #{i.contractStart} and #{i.contractEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.education !=null">
|
|
<if test="i.education !=null">
|
|
|
and d.education= #{i.education}
|
|
and d.education= #{i.education}
|
|
@@ -873,8 +876,8 @@
|
|
|
from personnel_dossier a left join personnel_entry d on a.id=d.id left join (select id,pd_id,start_time,
|
|
from personnel_dossier a left join personnel_entry d on a.id=d.id left join (select id,pd_id,start_time,
|
|
|
end_time,max(create_time) from personnel_contract group by pd_id)f on a.id=f.pd_id
|
|
end_time,max(create_time) from personnel_contract group by pd_id)f on a.id=f.pd_id
|
|
|
left join (select id,pd_id,effect_time,max(create_time) from personnel_quit group by pd_id)g on a.id=g.pd_id
|
|
left join (select id,pd_id,effect_time,max(create_time) from personnel_quit group by pd_id)g on a.id=g.pd_id
|
|
|
- where 1=1
|
|
|
|
|
-<if test="i.name != null">
|
|
|
|
|
|
|
+ where 1=1
|
|
|
|
|
+ <if test="i.name != null">
|
|
|
and a.name like concat(#{i.name},'%')
|
|
and a.name like concat(#{i.name},'%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.company !=null">
|
|
<if test="i.company !=null">
|
|
@@ -899,10 +902,10 @@
|
|
|
and a.promotion_time between #{i.promotionStart} and #{i.promotionEnd}
|
|
and a.promotion_time between #{i.promotionStart} and #{i.promotionEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.entryStart !=null and i.entryEnd !=null">
|
|
<if test="i.entryStart !=null and i.entryEnd !=null">
|
|
|
- and g.effect_time between #{i.entryStart} and #{i.entryEnd}
|
|
|
|
|
|
|
+ and a.entry_time between #{i.entryStart} and #{i.entryEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.system !=null">
|
|
<if test="i.system !=null">
|
|
|
- and a.`system`= #{system}
|
|
|
|
|
|
|
+ and a.`system`= #{i.system}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.workingYears ==0">
|
|
<if test="i.workingYears ==0">
|
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 0 and 1
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 0 and 1
|
|
@@ -917,10 +920,31 @@
|
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 10 and 99
|
|
and TIMESTAMPDIFF(year,a.entry_time,now()) between 10 and 99
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.quitStart !=null and i.quitEnd !=null">
|
|
<if test="i.quitStart !=null and i.quitEnd !=null">
|
|
|
- and f.end_time between #{i.quitStart} and #{i.quitEnd}
|
|
|
|
|
|
|
+ and g.effect_time between #{i.quitStart} and #{i.quitEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="i.contractStart !=null and i.contractEnd !=null">
|
|
|
|
|
+ and f.end_time between #{i.contractStart} and #{i.contractEnd}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="i.education !=null">
|
|
<if test="i.education !=null">
|
|
|
and d.education= #{i.education}
|
|
and d.education= #{i.education}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <select id="selectBypdId" resultType="com.goafanti.personnel.bo.OutPersonnelBo">
|
|
|
|
|
+ select a.id,a.door_id doorId,a.name,a.status,a.`system`,a.company,dep.name depName,a.nation,
|
|
|
|
|
+ b.jobs_name jobsName,a.lvl,b.lvl_name starName,date_format(a.entry_time,'%Y-%m-%d')entryTimes,
|
|
|
|
|
+ date_format(a.promotion_time,'%Y-%m-%d')promotionTimes,date_format(a.birthday,'%Y-%m-%d')birthdays,
|
|
|
|
|
+ a.entry_time entryTime, a.sex,a.son,a.girl,a.political_outlook politicalOutlook,d.education,
|
|
|
|
|
+ d.school,d.major,d.title,e.promotion_remarks promotionRemarks,a.mobile,a.fixed_tel fixedTel,
|
|
|
|
|
+ date_format(e.promotion_time,'%Y-%m-%d') promotionTime,a.id_card idCard,a.birthday,a.allowance,
|
|
|
|
|
+ a.certification_authority certificationAuthority, a.residence_province residenceProvince,
|
|
|
|
|
+ a.residence_city residenceCity,a.residence_area residenceArea, a.residence_address residenceAddress,
|
|
|
|
|
+ a.native_place_province nativePlaceProvince, a.native_place_city nativePlaceCity,a.now_province nowProvince,
|
|
|
|
|
+ a.now_city nowCity,a.now_area nowArea, a.now_address nowAddress
|
|
|
|
|
+ from personnel_dossier a left join admin_level b on a.jobs=b.jobs and a.star=b.lvl
|
|
|
|
|
+ left join department dep on a.company = dep.id
|
|
|
|
|
+ left join personnel_entry d on a.id=d.id left join (select id,pd_id,max(create_time)promotion_time,
|
|
|
|
|
+ promotion_remarks from personnel_promotion group by pd_id) e on a.id=e.pd_id
|
|
|
|
|
+ where 1=1
|
|
|
|
|
+ and a.id= #{id}
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|