weaver-hrm-organization/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml

107 lines
4.5 KiB
XML
Raw Normal View History

2022-12-15 18:56:25 +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.organization.mapper.resource.HrmResourceMapper">
<resultMap id="HrmResourceMap" type="com.engine.organization.entity.hrmresource.po.ResourcePO">
<result column="id" property="id"/>
<result column="subcompanyid1" property="subcompanyid1"/>
<result column="departmentid" property="departmentid"/>
<result column="jobtitle" property="jobtitle"/>
2022-12-28 14:13:56 +08:00
<result column="lastname" property="lastName"/>
<result column="dspOrder" property="dspOrder"/>
2022-12-15 18:56:25 +08:00
</resultMap>
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
2022-12-28 14:13:56 +08:00
SELECT DISTINCT subcompanyid1, departmentid, jobtitle
from hrmresource
2022-12-15 18:56:25 +08:00
</select>
2022-12-28 14:13:56 +08:00
<select id="listByFilter" resultMap="HrmResourceMap">
select id, subcompanyid1 , departmentid , jobtitle , lastname , dspOrder from hrmresource t
where 1=1
<include refid="likeSql"/>
<if test="resourcePO.subcompanyid1 != null">
and subcompanyid1 = #{resourcePO.subcompanyid1}
</if>
<if test="resourcePO.departmentid != null">
and departmentid = #{resourcePO.departmentid}
</if>
<if test="resourcePO.jobtitle != null">
and jobtitle = #{resourcePO.jobtitle}
</if>
</select>
2022-12-29 15:52:08 +08:00
<select id="getPersonnelResumeById"
resultType="com.engine.organization.entity.resume.po.PersonnelResumePO">
select lastname,
sex,
birthday,
2022-12-30 10:16:48 +08:00
resourceimageid as image,
2022-12-29 15:52:08 +08:00
nativeplace,
2022-12-30 10:16:48 +08:00
policy as politics,
2022-12-29 15:52:08 +08:00
a.departmentname as department,
2022-12-30 10:16:48 +08:00
maritalstatus as marriage,
b.jobtitlename as jobTitle,
2022-12-29 15:52:08 +08:00
companystartdate,
workstartdate,
2022-12-30 10:16:48 +08:00
certificatenum as idCard,
residentplace as address,
mobile as telephone,
2022-12-29 15:52:08 +08:00
email
from hrmresource h
inner join hrmdepartment a on a.id = h.departmentid
inner join hrmjobtitles b on b.id = h.jobtitle
where h.id = #{id}
</select>
2022-12-30 10:16:48 +08:00
<select id="getHrmFamilyInfoByUser" resultType="com.engine.organization.entity.resume.po.HrmFamilyInfoPO">
select *
from HrmFamilyInfo
where resourceid = #{resourceId}
</select>
2023-01-04 16:50:59 +08:00
<select id="getPersonnelScreening" resultMap="HrmResourceMap">
select t.id, t.subcompanyid1 , t.departmentid , t.jobtitle , t.lastname , t.dspOrder
from hrmresource t inner join JCL_ORG_JOB a ON a.EC_COMPANY =t.SUBCOMPANYID1 AND a.EC_DEPARTMENT =t.DEPARTMENTID
AND a.EC_JOBTITLE =t.JOBTITLE
where 1 = 1
<if test="subCompanyIds != null and subCompanyIds.size > 0">
AND t.subcompanyid1 IN
<foreach collection="subCompanyIds" open="(" item="subcompanyid1" separator="," close=")">
#{subcompanyid1}
</foreach>
</if>
<if test="departmentIds != null and departmentIds.size > 0">
AND t.departmentid IN
<foreach collection="departmentIds" open="(" item="departmentid" separator="," close=")">
#{departmentid}
</foreach>
</if>
<if test="jobIds != null and jobIds.size > 0">
AND a.id IN
<foreach collection="jobIds" open="(" item="jobId" separator="," close=")">
#{jobId}
</foreach>
</if>
<if test="resourceIds != null and resourceIds.size > 0">
AND t.id IN
<foreach collection="resourceIds" open="(" item="resourceId" separator="," close=")">
#{resourceId}
</foreach>
</if>
</select>
2022-12-28 14:13:56 +08:00
<sql id="likeSql">
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
AND t.lastname like CONCAT('%',#{resourcePO.lastName},'%')
</if>
</sql>
<sql id="likeSql" databaseId="oracle">
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
AND t.lastname like '%'||#{resourcePO.lastName}||'%'
</if>
</sql>
<sql id="likeSql" databaseId="sqlserver">
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
AND t.lastname like '%'+#{resourcePO.lastName}+'%'
</if>
</sql>
2022-12-15 18:56:25 +08:00
</mapper>