luoyb
2021-03-07 cc5d37f9636138adb1dc490764fdd41a701591f5
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
@@ -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') &gt;= #{btime}  and date_format(t1.signingDate,'%Y-%m-%d') &lt;= #{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>
@@ -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') &gt;= #{btime}  and date_format(t1.signingDate,'%Y-%m-%d') &lt;= #{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!=''">
@@ -1021,7 +1062,7 @@
        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>