You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
374 lines
13 KiB
XML
374 lines
13 KiB
XML
<?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"/>
|
|
<result column="lastname" property="lastName"/>
|
|
<result column="dspOrder" property="dspOrder"/>
|
|
</resultMap>
|
|
<resultMap id="SearchTemplateMap" type="com.engine.organization.entity.hrmresource.param.SearchTemplateParam">
|
|
<result column="id" property="key"/>
|
|
<result column="name" property="showname"/>
|
|
<result column="selected" property="selected"/>
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
|
SELECT DISTINCT subcompanyid1, departmentid, jobtitle
|
|
from hrmresource
|
|
</select>
|
|
<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>
|
|
<select id="getPersonnelResumeById"
|
|
resultType="com.engine.organization.entity.resume.po.PersonnelResumePO">
|
|
select lastname,
|
|
sex,
|
|
birthday,
|
|
resourceimageid as image,
|
|
nativeplace,
|
|
policy as politics,
|
|
a.departmentname as department,
|
|
maritalstatus as marriage,
|
|
b.jobtitlename as jobTitle,
|
|
companystartdate,
|
|
workstartdate,
|
|
certificatenum as idCard,
|
|
residentplace as address,
|
|
mobile as telephone,
|
|
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>
|
|
<select id="getPersonnelResumeList"
|
|
resultType="com.engine.organization.entity.resume.po.PersonnelResumePO">
|
|
select h.id,
|
|
lastname,
|
|
sex,
|
|
birthday,
|
|
resourceimageid as image,
|
|
resourceimageid as imageId,
|
|
nativeplace,
|
|
policy as politics,
|
|
a.departmentname as department,
|
|
maritalstatus as marriage,
|
|
b.jobtitlename as jobTitle,
|
|
companystartdate,
|
|
workstartdate,
|
|
certificatenum as idCard,
|
|
residentplace as address,
|
|
mobile as telephone,
|
|
email
|
|
from hrmresource h
|
|
inner join hrmdepartment a on a.id = h.departmentid
|
|
inner join hrmjobtitles b on b.id = h.jobtitle
|
|
where h.status < 4
|
|
</select>
|
|
<select id="getHrmFamilyInfoByUser" resultType="com.engine.organization.entity.resume.po.HrmFamilyInfoPO">
|
|
select *
|
|
from HrmFamilyInfo
|
|
where resourceid = #{resourceId}
|
|
</select>
|
|
<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>
|
|
<select id="getSearchTemplatesByUser" resultMap="SearchTemplateMap">
|
|
select id,
|
|
name,
|
|
'false' as selected
|
|
from jcl_org_search_template
|
|
where creator = #{userId}
|
|
</select>
|
|
<select id="getSearchTemplateById"
|
|
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
|
|
select *
|
|
from jcl_org_search_template
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertSearchTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
|
keyProperty="id"
|
|
keyColumn="id" useGeneratedKeys="true">
|
|
INSERT INTO JCL_ORG_SEARCH_TEMPLATE
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
creator,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="basicFields != null">
|
|
basic_fields,
|
|
</if>
|
|
<if test="personalFields != null">
|
|
personal_fields,
|
|
</if>
|
|
<if test="workFields != null">
|
|
work_fields,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
#{creator},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime},
|
|
</if>
|
|
<if test="name != null">
|
|
#{name},
|
|
</if>
|
|
<if test="basicFields != null">
|
|
#{basicFields},
|
|
</if>
|
|
<if test="personalFields != null">
|
|
#{personalFields},
|
|
</if>
|
|
<if test="workFields != null">
|
|
#{workFields},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="insertSearchTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
|
databaseId="oracle">
|
|
<selectKey keyProperty="id" resultType="int" order="AFTER">
|
|
select JCL_ORG_SEARCH_TEMPLATE_ID.currval from dual
|
|
</selectKey>
|
|
INSERT INTO JCL_ORG_SEARCH_TEMPLATE
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
creator,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="basicFields != null">
|
|
basic_fields,
|
|
</if>
|
|
<if test="personalFields != null">
|
|
personal_fields,
|
|
</if>
|
|
<if test="workFields != null">
|
|
work_fields,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
#{creator},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime},
|
|
</if>
|
|
<if test="name != null">
|
|
#{name},
|
|
</if>
|
|
<if test="basicFields != null">
|
|
#{basicFields},
|
|
</if>
|
|
<if test="personalFields != null">
|
|
#{personalFields},
|
|
</if>
|
|
<if test="workFields != null">
|
|
#{workFields},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<insert id="insertCustomTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
|
keyProperty="id"
|
|
keyColumn="id" useGeneratedKeys="true">
|
|
INSERT INTO JCL_ORG_CUSTOM_TEMPLATE
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
creator,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="basicFields != null">
|
|
basic_fields,
|
|
</if>
|
|
<if test="personalFields != null">
|
|
personal_fields,
|
|
</if>
|
|
<if test="workFields != null">
|
|
work_fields,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
#{creator},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime},
|
|
</if>
|
|
<if test="name != null">
|
|
#{name},
|
|
</if>
|
|
<if test="basicFields != null">
|
|
#{basicFields},
|
|
</if>
|
|
<if test="personalFields != null">
|
|
#{personalFields},
|
|
</if>
|
|
<if test="workFields != null">
|
|
#{workFields},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="insertCustomTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
|
databaseId="oracle">
|
|
<selectKey keyProperty="id" resultType="int" order="AFTER">
|
|
select JCL_ORG_CUSTOM_TEMPLATE_ID.currval from dual
|
|
</selectKey>
|
|
INSERT INTO JCL_ORG_CUSTOM_TEMPLATE
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
creator,
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="basicFields != null">
|
|
basic_fields,
|
|
</if>
|
|
<if test="personalFields != null">
|
|
personal_fields,
|
|
</if>
|
|
<if test="workFields != null">
|
|
work_fields,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
<if test="creator != null">
|
|
#{creator},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime},
|
|
</if>
|
|
<if test="name != null">
|
|
#{name},
|
|
</if>
|
|
<if test="basicFields != null">
|
|
#{basicFields},
|
|
</if>
|
|
<if test="personalFields != null">
|
|
#{personalFields},
|
|
</if>
|
|
<if test="workFields != null">
|
|
#{workFields},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<delete id="deleteSearchTemplate">
|
|
delete
|
|
from jcl_org_search_template
|
|
where id = #{id}
|
|
and creator = #{userId}
|
|
</delete>
|
|
|
|
<delete id="deleteCustomTemplate">
|
|
delete
|
|
from jcl_org_custom_template
|
|
where id = #{id}
|
|
and creator = #{userId}
|
|
</delete>
|
|
|
|
<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>
|
|
|
|
|
|
</mapper> |