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.
weaver-hrm-organization/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml

77 lines
3.1 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>
<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="getHrmFamilyInfoByUser" resultType="com.engine.organization.entity.resume.po.HrmFamilyInfoPO">
select *
from HrmFamilyInfo
where resourceid = #{resourceId}
</select>
<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>