<?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.trigger.CompTriggerMapper">
    <update id="updateMap">
        update jcl_org_map
        <set>
            fdateend=#{fdate},
        </set>
        where ftype=#{ftype} and fobjid=#{fobjid} and fdateend &gt; #{fdatebegin}
    </update>
    <delete id="deleteMap">
        delete
        from jcl_org_map
        where ftype = #{ftype}
          and fobjid = #{fobjid}
          and fdatebegin = #{fdatebegin}
    </delete>

    <select id="getEcCompanyIdByUuid" resultType="java.lang.Integer">
        select id
        from HrmSubCompany
        where uuid = #{uuid}
    </select>
    <select id="getHrmResourceById" resultType="weaver.hrm.passwordprotection.domain.HrmResource">
        select messagerurl, lastname, jobtitle
        from hrmresource
        where id = #{id}
    </select>
    <select id="getJobTitleMarkById" resultType="java.lang.String">
        select jobtitlemark
        from hrmjobtitles
        where id = #{id}
    </select>
    <select id="getCusFieldDataById" resultType="com.alibaba.fastjson.JSONObject">
        select field100008, field100007
        from cus_fielddata
        where scope = 'HrmCustomFieldByInfoType'
          and scopeid = 3
          and id = #{id}
    </select>
    <select id="sumStaffNum" resultType="java.lang.Integer">
        select sum(staff_num)
        from JCL_ORG_STAFF
        where plan_id in (select id
                          from JCL_ORG_STAFFPLAN
                          where time_start &lt;= #{fdatebegin}
                            and time_end &gt;= #{fdatebegin})
          and comp_id = #{compId}
    </select>
    <select id="countHrmResource" resultType="java.lang.Integer">
        select count(1)
        from hrmresource
        where status &lt;= 3
          and subcompanyid1 = #{subcompanyid1}
    </select>
</mapper>