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

72 lines
2.9 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,
resourceimageid as image,
nativeplace,
policy as politics,
a.departmentname as department,
maritalstatus as marriage,
b.jobtitlename as jobTitle,
companystartdate,
workstartdate,
certificatenum as idCard,
homeaddress as address,
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>
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>