|
@ -8,22 +8,22 @@ |
|
|
resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoAppContactsVo"> |
|
|
resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoAppContactsVo"> |
|
|
SELECT staff.sid, staff.name, staff.mobile, staff.pinYinName, staff.firstPinYinLabel, user.headImage |
|
|
SELECT staff.sid, staff.name, staff.mobile, staff.pinYinName, staff.firstPinYinLabel, user.headImage |
|
|
FROM sys_staffinfo staff |
|
|
FROM sys_staffinfo staff |
|
|
LEFT JOIN sys_user user |
|
|
LEFT JOIN sys_user user |
|
|
ON staff.sid = user.staffSid |
|
|
ON staff.sid = user.staffSid |
|
|
ORDER BY staff.firstPinYinLabel = '#', staff.firstPinYinLabel ASC, staff.pinYinName |
|
|
ORDER BY staff.firstPinYinLabel = '#', staff.firstPinYinLabel ASC, staff.pinYinName |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="searchAppContactsPageList" |
|
|
<select id="searchAppContactsPageList" |
|
|
resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoAppContactsSearchVo"> |
|
|
resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoAppContactsSearchVo"> |
|
|
SELECT staff.sid, |
|
|
SELECT staff.sid, |
|
|
staff.name, |
|
|
staff.name, |
|
|
staff.mobile, |
|
|
staff.mobile, |
|
|
staff.position, |
|
|
staff.position, |
|
|
user.headImage, |
|
|
user.headImage, |
|
|
GROUP_CONCAT(org.orgName SEPARATOR '/') orgName |
|
|
GROUP_CONCAT(org.orgName SEPARATOR '/') orgName |
|
|
FROM sys_staffinfo staff |
|
|
FROM sys_staffinfo staff |
|
|
LEFT JOIN sys_staff_org org ON org.staffSid = staff.sid |
|
|
LEFT JOIN sys_staff_org org ON org.staffSid = staff.sid |
|
|
LEFT JOIN sys_user user ON staff.sid = user.staffSid |
|
|
LEFT JOIN sys_user user ON staff.sid = user.staffSid |
|
|
WHERE 1 = 1 |
|
|
WHERE 1 = 1 |
|
|
<if test="mobileStr != null and mobileStr != ''"> |
|
|
<if test="mobileStr != null and mobileStr != ''"> |
|
|
AND staff.mobile LIKE concat('%', #{mobileStr}, '%') |
|
|
AND staff.mobile LIKE concat('%', #{mobileStr}, '%') |
|
@ -48,9 +48,9 @@ |
|
|
staff.position, |
|
|
staff.position, |
|
|
GROUP_CONCAT(org.orgNamePath SEPARATOR '/') orgNamePath |
|
|
GROUP_CONCAT(org.orgNamePath SEPARATOR '/') orgNamePath |
|
|
FROM sys_staffinfo staff |
|
|
FROM sys_staffinfo staff |
|
|
LEFT JOIN sys_user user |
|
|
LEFT JOIN sys_user user |
|
|
ON staff.sid = user.staffSid |
|
|
ON staff.sid = user.staffSid |
|
|
LEFT JOIN sys_staff_org org ON staff.sid = org.staffSid |
|
|
LEFT JOIN sys_staff_org org ON staff.sid = org.staffSid |
|
|
WHERE staff.sid = #{staffSid} |
|
|
WHERE staff.sid = #{staffSid} |
|
|
GROUP BY staff.sid |
|
|
GROUP BY staff.sid |
|
|
</select> |
|
|
</select> |
|
@ -66,16 +66,17 @@ |
|
|
IFNULL(NULL, '3') AS type, |
|
|
IFNULL(NULL, '3') AS type, |
|
|
IFNULL(NULL, 0) AS staffNum |
|
|
IFNULL(NULL, 0) AS staffNum |
|
|
FROM sys_staff_org org |
|
|
FROM sys_staff_org org |
|
|
INNER JOIN sys_staffinfo staff ON org.staffSid = staff.sid |
|
|
INNER JOIN sys_staffinfo staff ON org.staffSid = staff.sid |
|
|
LEFT JOIN sys_user user |
|
|
LEFT JOIN sys_user user |
|
|
ON staff.sid = user.staffSid |
|
|
ON staff.sid = user.staffSid |
|
|
WHERE org.orgSid = #{sid} |
|
|
WHERE org.orgSid = #{sid} |
|
|
</select> |
|
|
</select> |
|
|
<!--根据员工类型key查询员工工号的最大号--> |
|
|
<!--根据员工类型key查询员工工号的最大号--> |
|
|
<select id="selectJobNumber" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo"> |
|
|
<select id="selectJobNumber" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo"> |
|
|
select * |
|
|
select * |
|
|
from sys_staffinfo |
|
|
from sys_staffinfo |
|
|
order by jobNumber desc limit 1 |
|
|
order by jobNumber desc |
|
|
|
|
|
limit 1 |
|
|
</select> |
|
|
</select> |
|
|
<!--根据手机号查询员工是否重复--> |
|
|
<!--根据手机号查询员工是否重复--> |
|
|
<select id="selectByMobile" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo"> |
|
|
<select id="selectByMobile" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo"> |
|
@ -104,21 +105,24 @@ |
|
|
DATE_FORMAT(si.joinCompnyDate, '%Y-%m-%d') AS joinCompnyDate, |
|
|
DATE_FORMAT(si.joinCompnyDate, '%Y-%m-%d') AS joinCompnyDate, |
|
|
<!--所在部门--> |
|
|
<!--所在部门--> |
|
|
(select GROUP_CONCAT(orgName SEPARATOR ',') orgName from sys_staff_org so where so.staffSid = si.sid) as |
|
|
(select GROUP_CONCAT(orgName SEPARATOR ',') orgName from sys_staff_org so where so.staffSid = si.sid) as |
|
|
orgName, |
|
|
orgName, |
|
|
<!--所在部门sid--> |
|
|
<!--所在部门sid--> |
|
|
(select GROUP_CONCAT(orgSid SEPARATOR ',') orgSid from sys_staff_org so where so.staffSid = si.sid) as |
|
|
(select GROUP_CONCAT(orgSid SEPARATOR ',') orgSid from sys_staff_org so where so.staffSid = si.sid) as |
|
|
orgSid, |
|
|
orgSid, |
|
|
<!--岗位--> |
|
|
<!--岗位--> |
|
|
(select GROUP_CONCAT(sp.name SEPARATOR ',') postName from sys_staff_post ssp left |
|
|
(select GROUP_CONCAT(sp.name SEPARATOR ',') postName |
|
|
join sys_post sp on |
|
|
from sys_staff_post ssp |
|
|
sp.sid = |
|
|
left join sys_post sp on |
|
|
ssp.postSid where ssp.staffSid = si.sid group by ssp.id) as postName |
|
|
sp.sid = |
|
|
|
|
|
ssp.postSid |
|
|
|
|
|
where ssp.staffSid = si.sid |
|
|
|
|
|
group by ssp.id) as postName |
|
|
from sys_staffinfo si |
|
|
from sys_staffinfo si |
|
|
LEFT JOIN sys_staff_org so |
|
|
LEFT JOIN sys_staff_org so |
|
|
ON so.staffSid = si.sid |
|
|
ON so.staffSid = si.sid |
|
|
LEFT JOIN sys_staff_post ssp |
|
|
LEFT JOIN sys_staff_post ssp |
|
|
ON ssp.staffSid = si.sid |
|
|
ON ssp.staffSid = si.sid |
|
|
${ew.customSqlSegment} |
|
|
${ew.customSqlSegment} |
|
|
</select> |
|
|
</select> |
|
|
<!--根据员工手机号和sid查询员工信息是否已存在--> |
|
|
<!--根据员工手机号和sid查询员工信息是否已存在--> |
|
|
<select id="selectByMobileAndSid" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo"> |
|
|
<select id="selectByMobileAndSid" resultType="com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo"> |
|
@ -206,27 +210,27 @@ |
|
|
<!--开户行--> |
|
|
<!--开户行--> |
|
|
openBank, |
|
|
openBank, |
|
|
<!--身份证(人像面)--> |
|
|
<!--身份证(人像面)--> |
|
|
IF(idCardA = "",idCardA,CONCAT(#{path}, idCardA)) AS idCardA, |
|
|
IF(idCardA = "", idCardA, CONCAT(#{path}, idCardA)) AS idCardA, |
|
|
<!--NULLIF(idCardA,CONCAT(#{path}, idCardA) as idCardA),--> |
|
|
<!--NULLIF(idCardA,CONCAT(#{path}, idCardA) as idCardA),--> |
|
|
<!--when idCardA is null then idCardA else concat(#{path}, idCardA) as idCardA end,--> |
|
|
<!--when idCardA is null then idCardA else concat(#{path}, idCardA) as idCardA end,--> |
|
|
<!--身份证(国徽面)--> |
|
|
<!--身份证(国徽面)--> |
|
|
IF(idCardB = "",idCardB,CONCAT(#{path}, idCardB)) AS idCardB, |
|
|
IF(idCardB = "", idCardB, CONCAT(#{path}, idCardB)) AS idCardB, |
|
|
<!--NULLIF(idCardB,concat(#{path}, idCardB) as idCardB),--> |
|
|
<!--NULLIF(idCardB,concat(#{path}, idCardB) as idCardB),--> |
|
|
<!--when idCardB is null then idCardB else concat(#{path}, idCardB) as idCardB end,--> |
|
|
<!--when idCardB is null then idCardB else concat(#{path}, idCardB) as idCardB end,--> |
|
|
<!--学历证书--> |
|
|
<!--学历证书--> |
|
|
IF(diploma = "",diploma,CONCAT(#{path}, diploma)) AS diploma, |
|
|
IF(diploma = "", diploma, CONCAT(#{path}, diploma)) AS diploma, |
|
|
<!--NULLIF(CONCAT(#{path}, diploma) as diploma,diploma),--> |
|
|
<!--NULLIF(CONCAT(#{path}, diploma) as diploma,diploma),--> |
|
|
<!--when diploma is null then diploma else concat(#{path}, diploma) as diploma end,--> |
|
|
<!--when diploma is null then diploma else concat(#{path}, diploma) as diploma end,--> |
|
|
<!--学位证书--> |
|
|
<!--学位证书--> |
|
|
IF(degreeCertificate = "",degreeCertificate,CONCAT(#{path}, degreeCertificate)) AS degreeCertificate, |
|
|
IF(degreeCertificate = "", degreeCertificate, CONCAT(#{path}, degreeCertificate)) AS degreeCertificate, |
|
|
<!--NULLIF(CONCAT(#{path}, degreeCertificate) as degreeCertificate,degreeCertificate),--> |
|
|
<!--NULLIF(CONCAT(#{path}, degreeCertificate) as degreeCertificate,degreeCertificate),--> |
|
|
<!--when degreeCertificate is null then degreeCertificate else concat(#{path}, degreeCertificate) as degreeCertificate end,--> |
|
|
<!--when degreeCertificate is null then degreeCertificate else concat(#{path}, degreeCertificate) as degreeCertificate end,--> |
|
|
<!--前公司离职证明--> |
|
|
<!--前公司离职证明--> |
|
|
IF(leaveCertificate = "",leaveCertificate,CONCAT(#{path}, leaveCertificate)) AS leaveCertificate, |
|
|
IF(leaveCertificate = "", leaveCertificate, CONCAT(#{path}, leaveCertificate)) AS leaveCertificate, |
|
|
<!--NULLIF(CONCAT(#{path}, leaveCertificate) as leaveCertificate,leaveCertificate),--> |
|
|
<!--NULLIF(CONCAT(#{path}, leaveCertificate) as leaveCertificate,leaveCertificate),--> |
|
|
<!--when leaveCertificate is null then leaveCertificate else concat(#{path}, leaveCertificate) as leaveCertificate end,--> |
|
|
<!--when leaveCertificate is null then leaveCertificate else concat(#{path}, leaveCertificate) as leaveCertificate end,--> |
|
|
<!--员工照片--> |
|
|
<!--员工照片--> |
|
|
IF(photo = "",photo,CONCAT(#{path}, photo)) AS photo, |
|
|
IF(photo = "", photo, CONCAT(#{path}, photo)) AS photo, |
|
|
<!--NULLIF(CONCAT(#{path}, photo) as photo,photo),--> |
|
|
<!--NULLIF(CONCAT(#{path}, photo) as photo,photo),--> |
|
|
<!--when photo is null then photo else concat(#{path}, photo) as photo end,--> |
|
|
<!--when photo is null then photo else concat(#{path}, photo) as photo end,--> |
|
|
<!--毕业院校--> |
|
|
<!--毕业院校--> |
|
@ -245,8 +249,9 @@ |
|
|
<!--意外险参保:1是,0否--> |
|
|
<!--意外险参保:1是,0否--> |
|
|
isHaveInsurance, |
|
|
isHaveInsurance, |
|
|
<!--意外险参保:1是,0否--> |
|
|
<!--意外险参保:1是,0否--> |
|
|
case isHaveInsurance when 1 then '是' |
|
|
case isHaveInsurance |
|
|
when 0 then '否' end as isHaveInsuranceValue, |
|
|
when 1 then '是' |
|
|
|
|
|
when 0 then '否' end as isHaveInsuranceValue, |
|
|
<!--意外险参保时间--> |
|
|
<!--意外险参保时间--> |
|
|
DATE_FORMAT(insuranceStartDate, '%Y-%m-%d') as insuranceStartDate, |
|
|
DATE_FORMAT(insuranceStartDate, '%Y-%m-%d') as insuranceStartDate, |
|
|
<!--意外险参保终止日期--> |
|
|
<!--意外险参保终止日期--> |
|
@ -256,23 +261,27 @@ |
|
|
<!--养老:1是,0否--> |
|
|
<!--养老:1是,0否--> |
|
|
isHaveAged, |
|
|
isHaveAged, |
|
|
<!--养老:1是,0否--> |
|
|
<!--养老:1是,0否--> |
|
|
case isHaveAged when 1 then '是' |
|
|
case isHaveAged |
|
|
when 0 then '否' end as isHaveAgedValue, |
|
|
when 1 then '是' |
|
|
|
|
|
when 0 then '否' end as isHaveAgedValue, |
|
|
<!--医疗:1是,0否--> |
|
|
<!--医疗:1是,0否--> |
|
|
isHaveMedical, |
|
|
isHaveMedical, |
|
|
<!--医疗:1是,0否--> |
|
|
<!--医疗:1是,0否--> |
|
|
case isHaveMedical when 1 then '是' |
|
|
case isHaveMedical |
|
|
when 0 then '否' end as isHaveMedicalValue, |
|
|
when 1 then '是' |
|
|
|
|
|
when 0 then '否' end as isHaveMedicalValue, |
|
|
<!--工伤:1是,0否--> |
|
|
<!--工伤:1是,0否--> |
|
|
isHaveInjury, |
|
|
isHaveInjury, |
|
|
<!--工伤:1是,0否--> |
|
|
<!--工伤:1是,0否--> |
|
|
case isHaveInjury when 1 then '是' |
|
|
case isHaveInjury |
|
|
when 0 then '否' end as isHaveInjuryValue, |
|
|
when 1 then '是' |
|
|
|
|
|
when 0 then '否' end as isHaveInjuryValue, |
|
|
<!--失业:1是,0否--> |
|
|
<!--失业:1是,0否--> |
|
|
isHaveUnemploy, |
|
|
isHaveUnemploy, |
|
|
<!--失业:1是,0否--> |
|
|
<!--失业:1是,0否--> |
|
|
case isHaveUnemploy when 1 then '是' |
|
|
case isHaveUnemploy |
|
|
when 0 then '否' end as isHaveUnemployValue, |
|
|
when 1 then '是' |
|
|
|
|
|
when 0 then '否' end as isHaveUnemployValue, |
|
|
<!--社保参保地--> |
|
|
<!--社保参保地--> |
|
|
insuredPlace, |
|
|
insuredPlace, |
|
|
<!--纸质档案保管地--> |
|
|
<!--纸质档案保管地--> |
|
@ -301,7 +310,7 @@ |
|
|
<select id="selectStaffList" resultType="com.yxt.anrui.portal.api.sysstaffinfo.PcSysStaffVo"> |
|
|
<select id="selectStaffList" resultType="com.yxt.anrui.portal.api.sysstaffinfo.PcSysStaffVo"> |
|
|
select sso.staffSid, si.name staffName |
|
|
select sso.staffSid, si.name staffName |
|
|
from sys_staff_org sso |
|
|
from sys_staff_org sso |
|
|
left join sys_staffinfo si on sso.staffSid = si.sid |
|
|
left join sys_staffinfo si on sso.staffSid = si.sid |
|
|
where find_in_set(#{orgSid}, replace(sso.orgSidPath, '/', ',')) |
|
|
where find_in_set(#{orgSid}, replace(sso.orgSidPath, '/', ',')) |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
@ -311,13 +320,34 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="getStaffNameByDeptSid" resultType="java.util.Map"> |
|
|
<select id="getStaffNameByDeptSid" resultType="java.util.Map"> |
|
|
SELECT DISTINCT |
|
|
SELECT DISTINCT ss.sid, |
|
|
ss.sid, |
|
|
ss.name |
|
|
ss.name |
|
|
FROM sys_staffinfo ss |
|
|
FROM |
|
|
LEFT JOIN sys_staff_org sso |
|
|
sys_staffinfo ss |
|
|
ON ss.`sid` = sso.`staffSid` |
|
|
LEFT JOIN sys_staff_org sso |
|
|
${ew.customSqlSegment} |
|
|
ON ss.`sid` = sso.`staffSid` |
|
|
</select> |
|
|
${ew.customSqlSegment} |
|
|
|
|
|
|
|
|
<select id="getUserList" resultType="com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo"> |
|
|
|
|
|
select su.sid userSid, |
|
|
|
|
|
si.name userName, |
|
|
|
|
|
su.headImage, |
|
|
|
|
|
si.mobile userMobile, |
|
|
|
|
|
sso.orgName as department, |
|
|
|
|
|
sp.name |
|
|
|
|
|
from sys_staff_org sso |
|
|
|
|
|
left join sys_staffinfo si on sso.staffSid = si.sid |
|
|
|
|
|
left join sys_user su on si.sid = su.staffSid |
|
|
|
|
|
left join sys_staff_post ssp on si.sid = ssp.staffSid |
|
|
|
|
|
left join sys_post sp on sp.sid = ssp.postSid |
|
|
|
|
|
<where> |
|
|
|
|
|
${ew.sqlSegment} |
|
|
|
|
|
<if test="orgSid != null and orgSid != ''"> |
|
|
|
|
|
and find_in_set(#{orgSid} |
|
|
|
|
|
, replace (sso.orgSidPath |
|
|
|
|
|
, '/' |
|
|
|
|
|
, ',')) |
|
|
|
|
|
</if> |
|
|
|
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |