luoyb
2021-06-20 18c13ba8900911f41a60df49125b4570b3852e0b
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml
@@ -19,31 +19,31 @@
    <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') &gt;= #{btime}  and date_format(t.createTime,'%Y-%m-%d') &lt;= #{etime}
                and date_format(t.dimissionDate,'%Y-%m-%d') &gt;= #{btime}  and date_format(t.dimissionDate,'%Y-%m-%d') &lt;= #{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>
@@ -662,13 +662,13 @@
        </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>
@@ -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(t1.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(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>