luoyb
2021-02-19 d48f137e71193bd8b3bb39570eca666798fda070
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpBaseInfoMapper.xml
@@ -1029,4 +1029,33 @@
        </choose>
    </select>
    <select id="empBaseInfoTgList" resultType="cc.mrbird.febs.server.hr.entity.EmpJobChange">
        SELECT
        t1.*
        FROM
        t_emp_baseinfo t right JOIN t_emp_jobChange t1 on t.empId=t1.empId where 1=1
        <if test="name!= 'undefined' and name!=null and 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!=''">
                and date_format(t1.changeDate,'%Y-%m-%d') &gt;= #{btime}  and date_format(t1.changeDate,'%Y-%m-%d') &lt;= #{etime}
            </when>
            <when test="index==0">
                and TO_DAYS(t1.changeDate) = TO_DAYS(NOW())
            </when>
            <when test="index==1">
                and YEARWEEK(date_format(t1.changeDate,'%Y-%m-%d')) = YEARWEEK(now())
            </when>
            <when test="index==2">
                and date_format(t1.changeDate,'%Y-%m') = date_format(now(),'%Y-%m')
            </when>
            <otherwise>
                and YEAR(t1.changeDate)=YEAR(NOW())
            </otherwise>
        </choose>
    </select>
</mapper>