From 09c6b3b6fc4ee6b1bc9fa1a6d3da3044729fc95a Mon Sep 17 00:00:00 2001
From: yubo <autumnal_wind@yeah.net>
Date: 星期二, 31 三月 2026 18:50:18 +0800
Subject: [PATCH] fix(hr): 修正年假计算逻辑及代码格式问题

---
 febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml |  120 +++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 62 insertions(+), 58 deletions(-)

diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml
index 2474f48..a4c970c 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml
@@ -7,43 +7,43 @@
     </select>
     
     <select id="selectPageVo" resultType="cc.mrbird.febs.server.hr.entity.EmpBaseInfo">
-        select a.* from t_emp_baseInfo a 
+        select a.* from t_emp_baseinfo a
         inner join t_dept c on a.deptId = c.DEPT_ID
         ${ew.customSqlSegment}
     </select>
     <select id="listAll" resultType="cc.mrbird.febs.server.hr.entity.EmpBaseInfo">
-        select a.* from t_emp_baseInfo a
+        select a.* from t_emp_baseinfo a
         inner join t_dept c on a.deptId = c.DEPT_ID
         ${ew.customSqlSegment}
     </select>
     <select id="countZcygBaseInfoList" resultType="java.util.Map">
         SELECT
         count(
-        IF (t.dimissionType = '1', 1, NULL)
+        IF (t2.dimissionType = '6', 1, NULL)
         ) zclz,
         count(
-        IF (t.dimissionType = '2', 1, NULL)
+        IF (t2.dimissionType = '4', 1, NULL)
         ) zdlz,
         count(
-        IF (t.dimissionType = '4', 1, NULL)
+        IF (t2.dimissionType = '3', 1, NULL)
         ) gsct
-        FROM
-        t_emp_baseinfo t inner  join t_dept t1 on t.deptId=t1.DEPT_ID  ${ew.customSqlSegment} and t.delFlag=0 and t.empStatus='1'
+        FROM t_emp_dimissionlog t2 inner join
+        t_emp_baseinfo t on t2.empId=t.empId inner  join t_dept t1 on t.deptId=t1.DEPT_ID  ${ew.customSqlSegment} and t2.delFlag=0 and t.empStatus='1'
         <choose>
             <when test="btime!=null and btime!='' and etime!=null and etime!=''">
-                and date_format(t.createTime,'%Y-%m-%d') &gt;= #{btime}  and date_format(t.createTime,'%Y-%m-%d') &lt;= #{etime}
+                and date_format(t2.dimissionDate,'%Y-%m-%d') &gt;= #{btime}  and date_format(t2.dimissionDate,'%Y-%m-%d') &lt;= #{etime}
             </when>
             <when test="index==0">
-                and TO_DAYS(t.createTime) = TO_DAYS(NOW())
+                and TO_DAYS(t2.dimissionDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t.createTime,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.dimissionDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
-                and date_format(t.createTime,'%Y-%m') = date_format(now(),'%Y-%m')
+                and date_format(t2.dimissionDate,'%Y-%m') = date_format(now(),'%Y-%m')
             </when>
             <otherwise>
-                and YEAR(t.createTime)=YEAR(NOW())
+                and YEAR(t2.dimissionDate)=YEAR(NOW())
             </otherwise>
         </choose>
 
@@ -73,7 +73,7 @@
                 and TO_DAYS(t.entryDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t.entryDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t.entryDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t.entryDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -97,7 +97,7 @@
                 and TO_DAYS(t.dimissionDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t.dimissionDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t.dimissionDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t.dimissionDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -120,7 +120,7 @@
                 and TO_DAYS(t2.applayDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.applayDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.applayDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.applayDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -146,7 +146,7 @@
                 and TO_DAYS(t2.signingDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.signingDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.signingDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.signingDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -171,7 +171,7 @@
                 and TO_DAYS(t2.signingDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.signingDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.signingDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.signingDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -185,7 +185,7 @@
 
     <select id="countDqhtBaseInfoList" resultType="java.lang.Integer">
         SELECT
-        count(IF(t2.contractStatus = 4, 1, NULL)) dqht
+        count(IF(t2.contractStatus in('1','2'), 1, NULL)) dqht
         FROM
         t_emp_baseinfo t INNER JOIN t_emp_contractinfo t2 on t.empId=t2.empId inner  join t_dept t1 on t.deptId=t1.DEPT_ID  ${ew.customSqlSegment} and t.delFlag=0 and t2.delFlag=0
         <choose>
@@ -196,7 +196,7 @@
                 and TO_DAYS(t2.endDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.endDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.endDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.endDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -242,7 +242,7 @@
                 and TO_DAYS(t2.returnDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.returnDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.returnDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.returnDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -275,7 +275,7 @@
                 and TO_DAYS(t2.arbitrationDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.arbitrationDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.arbitrationDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.arbitrationDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -299,7 +299,7 @@
                 and TO_DAYS(t2.injuredTime) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.injuredTime,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.injuredTime,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.injuredTime,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -320,7 +320,7 @@
                 and TO_DAYS(t2.injuredTime) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.injuredTime,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.injuredTime,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.injuredTime,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -347,7 +347,7 @@
                 and TO_DAYS(t2.applayDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.applayDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.applayDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.applayDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -370,7 +370,7 @@
                 and TO_DAYS(t2.applayDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.applayDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.applayDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.applayDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -393,7 +393,7 @@
                 and TO_DAYS(t2.physicalExamDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.physicalExamDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.physicalExamDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.physicalExamDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -416,7 +416,7 @@
                 and TO_DAYS(t.certificateValidity) &lt;= TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t.certificateValidity,'%Y-%m-%d')) &lt;= YEARWEEK(now())
+                and YEARWEEK(date_format(t.certificateValidity,'%Y-%m-%d'),1) &lt;= YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t.certificateValidity,'%Y-%m') &lt;= date_format(now(),'%Y-%m')
@@ -431,13 +431,13 @@
         SELECT
         count(1) ygtg
         FROM
-        t_emp_baseinfo t right  JOIN t_emp_jobChange t2 on t.empId=t2.empId inner  join t_dept t1 on t.deptId=t1.DEPT_ID  ${ew.customSqlSegment} and t.delFlag=0 and t2.delFlag=0
+        t_emp_baseinfo t right  JOIN t_emp_jobchange t2 on t.empId=t2.empId inner  join t_dept t1 on t.deptId=t1.DEPT_ID  ${ew.customSqlSegment} and t.delFlag=0 and t2.delFlag=0
         <choose>
             <when test="index==0">
                 and TO_DAYS(t2.changeDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.changeDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.changeDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.changeDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -461,7 +461,7 @@
                 and TO_DAYS(t2.badDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t2.badDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t2.badDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t2.badDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -537,7 +537,7 @@
                 and TO_DAYS(t1.certificateValidity) &lt;= TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.certificateValidity,'%Y-%m-%d')) &lt;= YEARWEEK(now())
+                and YEARWEEK(date_format(t1.certificateValidity,'%Y-%m-%d'),1) &lt;= YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.certificateValidity,'%Y-%m') &lt;= date_format(now(),'%Y-%m')
@@ -566,7 +566,7 @@
                 and TO_DAYS(t1.entryDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.entryDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.entryDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.entryDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -641,7 +641,7 @@
                 and TO_DAYS(t1.applayDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.applayDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.applayDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.applayDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -655,20 +655,20 @@
 
 
     <select id="zcbaseInfoList" resultType="cc.mrbird.febs.server.hr.entity.EmpBaseInfo">
-        select t1.* from t_emp_baseinfo t1 left join t_dept t2 on t1.deptId=t2.DEPT_ID where 1=1 and t1.delFlag=0 and t1.empStatus='1'
+        select t1.* from t_emp_dimissionlog t inner join  t_emp_baseinfo t1 on t.empId=t1.empId left join t_dept t2 on t1.deptId=t2.DEPT_ID where 1=1 and t.delFlag=0 and t1.empStatus='1'
         and t2.DEPT_ID in
         <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
             #{item}
         </foreach>
         <choose>
             <when test="number==8">
-               and t1.dimissionType = '1'
+               and t.dimissionType = '6'
             </when>
             <when test="number==9">
-                and t1.dimissionType = '2'
+                and t.dimissionType = '4'
             </when>
             <when test="number==10">
-                and t1.dimissionType = '4'
+                and t.dimissionType = '3'
             </when>
             <otherwise>
 
@@ -680,19 +680,19 @@
         </if>
         <choose>
             <when test="btime!='undefined' and btime!=null and btime!='' and etime!='undefined' and etime!=null and etime!=''">
-                and date_format(t1.createTime,'%Y-%m-%d') &gt;= #{btime}  and date_format(t1.createTime,'%Y-%m-%d') &lt;= #{etime}
+                and date_format(t.dimissionDate,'%Y-%m-%d') &gt;= #{btime}  and date_format(t1.dimissionDate,'%Y-%m-%d') &lt;= #{etime}
             </when>
             <when test="index==0">
-                and TO_DAYS(t1.createTime) = TO_DAYS(NOW())
+                and TO_DAYS(t.dimissionDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.createTime,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t.dimissionDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
-                and date_format(t1.createTime,'%Y-%m') = date_format(now(),'%Y-%m')
+                and date_format(t.dimissionDate,'%Y-%m') = date_format(now(),'%Y-%m')
             </when>
             <otherwise>
-                and YEAR(t1.createTime)=YEAR(NOW())
+                and YEAR(t.dimissionDate)=YEAR(NOW())
             </otherwise>
         </choose>
 
@@ -716,7 +716,7 @@
                         and TO_DAYS(t1.signingDate) = TO_DAYS(NOW())
                     </when>
                     <when test="index==1">
-                        and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d')) = YEARWEEK(now())
+                        and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d'),1) = YEARWEEK(now())
                     </when>
                     <when test="index==2">
                         and date_format(t1.signingDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -736,7 +736,7 @@
                         and TO_DAYS(t1.signingDate) = TO_DAYS(NOW())
                     </when>
                     <when test="index==1">
-                        and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d')) = YEARWEEK(now())
+                        and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d'),1) = YEARWEEK(now())
                     </when>
                     <when test="index==2">
                         and date_format(t1.signingDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -756,7 +756,7 @@
                         and TO_DAYS(t1.signingDate) = TO_DAYS(NOW())
                     </when>
                     <when test="index==1">
-                        and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d')) = YEARWEEK(now())
+                        and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d'),1) = YEARWEEK(now())
                     </when>
                     <when test="index==2">
                         and date_format(t1.signingDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -785,7 +785,7 @@
         and t2.DEPT_ID in
         <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
             #{item}
-        </foreach> and t.delFlag=0 and t1.delFlag=0 and t1.contractStatus = '4'
+        </foreach> and t.delFlag=0 and t1.delFlag=0 and t1.contractStatus in( '1','2')  and t1.empStatus=0
         <if test="name!= 'undefined' and name!=null and name!=''">
             and (t.empNumb like CONCAT('%',#{name},'%') or t.empName like CONCAT('%',#{name},'%') or
             t.certificateNumb like CONCAT('%',#{name},'%') or t2.DEPT_NAME like CONCAT('%',#{name},'%'))
@@ -798,7 +798,7 @@
                 and TO_DAYS(t1.endDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.endDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.endDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.endDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -830,7 +830,7 @@
                 and TO_DAYS(t.dimissionDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t.dimissionDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t.dimissionDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t.dimissionDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -900,7 +900,7 @@
                 and TO_DAYS(t1.returnDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.returnDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.returnDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.returnDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -932,7 +932,7 @@
                 and TO_DAYS(t1.physicalExamDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.physicalExamDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.physicalExamDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.physicalExamDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -967,7 +967,7 @@
                 and TO_DAYS(t1.arbitrationDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.arbitrationDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.arbitrationDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.arbitrationDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -1001,7 +1001,7 @@
                 and TO_DAYS(t1.injuredTime) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.injuredTime,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.injuredTime,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.injuredTime,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -1033,7 +1033,7 @@
                 and TO_DAYS(t1.injuredTime) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.injuredTime,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.injuredTime,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.injuredTime,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -1066,7 +1066,7 @@
                 and TO_DAYS(t1.applayDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.applayDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.applayDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.applayDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -1099,7 +1099,7 @@
                 and TO_DAYS(t1.applayDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.applayDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.applayDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.applayDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -1131,7 +1131,7 @@
                 and TO_DAYS(t1.badDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.badDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.badDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.badDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -1148,7 +1148,7 @@
         SELECT
         t1.*,t.empNumb,t.deptName,t.certificateNumb,t.allDeptName
         FROM
-        t_emp_baseinfo t right JOIN t_emp_jobChange t1 on t.empId=t1.empId inner  join t_dept t2 on t.deptId=t2.DEPT_ID where 1=1  and t2.DEPT_ID in
+        t_emp_baseinfo t right JOIN t_emp_jobchange t1 on t.empId=t1.empId inner  join t_dept t2 on t.deptId=t2.DEPT_ID where 1=1  and t2.DEPT_ID in
         <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
             #{item}
         </foreach> and t.delFlag=0 and t1.delFlag=0
@@ -1164,7 +1164,7 @@
                 and TO_DAYS(t1.changeDate) = TO_DAYS(NOW())
             </when>
             <when test="index==1">
-                and YEARWEEK(date_format(t1.changeDate,'%Y-%m-%d')) = YEARWEEK(now())
+                and YEARWEEK(date_format(t1.changeDate,'%Y-%m-%d'),1) = YEARWEEK(now())
             </when>
             <when test="index==2">
                 and date_format(t1.changeDate,'%Y-%m') = date_format(now(),'%Y-%m')
@@ -1175,4 +1175,8 @@
         </choose>
 
     </select>
+    <select id="selectAlertCount" resultType="java.lang.Long">
+        SELECT COUNT(*) FROM t_emp_baseinfo a
+            ${ew.customSqlSegment}
+    </select>
 </mapper>

--
Gitblit v1.8.0