From 6edba268da4799fa3ebea904dfb21e6bef88ee6d Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期四, 11 三月 2021 11:24:07 +0800
Subject: [PATCH] fix(bug修复): 员工信息列表排序
---
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 47 insertions(+), 6 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 d2f02fd..761fe27 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
@@ -5,6 +5,12 @@
<select id="sysConfig" resultType="cc.mrbird.febs.common.core.entity.system.SysConfig">
select * from sys_config where delFlag='0' and config_key in ("manOld","womanOld") ORDER BY config_key asc
</select>
+
+ <select id="selectPageVo" resultType="cc.mrbird.febs.server.hr.entity.EmpBaseInfo">
+ 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
@@ -41,8 +47,8 @@
<select id="countBaseInfoList" resultType="java.util.Map">
SELECT
count(1) zzyg,
- count(IF(t.empType = '1', 1, NULL)) zsyg,
- count(IF(t.empType = '2', 1, NULL)) lsyg,
+ count(IF(t.empType = '01', 1, NULL)) zsyg,
+ count(IF(t.empType = '02', 1, NULL)) lsyg,
count( if(t.sex is not null and t.age !=0 and t.sex=1 and t.age>=${manOld},1,null))+count( if(t.sex is not null and t.age !=0 and t.sex=2 and t.age>=${womanOld},1,null)) clyg
FROM
t_emp_baseinfo t where 1=1 and t.delFlag=0 and t.empStatus = 0
@@ -151,6 +157,24 @@
count(IF(t1.contractStatus = 1 or t1.contractStatus = 2, 1, NULL)) yxht
FROM
t_emp_baseinfo t INNER JOIN t_emp_contractinfo t1 on t.empId=t1.empId where 1=1 and t.delFlag=0 and t1.delFlag=0
+
+ <choose>
+ <when test="btime!=null and btime!='' and etime!=null and etime!=''">
+ and date_format(t1.signingDate,'%Y-%m-%d') >= #{btime} and date_format(t1.signingDate,'%Y-%m-%d') <= #{etime}
+ </when>
+ <when test="index==0">
+ and TO_DAYS(t1.signingDate) = TO_DAYS(NOW())
+ </when>
+ <when test="index==1">
+ and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d')) = YEARWEEK(now())
+ </when>
+ <when test="index==2">
+ and date_format(t1.signingDate,'%Y-%m') = date_format(now(),'%Y-%m')
+ </when>
+ <otherwise>
+ and YEAR(t1.signingDate)=YEAR(NOW())
+ </otherwise>
+ </choose>
</select>
@@ -528,7 +552,7 @@
<select id="zsbaseInfoList" 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 t1.empType='1' and t1.delFlag=0 and t1.empStatus=0
+ select t1.* from t_emp_baseinfo t1 left join t_dept t2 on t1.deptId=t2.DEPT_ID where t1.empType='01' and t1.delFlag=0 and t1.empStatus=0
<if test="name!= 'undefined' and name!=null and name!=''">
and (t1.empNumb like CONCAT('%',#{name},'%') or t1.empName like CONCAT('%',#{name},'%') or
t1.certificateNumb like CONCAT('%',#{name},'%') or t2.DEPT_NAME like CONCAT('%',#{name},'%'))
@@ -536,7 +560,7 @@
</select>
<select id="lsbaseInfoList" 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 t1.empType='2' and t1.delFlag=0 and t1.empStatus=0
+ select t1.* from t_emp_baseinfo t1 left join t_dept t2 on t1.deptId=t2.DEPT_ID where t1.empType='02' and t1.delFlag=0 and t1.empStatus=0
<if test="name!= 'undefined' and name!=null and name!=''">
and (t1.empNumb like CONCAT('%',#{name},'%') or t1.empName like CONCAT('%',#{name},'%') or
t1.certificateNumb like CONCAT('%',#{name},'%') or t2.DEPT_NAME like CONCAT('%',#{name},'%'))
@@ -671,6 +695,23 @@
</when>
<otherwise>
and (t1.contractStatus = '1' or t1.contractStatus = '2')
+ <choose>
+ <when test="btime!='undefined' and btime!=null and btime!='' and etime!='undefined' and etime!=null and etime!=''">
+ and date_format(t1.signingDate,'%Y-%m-%d') >= #{btime} and date_format(t1.signingDate,'%Y-%m-%d') <= #{etime}
+ </when>
+ <when test="index==0">
+ and TO_DAYS(t1.signingDate) = TO_DAYS(NOW())
+ </when>
+ <when test="index==1">
+ and YEARWEEK(date_format(t1.signingDate,'%Y-%m-%d')) = YEARWEEK(now())
+ </when>
+ <when test="index==2">
+ and date_format(t1.signingDate,'%Y-%m') = date_format(now(),'%Y-%m')
+ </when>
+ <otherwise>
+ and YEAR(t1.signingDate)=YEAR(NOW())
+ </otherwise>
+ </choose>
</otherwise>
</choose>
<if test="name!= 'undefined' and name!=null and name!=''">
@@ -1017,11 +1058,11 @@
<select id="empBaseInfoTgList" resultType="cc.mrbird.febs.server.hr.entity.EmpJobChange">
SELECT
- t1.*,t.*
+ t1.*,t.empNumb,t.deptName,t.certificateNumb
FROM
t_emp_baseinfo t right JOIN t_emp_jobChange t1 on t.empId=t1.empId where 1=1 and t.delFlag=0 and t1.delFlag=0
<if test="name!= 'undefined' and name!=null and name!=''">
- and (t.empNumb like CONCAT('%',#{name},'%') or t.empName like CONCAT('%',#{name},'%') or
+ and (t.empNumb like CONCAT('%',#{name},'%') or t1.empName like CONCAT('%',#{name},'%') or
t.certificateNumb like CONCAT('%',#{name},'%') or t.deptName like CONCAT('%',#{name},'%'))
</if>
<choose>
--
Gitblit v1.8.0