--hcm 修复hcm 当天入职原工,当天凌晨生效问题
CREATE OR REPLACE FUNCTION BDM.F_VI_HCM_FOR_BDM_REAL_OPTTIME(V_TIME IN TIMESTAMP)
RETURN TIMESTAMP
AS
V_TIME_STR VARCHAR2(200);
V_TIME_RETURN TIMESTAMP := V_TIME;
BEGIN
V_TIME_STR := TO_CHAR(V_TIME, 'YYYY-MM-DD HH24:MI:SSSSS');
IF SUBSTR(V_TIME_STR, 12) = '00:00:00000' THEN
V_TIME_STR := SUBSTR(V_TIME_STR, 1, 10) || '12:00:00';
V_TIME_RETURN := TO_TIMESTAMP(V_TIME_STR, 'YYYY-MM-DD HH24:MI:SS');
END IF;
RETURN V_TIME_RETURN;
END F_VI_HCM_FOR_BDM_REAL_OPTTIME;