<?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.bjscis.ims.persistence.expand.QueryHrHumanInfoMapper">
<resultMap id="HrStaffOneResultMap" type="com.bjscis.ims.domain.HrStaff" >
<id column="HR_STAFF_ONE_ID" property="id" jdbcType="BIGINT" />
<result column="HR_STAFF_ONE_HR_HUMAN_ID" property="hrHumanId" jdbcType="BIGINT" />
<result column="HR_STAFF_ONE_SYS_RFID_CARD_ID" property="sysRfidCardId" jdbcType="BIGINT" />
<result column="HR_STAFF_ONE_STAFF_NO" property="staffNo" jdbcType="VARCHAR" />
<result column="HR_STAFF_ONE_STAFF_PASSWORD" property="staffPassword" jdbcType="VARCHAR" />
<result column="HR_STAFF_ONE_WORKER_TYPE" property="workerType" jdbcType="CHAR" />
<result column="HR_STAFF_ONE_CONTRACT_TYPE" property="contractType" jdbcType="CHAR" />
<result column="HR_STAFF_ONE_IS_VERIFIED" property="isVerified" jdbcType="CHAR" />
<result column="HR_STAFF_ONE_COMMENT" property="comment" jdbcType="VARCHAR" />
<result column="HR_STAFF_ONE_CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
<result column="HR_STAFF_ONE_MODIFY_TIME" property="modifyTime" jdbcType="TIMESTAMP" />
<result column="HR_STAFF_ONE_SHOW_ID" property="showId" jdbcType="BIGINT" />
<result column="HR_STAFF_ONE_SHOW_SUB_ID" property="showSubId" jdbcType="BIGINT" />
<result column="HR_STAFF_ONE_IS_ENABLED" property="isEnabled" jdbcType="CHAR" />
<result column="HR_STAFF_ONE_IS_DELETED" property="isDeleted" jdbcType="CHAR" />
<result column="HR_STAFF_ONE_IN_ID" property="inId" jdbcType="BIGINT" />
<result column="HR_STAFF_ONE_MO_ID" property="moId" jdbcType="BIGINT" />
<result column="HR_STAFF_ONE_CONTACT_INFOMATION" property="contactInfomation" jdbcType="VARCHAR" />
<result column="HR_STAFF_ONE_WORK_ENTRY_STATE" property="workEntryState" jdbcType="CHAR" />
<result column="HR_STAFF_ONE_META_POSITION_ID" property="metaPositionId" jdbcType="BIGINT" />
</resultMap>
<sql id="HrStaff_One_Column_List" >
HR_STAFF_ONE.ID as HR_STAFF_ONE_ID,
HR_STAFF_ONE.HR_HUMAN_ID as HR_STAFF_ONE_HR_HUMAN_ID,
HR_STAFF_ONE.SYS_RFID_CARD_ID as HR_STAFF_ONE_SYS_RFID_CARD_ID,
HR_STAFF_ONE.STAFF_NO as HR_STAFF_ONE_STAFF_NO,
HR_STAFF_ONE.STAFF_PASSWORD as HR_STAFF_ONE_STAFF_PASSWORD,
HR_STAFF_ONE.WORKER_TYPE as HR_STAFF_ONE_WORKER_TYPE,
HR_STAFF_ONE.CONTRACT_TYPE as HR_STAFF_ONE_CONTRACT_TYPE,
HR_STAFF_ONE.IS_VERIFIED as HR_STAFF_ONE_IS_VERIFIED,
HR_STAFF_ONE.COMMENT as HR_STAFF_ONE_COMMENT,
HR_STAFF_ONE.CREATE_TIME as HR_STAFF_ONE_CREATE_TIME,
HR_STAFF_ONE.MODIFY_TIME as HR_STAFF_ONE_MODIFY_TIME,
HR_STAFF_ONE.SHOW_ID as HR_STAFF_ONE_SHOW_ID,
HR_STAFF_ONE.SHOW_SUB_ID as HR_STAFF_ONE_SHOW_SUB_ID,
HR_STAFF_ONE.IS_ENABLED as HR_STAFF_ONE_IS_ENABLED,
HR_STAFF_ONE.IS_DELETED as HR_STAFF_ONE_IS_DELETED,
HR_STAFF_ONE.IN_ID as HR_STAFF_ONE_IN_ID,
HR_STAFF_ONE.MO_ID as HR_STAFF_ONE_MO_ID,
HR_STAFF_ONE.CONTACT_INFOMATION as HR_STAFF_ONE_CONTACT_INFOMATION,
HR_STAFF_ONE.WORK_ENTRY_STATE as HR_STAFF_ONE_WORK_ENTRY_STATE,
HR_STAFF_ONE.META_POSITION_ID as HR_STAFF_ONE_META_POSITION_ID
</sql>
<resultMap id="HrHumanQueryInfoExpandMap"
type="com.bjscis.ims.domain.expand.HrHumanQueryInfoExpand">
<id column="HR_STAFF_ONE_ID" property="id" jdbcType="BIGINT" />
<association property="hrStaff" column="HR_STAFF_ONE_ID" resultMap="HrStaffOneResultMap" />
<association property="hrHuman" column="HR_HUMAN_ONE_ID" resultMap="HrHumanOneResultMap" />
</resultMap>
<select id="selectHrHumanQueryInfoExpand" resultMap="HrHumanQueryInfoExpandMap">
SELECT
<include refid="HrStaff_One_Column_List" />,
<include refid="HrHuman_One_Column_List" />
FROM HR_STAFF HR_STAFF_ONE
LEFT JOIN HR_HUMAN HR_HUMAN_ONE ON HR_HUMAN_ONE.ID = HR_STAFF_ONE.HR_HUMAN_ID
<where>
HR_STAFF_ONE.IS_DELETED = 'N'
<if test=" liftAge != '' and liftAge != null and rightAge != '' and rightAge != null">
AND UNIX_TIMESTAMP (`HR_HUMAN_ONE`.`HUMAN_BIRTHDAY`) BETWEEN UNIX_TIMESTAMP('${liftAge}') AND UNIX_TIMESTAMP('${rightAge}')
</if>
<if test=" postId != '' and postId != null">
AND SYS_CORPORTION_STRUCTURE_ONE.ID = #{postId}
</if>
<if test=" staffNo != '' and staffNo != null">
AND HR_STAFF_ONE.STAFF_NO LIKE CONCAT('%',#{staffNo},'%')
</if>
<if test=" workEntryState != '' and workEntryState != null">
AND HR_STAFF_ONE.WORK_ENTRY_STATE IN ('${workEntryState}')
</if>
</where>
ORDER BY HR_STAFF_ONE.ID
</select>
</mapper>