weaver-hrm-organization/src/com/engine/organization/mapper/trigger/StaffTriggerMapper.xml

55 lines
2.1 KiB
XML
Raw Normal View History

<?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.StaffTriggerMapper">
<update id="updateOrgStaffs">
update jcl_org_map
<set>
FPLAN = #{fPlan},
FONJOB = #{fOnJob},
</set>
where FTYPE =#{fType} and FOBJID=#{fObjId}
AND FDATEBEGIN &lt;= #{currentDate}
AND FDATEEND &gt;= #{currentDate}
</update>
<select id="countCompanyUsers" resultType="java.lang.Integer">
select count(1)
from hrmresource
where status &lt;= 3
and subcompanyid1 = #{ecCompanyId}
</select>
<select id="countDepartmentUsers" resultType="java.lang.Integer">
select count(1)
from hrmresource
where status &lt;= 3
and departmentid = #{ecDepartmentId}
</select>
<select id="countCompanyStaffNum" 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;= #{currentDate}
and time_end &gt;= #{currentDate})
and comp_id = #{companyId} and delete_type = 0
</select>
<select id="countDepartmentStaffNum" 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;= #{currentDate}
and time_end &gt;= #{currentDate})
and dept_id = #{departmentId} and delete_type = 0
</select>
<select id="countJobStaffNum" 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;= #{currentDate}
and time_end &gt;= #{currentDate})
and job_id = #{jobId} and delete_type = 0
</select>
</mapper>