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

207 lines
8.3 KiB
XML
Raw Normal View History

2025-07-09 19:00:32 +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.ManagerPortalMapper">
<select id="getOnJobNum" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM ${e10_common}.uf_jcl_employee_information t
2025-07-09 19:00:32 +08:00
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>
</if>
AND t.hiredate &lt;= #{endDate}
AND (t.zhgzr &gt;= #{startDate}
OR t.zhgzr IS NULL
OR t.zhgzr = '')
</select>
<select id="getResignNumber" resultType="java.lang.Integer">
select count(id) as value from ${e10_common}.uf_jcl_lzxxjl t
2025-07-09 19:00:32 +08:00
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 13:36:32 +08:00
and t.lzzt = 1
2025-07-09 19:00:32 +08:00
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.lzqbm IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
and t.zhgzr &gt;= #{startDate}
and t.zhgzr &lt;= #{endDate}
</select>
<select id="getResigningNumber" resultType="java.lang.Integer">
select count(t.id) from ${e10_common}.uf_jcl_lzsq t
2025-07-09 19:00:32 +08:00
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<!--审批中-->
and t.flow_status in (0,1,2)
<!--申请日期-->
and t.sqrq &gt;= #{startDate}
and t.sqrq &lt;= #{endDate}
</select>
<select id="getEntryingNumber" resultType="java.lang.Integer">
select count(t.id) from ${e10_common}.uf_jcl_rzsq t
2025-07-09 19:00:32 +08:00
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<!--审批中-->
and t.flow_status in (0,1,2)
<!--申请日期-->
and t.sqsj &gt;= #{startDate}
and t.sqsj &lt;= #{endDate}
</select>
2025-07-10 13:36:32 +08:00
<select id="getEntryNumber" resultType="java.lang.Integer">
select count(id) as value from ${e10_common}.uf_jcl_rzgl t
2025-07-10 13:36:32 +08:00
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
2025-07-10 14:03:15 +08:00
and t.rzzt = 1
2025-07-10 13:36:32 +08:00
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
and t.hiredate &gt;= #{startDate}
and t.hiredate &lt;= #{endDate}
</select>
2025-07-09 19:00:32 +08:00
<select id="getManageDeptIds" resultType="java.lang.Long">
select t.id
from ${param.eteams}.department t
inner join ${param.eteams}.${param.table_dept_cus} t2 on t.formdata = t2.id
2025-07-09 19:00:32 +08:00
where t.type = 'department'
and t.delete_type = 0
and t.status = 1
and t.tenant_key = #{param.tenantKey}
and t2.tenant_key = #{param.tenantKey}
2025-07-09 19:00:32 +08:00
and t2.delete_type = 0
and t2.bmfzr = #{empId}
</select>
2025-07-10 13:36:32 +08:00
<select id="getBirthdayNum" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM ${e10_common}.uf_jcl_employee_information t
2025-07-10 13:36:32 +08:00
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>
</if>
AND (
(
DATE_FORMAT(birthday, '%m-%d') BETWEEN
DATE_FORMAT(CURDATE(), '%m-%d') AND DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
)
OR (
DATE_FORMAT(CURDATE(), '%m-%d') &gt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
AND (
DATE_FORMAT(birthday, '%m-%d') &gt;= DATE_FORMAT(CURDATE(), '%m-%d')
OR DATE_FORMAT(birthday, '%m-%d') &lt;= DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
)
)
)
</select>
<select id="getRegularEmployeeNum" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM ${e10_common}.uf_jcl_employee_information t
2025-07-10 13:36:32 +08:00
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>
</if>
and yjsyjsrq IS NOT NULL
AND (
STR_TO_DATE(CONCAT(YEAR(CURDATE()), '-', DATE_FORMAT(yjsyjsrq, '%m-%d')), '%Y-%m-%d') BETWEEN
CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 60 DAY)
OR STR_TO_DATE(CONCAT(YEAR(CURDATE()) + 1, '-', DATE_FORMAT(yjsyjsrq, '%m-%d')), '%Y-%m-%d') BETWEEN
CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 60 DAY)
)
</select>
<select id="getEmploymentAnniversary" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM ${e10_common}.uf_jcl_employee_information t
2025-07-10 13:36:32 +08:00
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>
</if>
AND (
(
DATE_FORMAT(hiredate, '%m-%d') BETWEEN
DATE_FORMAT(CURDATE(), '%m-%d') AND DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
)
OR (
DATE_FORMAT(CURDATE(), '%m-%d') &gt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
AND (
DATE_FORMAT(hiredate, '%m-%d') &gt;= DATE_FORMAT(CURDATE(), '%m-%d')
OR DATE_FORMAT(hiredate, '%m-%d') &lt;= DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
)
)
)
</select>
<select id="getEducationInfo" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(t.id) as value , t.education as id
from ${e10_common}.uf_jcl_employee_information t
2025-07-10 13:36:32 +08:00
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>
</if>
group by t.education
</select>
<select id="getPieTypeConfig" resultType="com.weaver.seconddev.portal.entity.po.PieChartConfig">
select t.lx as type,t.flmc as name,t.xlfl as educationIds,
t.qsw as startIndex,t.jzw as endIndex,t.zj as gradeIds,t.zssx as orderNum
from ${e10_common}.uf_xlfb t
2025-07-10 13:36:32 +08:00
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.lx = #{pieType} order by t.zssx
</select>
<select id="getAgeCount" resultType="java.lang.Integer">
select count(t.id) as value from ${param.e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
2025-07-10 13:36:32 +08:00
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
and t.age &gt; #{startIndex}
and t.age &lt;= #{endIndex}
</select>
<select id="getComapnyCount" resultType="java.lang.Integer">
select count(t.id) as value from ${param.e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
2025-07-10 13:36:32 +08:00
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
#{departmentId}
</foreach>
</if>
and t.sl &gt; #{startIndex}
and t.sl &lt;= #{endIndex}
</select>
2025-07-09 19:00:32 +08:00
</mapper>