2022-03-10 17:57:46 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
|
|
<mapper namespace="com.engine.salary.mapper.datacollection.EmployMapper">
|
|
|
|
|
<!-- 员工基本信息 -->
|
|
|
|
|
<select id="listEmployee" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.ID as employeeId,
|
|
|
|
|
e.LASTNAME as username,
|
2022-06-01 19:13:20 +08:00
|
|
|
d.DEPARTMENTNAME as departmentName,
|
2022-06-10 15:12:56 +08:00
|
|
|
e.status,
|
2022-09-15 15:31:34 +08:00
|
|
|
e.mobile,
|
2023-09-06 10:04:58 +08:00
|
|
|
e.workcode,
|
2024-05-28 11:18:19 +08:00
|
|
|
e.certificatenum as idNo,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2023-09-06 10:04:58 +08:00
|
|
|
'false' as extEmp
|
2022-03-10 17:57:46 +08:00
|
|
|
from hrmresource e
|
|
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
2022-07-11 17:31:33 +08:00
|
|
|
where e.status not in (7)
|
2024-10-15 14:24:37 +08:00
|
|
|
|
2022-03-10 17:57:46 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getEmployeeByIds" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
2022-05-30 17:31:29 +08:00
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2022-06-10 13:33:48 +08:00
|
|
|
e.certificatenum as idNo,
|
2022-05-30 17:31:29 +08:00
|
|
|
e.status as status,
|
|
|
|
|
e.workcode as workcode,
|
|
|
|
|
e.companystartdate as companystartdate,
|
2023-04-23 10:14:32 +08:00
|
|
|
e.mobile as mobile,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2023-04-23 10:14:32 +08:00
|
|
|
e.workyear as workYear
|
2022-03-10 17:57:46 +08:00
|
|
|
from hrmresource e
|
2024-10-15 14:24:37 +08:00
|
|
|
where e.status not in (7)
|
2022-03-10 17:57:46 +08:00
|
|
|
<if test="collection != null and collection.size()>0">
|
2022-03-11 13:44:47 +08:00
|
|
|
AND e.id IN
|
2022-03-10 17:57:46 +08:00
|
|
|
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-07-26 16:35:51 +08:00
|
|
|
<select id="getEmployeeByIdsIncludeAccountType"
|
|
|
|
|
resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
2024-06-26 11:33:12 +08:00
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2024-06-26 11:33:12 +08:00
|
|
|
e.certificatenum as idNo,
|
|
|
|
|
e.status as status,
|
|
|
|
|
e.workcode as workcode,
|
|
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2024-06-26 11:33:12 +08:00
|
|
|
e.workyear as workYear
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where e.status not in (7)
|
|
|
|
|
<if test="collection != null and collection.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-03-10 17:57:46 +08:00
|
|
|
|
2022-03-15 17:39:19 +08:00
|
|
|
<select id="getEmployeeByIdsAll" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
d.departmentname as departmentName,
|
2022-04-07 16:54:10 +08:00
|
|
|
d.id as departmentId,
|
2022-11-25 15:54:31 +08:00
|
|
|
sc.SUBCOMPANYNAME as subcompanyName,
|
2023-04-26 15:17:08 +08:00
|
|
|
sc.id as subcompanyid,
|
2022-03-15 17:39:19 +08:00
|
|
|
c.jobtitlename as jobtitleName,
|
2022-04-29 14:17:31 +08:00
|
|
|
c.id as jobtitleId,
|
2022-03-15 17:39:19 +08:00
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
2022-11-25 15:54:31 +08:00
|
|
|
e.status as status,
|
|
|
|
|
e.workcode as workcode,
|
|
|
|
|
e.sex as sex,
|
|
|
|
|
e.email as email,
|
|
|
|
|
e.telephone as telephone,
|
2024-05-08 15:31:36 +08:00
|
|
|
e.jobcall as jobcallId,
|
|
|
|
|
job.name as jobcall,
|
2022-11-25 15:54:31 +08:00
|
|
|
e.birthday as birthday,
|
|
|
|
|
e.certificatenum as idNo,
|
2023-04-27 16:05:03 +08:00
|
|
|
e.enddate as dismissdate,
|
|
|
|
|
e.workyear,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2023-04-27 16:05:03 +08:00
|
|
|
e.companyworkyear
|
2022-03-15 17:39:19 +08:00
|
|
|
from hrmresource e
|
|
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
|
|
|
|
left join hrmjobtitles c on e.jobtitle = c.id
|
2022-08-29 14:50:26 +08:00
|
|
|
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
2024-05-08 15:31:36 +08:00
|
|
|
left join hrmjobcall job on e.jobcall=job.id
|
2024-10-15 14:24:37 +08:00
|
|
|
where e.status not in (7)
|
2022-03-15 17:39:19 +08:00
|
|
|
<if test="collection != null and collection.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
2022-03-23 18:41:38 +08:00
|
|
|
<select id="listPositionInfo" resultType="com.engine.salary.entity.hrm.PositionInfo">
|
|
|
|
|
select t.id,
|
|
|
|
|
t.jobtitlename as name
|
|
|
|
|
from hrmjobtitles t
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="collection != null and collection.size()>0">
|
|
|
|
|
AND t.id IN
|
|
|
|
|
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-07-25 14:04:14 +08:00
|
|
|
<select id="getPositionInfoById" resultType="com.engine.salary.entity.hrm.PositionInfo">
|
|
|
|
|
select t.id,
|
|
|
|
|
t.jobtitlename as name
|
|
|
|
|
from hrmjobtitles t
|
|
|
|
|
where t.id = #{positionId}
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-04-07 16:54:10 +08:00
|
|
|
<select id="listByParams" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
2022-04-08 16:30:10 +08:00
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2022-05-25 16:51:43 +08:00
|
|
|
e.certificatenum as idNo,
|
2022-04-08 16:30:10 +08:00
|
|
|
e.workcode as workcode,
|
|
|
|
|
d.departmentname as departmentName,
|
|
|
|
|
d.id as departmentId,
|
|
|
|
|
c.jobtitlename as jobtitleName,
|
2022-04-29 14:17:31 +08:00
|
|
|
c.id as jobtitleId,
|
2022-04-08 16:30:10 +08:00
|
|
|
e.companystartdate as companystartdate,
|
2024-06-18 11:01:58 +08:00
|
|
|
e.mobile as mobile,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2024-06-18 11:01:58 +08:00
|
|
|
sc.SUBCOMPANYNAME as subcompanyName,
|
|
|
|
|
sc.id as subcompanyid,
|
|
|
|
|
job.id as jobcallId,
|
|
|
|
|
job.name as jobcall
|
2022-04-07 16:54:10 +08:00
|
|
|
from hrmresource e
|
2024-06-18 11:01:58 +08:00
|
|
|
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
2022-04-07 16:54:10 +08:00
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
|
|
|
|
left join hrmjobtitles c on e.jobtitle = c.id
|
2024-06-18 11:01:58 +08:00
|
|
|
left join hrmjobcall job on e.jobcall=job.id
|
2024-10-15 14:24:37 +08:00
|
|
|
WHERE e.status not in (7)
|
2022-04-07 16:54:10 +08:00
|
|
|
<if test="params != null and params.size() > 0">
|
|
|
|
|
AND ( 1=2
|
|
|
|
|
<foreach collection="params" item="param">
|
|
|
|
|
OR
|
|
|
|
|
(
|
|
|
|
|
<if test="param.targetType == 'EMPLOYEE'">
|
|
|
|
|
e.id IN
|
|
|
|
|
<foreach collection="param.targetIds" open="(" item="targetId" separator="," close=")">
|
|
|
|
|
#{targetId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.targetType == 'DEPT'">
|
|
|
|
|
d.id IN
|
|
|
|
|
<foreach collection="param.targetIds" open="(" item="targetId" separator="," close=")">
|
|
|
|
|
#{targetId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.targetType == 'POSITION'">
|
|
|
|
|
c.id IN
|
|
|
|
|
<foreach collection="param.targetIds" open="(" item="targetId" separator="," close=")">
|
|
|
|
|
#{targetId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
2022-06-08 16:36:50 +08:00
|
|
|
<if test="param.targetType == 'SUBCOMPANY'">
|
|
|
|
|
e.subcompanyid1 IN
|
|
|
|
|
<foreach collection="param.targetIds" open="(" item="targetId" separator="," close=")">
|
|
|
|
|
#{targetId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
2022-04-07 16:54:10 +08:00
|
|
|
<if test="param.employeeStatus != null and param.employeeStatus.size() > 0">
|
|
|
|
|
AND e.status IN
|
|
|
|
|
<foreach collection="param.employeeStatus" open="(" item="status" separator="," close=")">
|
|
|
|
|
#{status}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-03-22 15:23:03 +08:00
|
|
|
<select id="listByVirtualParams" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select h.id as employeeId,
|
|
|
|
|
h.lastname as username,
|
|
|
|
|
h.status as status,
|
|
|
|
|
h.certificatenum as idNo,
|
|
|
|
|
h.workcode as workcode,
|
|
|
|
|
h.companystartdate as companystartdate,
|
2024-10-15 14:24:37 +08:00
|
|
|
h.accounttype as accountType,
|
2024-03-22 15:23:03 +08:00
|
|
|
h.mobile as mobile
|
|
|
|
|
from hrmresourcevirtual v
|
|
|
|
|
left join hrmresource h on v.resourceid=h.id
|
2024-10-15 14:24:37 +08:00
|
|
|
WHERE h.status not in (7)
|
2024-03-22 15:23:03 +08:00
|
|
|
<if test="params != null and params.size() > 0">
|
|
|
|
|
AND ( 1=2
|
|
|
|
|
<foreach collection="params" item="param">
|
|
|
|
|
OR
|
|
|
|
|
(
|
|
|
|
|
<if test="param.targetType == 'DEPT'">
|
|
|
|
|
v.departmentid IN
|
|
|
|
|
<foreach collection="param.targetIds" open="(" item="targetId" separator="," close=")">
|
|
|
|
|
#{targetId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.targetType == 'SUBCOMPANY'">
|
|
|
|
|
v.subcompanyid IN
|
|
|
|
|
<foreach collection="param.targetIds" open="(" item="targetId" separator="," close=")">
|
|
|
|
|
#{targetId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="param.employeeStatus != null and param.employeeStatus.size() > 0">
|
|
|
|
|
AND h.status IN
|
|
|
|
|
<foreach collection="param.employeeStatus" open="(" item="status" separator="," close=")">
|
|
|
|
|
#{status}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-03-23 18:41:38 +08:00
|
|
|
|
2022-04-08 19:08:59 +08:00
|
|
|
<select id="getEmployeeById" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2022-07-11 17:31:33 +08:00
|
|
|
e.certificatenum as idNo,
|
2022-04-08 19:08:59 +08:00
|
|
|
e.workcode as workcode,
|
|
|
|
|
d.departmentname as departmentName,
|
|
|
|
|
d.id as departmentId,
|
|
|
|
|
c.jobtitlename as jobtitleName,
|
2022-04-29 14:17:31 +08:00
|
|
|
c.id as jobtitleId,
|
2022-04-08 19:08:59 +08:00
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
2023-04-20 17:55:37 +08:00
|
|
|
e.enddate as dismissdate,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2023-04-20 17:55:37 +08:00
|
|
|
sc.SUBCOMPANYNAME as subcompanyName,
|
2023-04-20 18:04:18 +08:00
|
|
|
sc.id as subcompanyid
|
2022-04-08 19:08:59 +08:00
|
|
|
from hrmresource e
|
|
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
2023-04-20 17:55:37 +08:00
|
|
|
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
|
2022-04-08 19:08:59 +08:00
|
|
|
left join hrmjobtitles c on e.jobtitle = c.id
|
2022-07-11 17:31:33 +08:00
|
|
|
where e.status not in (7)
|
2024-10-15 14:24:37 +08:00
|
|
|
|
2022-04-08 19:08:59 +08:00
|
|
|
AND e.id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-04-12 19:29:19 +08:00
|
|
|
|
|
|
|
|
<sql id="paramSql">
|
|
|
|
|
<!-- 关键字(姓名、 -->
|
|
|
|
|
<if test="userName != null and userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
a.lastname like CONCAT('%',#{userName},'%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="paramSql" databaseId="oracle">
|
|
|
|
|
<if test="userName != null and userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
2022-05-24 09:14:26 +08:00
|
|
|
a.lastname like '%'||#{userName}||'%'
|
2022-04-12 19:29:19 +08:00
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="paramSql" databaseId="sqlserver">
|
|
|
|
|
<if test="userName != null and userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
a.lastname like '%'+#{userName}+'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
2022-06-01 17:45:49 +08:00
|
|
|
<select id="listAllFields" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
2022-05-18 09:19:50 +08:00
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
|
|
|
|
e.workcode as workcode,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2022-07-11 17:31:33 +08:00
|
|
|
e.certificatenum as idNo,
|
2022-06-01 17:45:49 +08:00
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2022-07-11 17:31:33 +08:00
|
|
|
e.subcompanyid1 as subcompanyid,
|
2022-05-18 09:19:50 +08:00
|
|
|
d.departmentname as departmentName,
|
|
|
|
|
d.id as departmentId,
|
|
|
|
|
c.jobtitlename as jobtitleName,
|
2022-06-01 17:45:49 +08:00
|
|
|
c.id as jobtitleId
|
2022-05-18 09:19:50 +08:00
|
|
|
from hrmresource e
|
|
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
|
|
|
|
left join hrmjobtitles c on e.jobtitle = c.id
|
|
|
|
|
where e.status not in (7)
|
2022-11-22 15:37:07 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listAll" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
|
|
|
|
e.workcode as workcode,
|
|
|
|
|
e.certificatenum as idNo,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2022-11-22 15:37:07 +08:00
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2022-11-22 15:37:07 +08:00
|
|
|
e.subcompanyid1 as subcompanyid,
|
|
|
|
|
e.departmentid as departmentId,
|
2023-08-04 15:07:41 +08:00
|
|
|
d.DEPARTMENTNAME as departmentName,
|
2022-11-22 15:37:07 +08:00
|
|
|
e.jobtitle as jobtitleId
|
|
|
|
|
from hrmresource e
|
2023-08-04 15:07:41 +08:00
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
2022-11-22 15:37:07 +08:00
|
|
|
where e.status not in (7)
|
2024-10-15 14:24:37 +08:00
|
|
|
|
2022-07-11 17:31:33 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="listAllForReport" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
|
|
|
|
e.workcode as workcode,
|
|
|
|
|
e.certificatenum as idNo,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2022-07-11 17:31:33 +08:00
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
|
|
|
|
e.departmentid as departmentId,
|
|
|
|
|
e.subcompanyid1 as subcompanyid,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2022-07-11 17:31:33 +08:00
|
|
|
e.costcenterid as costcenterId,
|
|
|
|
|
e.locationid as locationId,
|
2022-08-25 16:46:12 +08:00
|
|
|
e.jobtitle as jobtitleId,
|
|
|
|
|
d.departmentname as departmentName,
|
|
|
|
|
d.id as departmentId
|
2022-07-11 17:31:33 +08:00
|
|
|
from hrmresource e
|
2022-08-25 16:46:12 +08:00
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
2022-07-11 17:31:33 +08:00
|
|
|
where e.status not in (7)
|
2024-10-15 14:24:37 +08:00
|
|
|
|
2022-05-18 09:19:50 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
2022-05-24 09:14:26 +08:00
|
|
|
<select id="getDeptInfoList" resultType="com.engine.salary.entity.hrm.DeptInfo">
|
|
|
|
|
select d.departmentname as name,
|
2022-05-25 16:51:43 +08:00
|
|
|
d.id as id
|
2022-05-24 09:14:26 +08:00
|
|
|
from hrmdepartment d
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="departmentIds != null and departmentIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="departmentIds" open="(" item="departmentId" separator="," close=")">
|
|
|
|
|
#{departmentId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-03-22 15:23:03 +08:00
|
|
|
<select id="getVirtualDeptInfoList" resultType="com.engine.salary.entity.hrm.DeptInfo">
|
|
|
|
|
select d.departmentname as name,
|
|
|
|
|
d.id as id
|
|
|
|
|
from hrmdepartmentvirtual d
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="virtualDepartmentIds != null and virtualDepartmentIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="virtualDepartmentIds" open="(" item="virtualDepartmentId" separator="," close=")">
|
|
|
|
|
#{virtualDepartmentId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-05-24 09:14:26 +08:00
|
|
|
<select id="getSubCompanyInfoList" resultType="com.engine.salary.entity.hrm.SubCompanyInfo">
|
|
|
|
|
select d.subcompanyname as name,
|
2022-05-25 16:51:43 +08:00
|
|
|
d.id as id
|
2022-05-24 09:14:26 +08:00
|
|
|
from hrmsubcompany d
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="subDepartmentIds != null and subDepartmentIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="subDepartmentIds" open="(" item="subDepartmentId" separator="," close=")">
|
|
|
|
|
#{subDepartmentId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-07-25 14:04:14 +08:00
|
|
|
<select id="getSubCompanyInfoById" resultType="com.engine.salary.entity.hrm.SubCompanyInfo">
|
|
|
|
|
select d.subcompanyname as name,
|
|
|
|
|
d.id as id
|
|
|
|
|
from hrmsubcompany d
|
|
|
|
|
where d.id = #{subDepartmentId}
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-03-22 15:23:03 +08:00
|
|
|
<select id="getVirtualSubCompanyInfoList" resultType="com.engine.salary.entity.hrm.SubCompanyInfo">
|
|
|
|
|
select d.subcompanyname as name,
|
|
|
|
|
d.id as id
|
|
|
|
|
from hrmsubcompanyvirtual d
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="virtualSubCompanyIds != null and virtualSubCompanyIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="virtualSubCompanyIds" open="(" item="virtualSubCompanyId" separator="," close=")">
|
|
|
|
|
#{virtualSubCompanyId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-11-21 15:27:15 +08:00
|
|
|
<select id="listHrmInfoByIdAndName" resultType="com.engine.salary.entity.hrm.dto.HrmInfoDTO">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.userName != null and param.userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like CONCAT('%',#{param.userName},'%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listHrmInfoByIdAndName" resultType="com.engine.salary.entity.hrm.dto.HrmInfoDTO" databaseId="sqlserver">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.userName != null and param.userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like '%'+#{param.userName}+'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listHrmInfoByIdAndName" resultType="com.engine.salary.entity.hrm.dto.HrmInfoDTO" databaseId="oracle">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.userName != null and param.userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like '%'||#{param.userName}||'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
2022-05-24 09:14:26 +08:00
|
|
|
|
2023-07-28 10:12:59 +08:00
|
|
|
<select id="getDeptInfosByName" resultType="com.engine.salary.entity.hrm.DeptInfo">
|
|
|
|
|
select d.departmentname as name,
|
2023-08-04 10:02:06 +08:00
|
|
|
d.id as id,
|
2023-07-28 10:12:59 +08:00
|
|
|
d.subcompanyid1 as subcompanyid1
|
|
|
|
|
from hrmdepartment d
|
|
|
|
|
where d.departmentname = #{name}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getSubCompanyInfosByName" resultType="com.engine.salary.entity.hrm.SubCompanyInfo">
|
|
|
|
|
select d.subcompanyname as name,
|
|
|
|
|
d.id as id
|
|
|
|
|
from hrmsubcompany d
|
|
|
|
|
where d.subcompanyname = #{name}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getDeptInfoById" resultType="com.engine.salary.entity.hrm.DeptInfo">
|
|
|
|
|
select d.departmentname as name,
|
2023-08-04 10:02:06 +08:00
|
|
|
d.id as id,
|
2023-07-28 10:12:59 +08:00
|
|
|
d.subcompanyid1 as subcompanyid1
|
|
|
|
|
from hrmdepartment d
|
|
|
|
|
where d.id = #{id}
|
|
|
|
|
</select>
|
2023-08-30 10:41:00 +08:00
|
|
|
<select id="listByDismissDate" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
|
|
|
|
e.certificatenum as idNo,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2023-08-30 10:41:00 +08:00
|
|
|
e.workcode as workcode,
|
|
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2023-08-30 15:34:54 +08:00
|
|
|
e.enddate as dismissdate
|
2023-08-30 10:41:00 +08:00
|
|
|
from hrmresource e
|
2024-04-26 15:13:54 +08:00
|
|
|
where e.status in (4,5,6)
|
2023-08-30 10:41:00 +08:00
|
|
|
AND e.enddate >= #{dismissDate}
|
|
|
|
|
</select>
|
2023-09-07 15:11:10 +08:00
|
|
|
|
|
|
|
|
<select id="listExtHrmInfoByIdAndName" resultType="com.engine.salary.entity.hrm.dto.HrmInfoDTO">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.username as username
|
|
|
|
|
from hrsa_external_employee e
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.userName != null and param.userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.username like CONCAT('%',#{param.userName},'%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listExtHrmInfoByIdAndName" resultType="com.engine.salary.entity.hrm.dto.HrmInfoDTO" databaseId="sqlserver">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.username as username
|
|
|
|
|
from hrsa_external_employee e
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.userName != null and param.userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.username like '%'+#{param.userName}+'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listExtHrmInfoByIdAndName" resultType="com.engine.salary.entity.hrm.dto.HrmInfoDTO" databaseId="oracle">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.username as username
|
|
|
|
|
from hrsa_external_employee e
|
|
|
|
|
where 1=1
|
|
|
|
|
<if test="param.ids != null and param.ids.size()>0">
|
|
|
|
|
AND e.id IN
|
|
|
|
|
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="param.userName != null and param.userName != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.username like '%'||#{param.userName}||'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
2024-03-25 16:08:34 +08:00
|
|
|
<select id="listBySubCompanyOrDepartment"
|
|
|
|
|
resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
|
|
|
|
e.certificatenum as idNo,
|
2025-06-18 13:32:12 +08:00
|
|
|
e.sex as sex,
|
2024-03-25 16:08:34 +08:00
|
|
|
e.workcode as workcode,
|
|
|
|
|
d.departmentname as departmentName,
|
|
|
|
|
d.id as departmentId,
|
|
|
|
|
c.jobtitlename as jobtitleName,
|
|
|
|
|
c.id as jobtitleId,
|
|
|
|
|
e.companystartdate as companystartdate,
|
2024-10-15 14:24:37 +08:00
|
|
|
e.accounttype as accountType,
|
2024-03-25 16:08:34 +08:00
|
|
|
e.mobile as mobile
|
|
|
|
|
from hrmresource e
|
|
|
|
|
left join hrmdepartment d on e.departmentid = d.id
|
|
|
|
|
left join hrmjobtitles c on e.jobtitle = c.id
|
2024-10-15 14:24:37 +08:00
|
|
|
WHERE e.status not in (7)
|
2024-03-25 16:08:34 +08:00
|
|
|
<if test="subCompanyIds != null and subCompanyIds.size()>0">
|
|
|
|
|
AND e.subcompanyid1 IN
|
|
|
|
|
<foreach collection="subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
|
|
|
|
|
#{subCompanyId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="departmentIds != null and departmentIds.size()>0">
|
|
|
|
|
AND d.id IN
|
|
|
|
|
<foreach collection="departmentIds" open="(" item="departmentId" separator="," close=")">
|
|
|
|
|
#{departmentId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
2024-03-22 15:23:03 +08:00
|
|
|
|
|
|
|
|
<select id="listVirtualEmpByVirtualDepIds"
|
|
|
|
|
resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.RESOURCEID as employeeId,
|
|
|
|
|
e.SUBCOMPANYID as subcompanyid,
|
2024-10-15 14:24:37 +08:00
|
|
|
h.accounttype as accountType,
|
2024-03-22 15:23:03 +08:00
|
|
|
e.DEPARTMENTID as departmentId
|
|
|
|
|
from hrmresourcevirtual e
|
|
|
|
|
left join hrmresource h on e.RESOURCEID=h.id
|
|
|
|
|
where h.status not in (7)
|
|
|
|
|
<if test="virtualDepartmentIds != null and virtualDepartmentIds.size()>0">
|
|
|
|
|
AND e.DEPARTMENTID IN
|
|
|
|
|
<foreach collection="virtualDepartmentIds" open="(" item="virtualDepartmentId" separator="," close=")">
|
|
|
|
|
#{virtualDepartmentId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listVirtualEmpByVirtualSubCompanyIds"
|
|
|
|
|
resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select
|
|
|
|
|
e.RESOURCEID as employeeId,
|
|
|
|
|
e.SUBCOMPANYID as subcompanyid,
|
2024-10-15 14:24:37 +08:00
|
|
|
h.accounttype as accountType,
|
2024-03-22 15:23:03 +08:00
|
|
|
e.DEPARTMENTID as departmentId
|
|
|
|
|
from hrmresourcevirtual e
|
|
|
|
|
left join hrmresource h on e.RESOURCEID=h.id
|
|
|
|
|
where h.status not in (7)
|
|
|
|
|
<if test="virtualSubCompanyIds != null and virtualSubCompanyIds.size()>0">
|
|
|
|
|
AND e.SUBCOMPANYID IN
|
|
|
|
|
<foreach collection="virtualSubCompanyIds" open="(" item="virtualSubCompanyId" separator="," close=")">
|
|
|
|
|
#{virtualSubCompanyId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
2024-02-27 15:16:13 +08:00
|
|
|
|
2024-07-26 16:35:51 +08:00
|
|
|
<select id="listBySubCompany" resultType="long">
|
|
|
|
|
select
|
|
|
|
|
e.id
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where e.status not in (7)
|
|
|
|
|
AND e.subcompanyid1 IN
|
|
|
|
|
<foreach collection="subCompanyIds" open="(" item="subCompanyId" separator="," close=")">
|
|
|
|
|
#{subCompanyId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listByDepartment" resultType="long">
|
|
|
|
|
select
|
|
|
|
|
e.id
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where e.status not in (7)
|
|
|
|
|
AND e.departmentid IN
|
|
|
|
|
<foreach collection="departmentIds" open="(" item="departmentId" separator="," close=")">
|
|
|
|
|
#{departmentId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="listByJob" resultType="long">
|
|
|
|
|
select
|
|
|
|
|
e.id
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where e.status not in (7)
|
|
|
|
|
AND e.jobtitle IN
|
|
|
|
|
<foreach collection="jobIds" open="(" item="jobId" separator="," close=")">
|
|
|
|
|
#{jobId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
2024-08-01 10:16:05 +08:00
|
|
|
|
2024-02-27 15:16:13 +08:00
|
|
|
<select id="listByKeyword" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
|
|
|
|
|
select e.id as employeeId,
|
|
|
|
|
e.lastname as username,
|
|
|
|
|
e.status as status,
|
|
|
|
|
e.certificatenum as idNo,
|
|
|
|
|
e.workcode as workcode,
|
|
|
|
|
e.companystartdate as companystartdate,
|
|
|
|
|
e.mobile as mobile,
|
|
|
|
|
e.enddate as dismissdate
|
|
|
|
|
from hrmresource e
|
|
|
|
|
where e.status not in (7)
|
|
|
|
|
<include refid="keywordParamSql"/>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="keywordParamSql">
|
|
|
|
|
<!-- 关键字(姓名、 -->
|
|
|
|
|
<if test="keyword != null and keyword != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like CONCAT('%',#{keyword},'%')
|
|
|
|
|
OR
|
|
|
|
|
e.workcode like CONCAT('%',#{keyword},'%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="keywordParamSql" databaseId="oracle">
|
|
|
|
|
<if test="keyword != null and keyword != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like '%'||#{keyword}||'%'
|
|
|
|
|
OR
|
|
|
|
|
e.workcode like '%'||#{keyword}||'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="keywordParamSql" databaseId="sqlserver">
|
|
|
|
|
<if test="keyword != null and keyword != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
e.lastname like '%'+#{keyword}+'%'
|
|
|
|
|
OR
|
|
|
|
|
e.workcode like '%'+#{keyword}+'%'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
2024-07-31 13:27:15 +08:00
|
|
|
|
2024-07-25 14:04:14 +08:00
|
|
|
<select id="getJobCallInfoById" resultType="com.engine.salary.entity.hrm.JobCallInfo">
|
|
|
|
|
select job.id,
|
2024-08-01 10:52:44 +08:00
|
|
|
job.NAME as name
|
2024-07-25 14:04:14 +08:00
|
|
|
from hrmjobcall job
|
|
|
|
|
where job.id = #{jobCallId}
|
|
|
|
|
</select>
|
2022-03-10 17:57:46 +08:00
|
|
|
</mapper>
|