From d4428bee31e1278d5cf0fa43cdba12864831bb94 Mon Sep 17 00:00:00 2001
From: yijiusmile <253281376@qq.com>
Date: 星期二, 02 三月 2021 10:30:19 +0800
Subject: [PATCH] 增加两项查询项
---
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 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 ab3e37a..38d780f 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
@@ -18,7 +18,7 @@
IF (t.dimissionType = '4', 1, NULL)
) gsct
FROM
- t_emp_baseinfo t where 1=1 and t.delFlag=0
+ t_emp_baseinfo t where 1=1 and t.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') >= #{btime} and date_format(t.createTime,'%Y-%m-%d') <= #{etime}
@@ -40,12 +40,12 @@
</select>
<select id="countBaseInfoList" resultType="java.util.Map">
SELECT
- count(IF(t.empStatus = 0, 1, NULL)) zzyg,
- count(IF(t.empStatus = 0 and t.empType = '1', 1, NULL)) zsyg,
- count(IF(t.empStatus = 0 and t.empType = '2', 1, NULL)) lsyg,
+ count(1) zzyg,
+ count(IF(t.empType = '1', 1, NULL)) zsyg,
+ count(IF(t.empType = '2', 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
+ t_emp_baseinfo t where 1=1 and t.delFlag=0 and t.empStatus = 0
</select>
@@ -77,7 +77,7 @@
count(IF(t1.contractStatus = 3, 1, NULL)) jcht
FROM
- t_emp_baseinfo t left JOIN t_emp_contractinfo t1 on t.empId=t1.empId where 1=1 and t.delFlag=0
+ t_emp_baseinfo t left 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(t.dimissionDate,'%Y-%m-%d') >= #{btime} and date_format(t.dimissionDate,'%Y-%m-%d') <= #{etime}
@@ -100,7 +100,7 @@
SELECT
count(1) czyg
FROM
- t_emp_baseinfo t INNER JOIN t_emp_resign t1 on t.empId=t1.empId where 1=1 and t.delFlag=0
+ t_emp_baseinfo t INNER JOIN t_emp_resign 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.applayDate,'%Y-%m-%d') >= #{btime} and date_format(t1.applayDate,'%Y-%m-%d') <= #{etime}
@@ -126,7 +126,7 @@
count(IF(t1.contractStatus = 2, 1, NULL)) xqht
FROM
- t_emp_baseinfo t INNER JOIN t_emp_contractinfo t1 on t.empId=t1.empId where 1=1 and t.delFlag=0
+ 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}
@@ -150,7 +150,7 @@
SELECT
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
+ 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
</select>
@@ -158,7 +158,7 @@
SELECT
count(IF(t1.contractStatus = 4, 1, NULL)) dqht
FROM
- t_emp_baseinfo t INNER JOIN t_emp_contractinfo t1 on t.empId=t1.empId where 1=1 and t.delFlag=0
+ 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.endDate,'%Y-%m-%d') >= #{btime} and date_format(t1.endDate,'%Y-%m-%d') <= #{etime}
@@ -204,7 +204,7 @@
SELECT
count(1) ygqj
FROM
- t_emp_baseinfo t right JOIN t_emp_leaveinfo t1 on t.empId=t1.empId where 1=1
+ t_emp_baseinfo t right JOIN t_emp_leaveinfo 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.returnDate,'%Y-%m-%d') >= #{btime} and date_format(t1.returnDate,'%Y-%m-%d') <= #{etime}
@@ -446,7 +446,7 @@
<select id="zzbaseInfoList" 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 empStatus=0 and t1.delFlag=0
+ select t1.* from t_emp_baseinfo t1 left join t_dept t2 on t1.deptId=t2.DEPT_ID where t1.empStatus=0 and t1.delFlag=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},'%'))
@@ -458,13 +458,13 @@
SELECT
t.*
FROM
- t_emp_baseinfo t left join t_dept t2 on t.deptId=t2.DEPT_ID where 1=1 and t.delFlag=0 and t.sex is not null and t.age !=0 and t.sex=1 and t.age>=${manOld}
+ t_emp_baseinfo t left join t_dept t2 on t.deptId=t2.DEPT_ID where 1=1 and t.empStatus = 0 and t.delFlag=0 and t.sex is not null and t.age !=0 and t.sex=1 and t.age>=${manOld}
UNION
SELECT
t.*
FROM
- t_emp_baseinfo t left join t_dept t2 on t.deptId=t2.DEPT_ID where 1=1 and t.delFlag=0 and t.sex is not null and t.age !=0 and t.sex=2 and t.age>=${womanOld}
+ t_emp_baseinfo t left join t_dept t2 on t.deptId=t2.DEPT_ID where 1=1 and t.empStatus = 0 and t.delFlag=0 and t.sex is not null and t.age !=0 and t.sex=2 and t.age>=${womanOld}
) t1 where 1=1
<if test="name!= 'undefined' and name!=null and name!=''">
and (t1.empNumb like CONCAT('%',#{name},'%') or t1.empName like CONCAT('%',#{name},'%') or
@@ -528,7 +528,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 empType='1' and t1.delFlag=0 and empStatus=0
+ 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
<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 +536,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 empType='2' and t1.delFlag=0 and empStatus=0
+ 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
<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},'%'))
@@ -546,7 +546,7 @@
<select id="lzbaseInfoList" 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 empStatus=1
+ 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
<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},'%'))
@@ -586,7 +586,7 @@
<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
+ 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'
<choose>
<when test="number==8">
and t1.dimissionType = '1'
@@ -1017,11 +1017,11 @@
<select id="empBaseInfoTgList" resultType="cc.mrbird.febs.server.hr.entity.EmpJobChange">
SELECT
- t1.*
+ t1.*,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 t1.empName like CONCAT('%',#{name},'%'
+ and t1.empName like CONCAT('%',#{name},'%')
</if>
<choose>
<when test="btime!='undefined' and btime!=null and btime!='' and etime!='undefined' and etime!=null and etime!=''">
--
Gitblit v1.8.0