# `FUN_GET_DATE_YX` (function)

> 根据传入时间获取时间


- **Type:** FUNCTION
- **Returns:** `varchar(255)`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_tCStartTime` | `varchar(200)` |
| 2 | IN | `p_sStartDate` | `varchar(200)` |
| 3 | IN | `p_sEndDate` | `varchar(200)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTION `FUN_GET_DATE_YX`'`._

## Narrative

**Business context:** 生产排程 → 生产计划管理 → 生产管理 — orphaned variant of the cross-midnight rest-shifter. Body is structurally identical to `FUN_GET_DATE_KT` (same `p_sStartDate`/`p_sEndDate` default 23:30 → 00:30 cross-midnight window logic), differing only in the branch-2 fallback: where `FUN_GET_DATE_KT` rolls `p_tCStartTime` to *next day's `p_sEndDate`*, this one only assigns it on the cross-midnight branch and leaves the same-day branch untouched.

**What it does:** if `p_tCStartTime` falls in the (prev-day-start … today-end) cross-midnight window, jump it to tomorrow's `p_sEndDate`; else if it falls in the (today-start … tomorrow-end) window, jump it to today's `p_sEndDate`; otherwise unchanged.

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, exhaustive xly-src grep across all extensions) — only its own `.sql` def file exists. Likely superseded by `FUN_GET_DATE_KT`. Candidate for maintainer audit.
