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

    <select id="getInfoValue" resultType="java.lang.Integer">
        select fvalue
        from jcl_info
        where 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})
    </select>
    <select id="countHrmResource" resultType="java.lang.Integer">
        select count(1)
        from hrmresource
        where status &lt;= 3
    </select>
</mapper>