secondev-chapanda-portal/src/main/resources/mapper/LeaderCockpitMapper.xml

149 lines
6.6 KiB
XML
Raw Normal View History

2025-07-08 21:02:25 +08:00
<?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.weaver.seconddev.portal.mapper.LeaderCockpitMapper">
<select id="getOnJobNumber" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(t.id) as value ,b.yglxmc as name from e10_common.uf_jcl_employee_information t
inner join e10_common.uf_jcl_yglx b on t.yglx = b.id
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
<!--开始日期 <= 结束查询日期-->
AND t.hiredate &lt;= #{endDate}
<!--最后工作日期 > 开始查询日期 OR 最后工作日期为空-->
and (t.zhgzr ='' or t.zhgzr is null or t.zhgzr &gt; #{endDate})
2025-07-08 21:02:25 +08:00
group by b.yglxmc
</select>
<select id="getOnJobCount" resultType="java.lang.Integer">
select count(t.id) as value from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
<!--开始日期 <= 结束查询日期-->
AND t.hiredate &lt;= #{endDate}
<!--最后工作日期 > 开始查询日期 OR 最后工作日期为空-->
and (t.zhgzr ='' or t.zhgzr is null or t.zhgzr &gt; #{endDate})
2025-07-08 21:02:25 +08:00
</select>
<select id="getResignCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 09:24:31 +08:00
and t.lzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
2025-07-09 19:00:13 +08:00
AND t.lzqbm IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
and t.zhgzr &gt;= #{startDate}
and t.zhgzr &lt;= #{endDate}
</select>
<select id="getKeyResignCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 09:24:31 +08:00
and t.lzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
2025-07-09 19:00:13 +08:00
AND t.lzqbm IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
and t.sfgjrc = 1
and t.zhgzr &gt;= #{startDate}
and t.zhgzr &lt;= #{endDate}
</select>
<select id="getEmploymentCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 14:03:15 +08:00
and t.rzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
and t.hiredate &gt;= #{startDate}
and t.hiredate &lt;= #{endDate}
</select>
<select id="getKeyEmploymentCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 14:03:15 +08:00
and t.rzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
and t.sfgjrc = 1
and t.hiredate &gt;= #{startDate}
and t.hiredate &lt;= #{endDate}
</select>
<select id="getEmploymentListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(id) as name,position as value from e10_common.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 14:03:15 +08:00
and t.rzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
and t.hiredate &gt;= #{startDate}
and t.hiredate &lt;= #{endDate}
and position !='' and position is not null
2025-07-09 19:00:13 +08:00
group by position order by value
2025-07-08 21:02:25 +08:00
</select>
<select id="getPositionById" resultType="com.weaver.seconddev.portal.entity.po.Position">
select p.id as position_id, p.name as position_name,
d.id as department_id, d.name as department_name,
g.id as grade_id, g.name as grade_name
from eteams.position p
left join eteams.department d on p.department = d.id
left join eteams.grade g on p.grade_id = g.id
where p.id = #{positionId} and p.delete_type = 0 and p.tenant_key = #{tenantKey} limit 1
</select>
<select id="getResignListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(id) as name,lzqgw as value from e10_common.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 09:24:31 +08:00
and t.lzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
2025-07-09 19:00:13 +08:00
AND t.lzqbm IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
2025-07-08 21:02:25 +08:00
</if>
and t.zhgzr &gt;= #{startDate}
and t.zhgzr &lt;= #{endDate}
and t.lzqgw !='' and t.lzqgw is not null
2025-07-09 19:00:13 +08:00
group by t.lzqgw order by value
2025-07-08 21:02:25 +08:00
</select>
<select id="getTopDepartmentIds" resultType="java.lang.Long">
select t.id
from eteams.department t
inner join eteams.department t1 on t.parent = t1.id
where t.type = 'department'
and t1.type = 'subcompany'
and t.delete_type = 0
and t.status = 1
and t.tenant_key = #{tenantKey}
and t1.delete_type = 0
and t1.status = 1
and t1.tenant_key = #{tenantKey}
</select>
2025-07-08 21:02:25 +08:00
</mapper>