| | |
| | | <select id="countZcygBaseInfoList" resultType="java.util.Map"> |
| | | SELECT |
| | | count( |
| | | IF (t.dimissionType = '1', 1, NULL) |
| | | IF (t.dimissionType = '6', 1, NULL) |
| | | ) zclz, |
| | | count( |
| | | IF (t.dimissionType = '2', 1, NULL) |
| | | IF (t.dimissionType = '4', 1, NULL) |
| | | ) zdlz, |
| | | count( |
| | | IF (t.dimissionType = '4', 1, NULL) |
| | | IF (t.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' |
| | | <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} |
| | | and date_format(t.dimissionDate,'%Y-%m-%d') >= #{btime} and date_format(t.dimissionDate,'%Y-%m-%d') <= #{etime} |
| | | </when> |
| | | <when test="index==0"> |
| | | and TO_DAYS(t.createTime) = TO_DAYS(NOW()) |
| | | and TO_DAYS(t.dimissionDate) = TO_DAYS(NOW()) |
| | | </when> |
| | | <when test="index==1"> |
| | | and YEARWEEK(date_format(t.createTime,'%Y-%m-%d')) = YEARWEEK(now()) |
| | | and YEARWEEK(date_format(t.dimissionDate,'%Y-%m-%d')) = YEARWEEK(now()) |
| | | </when> |
| | | <when test="index==2"> |
| | | and date_format(t.createTime,'%Y-%m') = date_format(now(),'%Y-%m') |
| | | and date_format(t.dimissionDate,'%Y-%m') = date_format(now(),'%Y-%m') |
| | | </when> |
| | | <otherwise> |
| | | and YEAR(t.createTime)=YEAR(NOW()) |
| | | and YEAR(t.dimissionDate)=YEAR(NOW()) |
| | | </otherwise> |
| | | </choose> |
| | | |
| | |
| | | </foreach> |
| | | <choose> |
| | | <when test="number==8"> |
| | | and t1.dimissionType = '1' |
| | | and t1.dimissionType = '6' |
| | | </when> |
| | | <when test="number==9"> |
| | | and t1.dimissionType = '2' |
| | | and t1.dimissionType = '4' |
| | | </when> |
| | | <when test="number==10"> |
| | | and t1.dimissionType = '4' |
| | | and t1.dimissionType = '3' |
| | | </when> |
| | | <otherwise> |
| | | |
| | |
| | | </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') >= #{btime} and date_format(t1.createTime,'%Y-%m-%d') <= #{etime} |
| | | and date_format(t1.dimissionDate,'%Y-%m-%d') >= #{btime} and date_format(t1.dimissionDate,'%Y-%m-%d') <= #{etime} |
| | | </when> |
| | | <when test="index==0"> |
| | | and TO_DAYS(t1.createTime) = TO_DAYS(NOW()) |
| | | and TO_DAYS(t1.dimissionDate) = TO_DAYS(NOW()) |
| | | </when> |
| | | <when test="index==1"> |
| | | and YEARWEEK(date_format(t1.createTime,'%Y-%m-%d')) = YEARWEEK(now()) |
| | | and YEARWEEK(date_format(t1.dimissionDate,'%Y-%m-%d')) = YEARWEEK(now()) |
| | | </when> |
| | | <when test="index==2"> |
| | | and date_format(t1.createTime,'%Y-%m') = date_format(now(),'%Y-%m') |
| | | and date_format(t1.dimissionDate,'%Y-%m') = date_format(now(),'%Y-%m') |
| | | </when> |
| | | <otherwise> |
| | | and YEAR(t1.createTime)=YEAR(NOW()) |
| | | and YEAR(t1.dimissionDate)=YEAR(NOW()) |
| | | </otherwise> |
| | | </choose> |
| | | |