Q:

Conditional SQL Query Assistance

Question
With everything and all the examples and data provided below, is there another way to do this to get the expected results doing the UNION of the different tables? 
My Trouble 
Essentially I need to have conditional logic to:

if there are records found within the defined time period then get all the records (multiple) from the table 
if there are no records found within the defined time period then get the newest 1 record from the table since before the
defined time period

Steps
Just create the tables and insert the data as I listed below with that logic, and then run each query I provided in each example and you can easily emulate exactly what I'm referring to.
Context & Clarification

Perhaps using a temp / memory table in place of the @Now~ variables and have the TRUE condition there UNION in the correlated temp table, or maybe some elaborate (or may simple for some) data table JOIN methods?
I refer to a "Defined Time Period" below or words closely meaning the same, and by those words I am talking about a specific start time and a specific end time and all the time between those two points—that's what I'm talking about when I use the term.

There is a reporting system that generates these start and end time frames and I've gotten the logic in a stored procedure which is called and the date times are passed in.

I only provided portions of the stored proc and made a few select queries out of it to give an example of the issue and the expected or needed result.

Creating the Data
With the below you can create three tables in a MySQL DB and this will also populate the data I used in the queries I run to show results and such beneath each so you can follow along and have data to play with to maybe even help me out with a solution or a pointer or two.
Note: Before sure to change <DBName> to an actual DB name or schema on your MySQL instance.

USE <DBName>; 
CREATE TABLE `ponumber` (
  `TimeStr` datetime NOT NULL,
  `Value` int(11) NOT NULL,
  UNIQUE KEY `uk_Times` (`TimeStr`));

CREATE TABLE `batch_number` (
  `TimeStr` datetime NOT NULL,
  `Value` int(11) NOT NULL,
  UNIQUE KEY `uk_Times` (`TimeStr`));

CREATE TABLE `batchweight` (
  `TimeStr` datetime NOT NULL,
  `Value` int(11) NOT NULL,
  UNIQUE KEY `uk_Times` (`TimeStr`));

INSERT INTO `PONumber`     (`TimeStr`,`Value`) VALUES ('2017-09-28 10:47:55',0);
INSERT INTO `PONumber`     (`TimeStr`,`Value`) VALUES ('2017-09-28 06:26:07',1217911);
INSERT INTO `PONumber`     (`TimeStr`,`Value`) VALUES ('2017-09-28 05:24:18',1217906);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-29 12:46:18',5522);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-29 12:25:33',5521);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-29 11:44:45',5520);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-28 06:26:05',5519);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-28 05:22:58',5518);
INSERT INTO `batchweight`  (`TimeStr`,`Value`) VALUES ('2017-09-29 12:46:19',38985);
INSERT INTO `batchweight`  (`TimeStr`,`Value`) VALUES ('2017-09-28 06:26:07',38985);
INSERT INTO `batchweight`  (`TimeStr`,`Value`) VALUES ('2017-09-28 05:23:03',31002);

Query One
USE <DBName>; 

SET @bStartTime   = '2017-09-29 11:10:00';
SET @bEndTime     = '2017-09-29 12:48:00';

SELECT TimeStr, CONCAT('Set Load Number: ',Value) AS Value
FROM ponumber 
WHERE TimeStr BETWEEN @bStartTime AND @bEndTime

UNION 

SELECT TimeStr, CONCAT('Set Batch Number: ',Value) AS Value
FROM batch_number 
WHERE TimeStr BETWEEN @bStartTime AND @bEndTime

UNION 

SELECT TimeStr, 
    CONCAT('Batch Weight: ',Value) AS Value
FROM batchweight
WHERE TimeStr BETWEEN @bStartTime AND @bEndTime

ORDER BY TimeStr;

Query One Result

As you can see there is no Set Load Number because there are no records in the PONumber table from the times defined by the @bStartTime and @bEndTime variables—the defined time period.

If there are no data records in the PONumber table during the defined time period then the result should list the most recent records from that table, even those fall outside of the defined time period, so I built Query Two.
Query Two
USE <DBName>; 
SET @bStartTime   = '2017-09-29 11:10:00';
SET @bEndTime     = '2017-09-29 12:48:00';

SET @LastPONumber = (SELECT Value FROM PONumber ORDER BY TimeStr DESC LIMIT 1); 
SET @NowPONumber  = (SELECT Value FROM PONumber WHERE TimeStr BETWEEN @bStartTime AND @bEndTime ORDER BY TimeStr DESC LIMIT 1);
SET @LastPONumTimeStr  = (SELECT TimeStr FROM PONumber ORDER BY TimeStr DESC LIMIT 1); 
SET @NowPONumTimeStr   = (SELECT TimeStr FROM PONumber WHERE TimeStr BETWEEN @bStartTime AND @bEndTime ORDER BY TimeStr DESC LIMIT 1);

SELECT DISTINCT TimeStr, Value FROM  
    (SELECT 
        CASE 
        WHEN TimeStr = 1 THEN 
            (SELECT @NowPONumTimeStr AS TimeStr) 
                ELSE 
            (SELECT @LastPONumTimeStr AS TimeStr)
                END AS TimeStr,
        CASE 
        WHEN Value = 1 THEN 
            (SELECT (CONCAT('Set Load Number: ',@NowPONumber)) AS Value) 
                ELSE 
            (SELECT (CONCAT('Set Load Number: ',@LastPONumber)) AS Value)
                END AS Value
    FROM PONumber) AS X

UNION 

SELECT TimeStr, CONCAT('Set Batch Number: ',Value) AS Value
FROM batch_number 
WHERE TimeStr BETWEEN @bStartTime AND @bEndTime

UNION 

SELECT TimeStr, 
    CONCAT('Batch Weight: ',Value) AS Value
FROM batchweight
WHERE TimeStr BETWEEN @bStartTime AND @bEndTime

ORDER BY TimeStr;

Query Two Result

So Query Two is where I created the @LastPONumber, @NowPONumber, @LastPONumTimeStr, and @NowPONumTimeStr variables and set those values to be a SELECT query result using ORDER BY DESC and LIMIT 1  depending on the conditions using CASE WHEN expressions.
The results now show the most recent PONumber table records since none were found between the defined time period, so this allowed it to go back further outside the defined time period.

Now there's a requirement if there are no data records in the Batch_Number table during a defined time period to list the most recent record just as done with the PONumber table in Query Two, so I built Query Three using the same condition CASE WHEN logic, etc. as Query Two used for the PONumber table.
Query Three
USE <DBName>; 
SET @bStartTime   = '2017-09-29 11:10:00';
SET @bEndTime     = '2017-09-29 12:48:00';

## - PONumber Table Variables
SET @LastPONumber = (SELECT Value FROM PONumber ORDER BY TimeStr DESC LIMIT 1); 
SET @NowPONumber  = (SELECT Value FROM PONumber WHERE TimeStr BETWEEN @bStartTime AND @bEndTime ORDER BY TimeStr DESC LIMIT 1);
SET @LastPONumTimeStr  = (SELECT TimeStr FROM PONumber ORDER BY TimeStr DESC LIMIT 1); 
SET @NowPONumTimeStr   = (SELECT TimeStr FROM PONumber WHERE TimeStr BETWEEN @bStartTime AND @bEndTime ORDER BY TimeStr DESC LIMIT 1);

## - Batch_Number Table Variables
SET @LastBatNumber = (SELECT Value FROM Batch_Number ORDER BY TimeStr DESC LIMIT 1); 
SET @NowBatNumber  = (SELECT Value FROM Batch_Number WHERE TimeStr BETWEEN @bStartTime AND @bEndTime ORDER BY TimeStr DESC LIMIT 1);
SET @LastBatNumTimeStr  = (SELECT TimeStr FROM Batch_Number ORDER BY TimeStr DESC LIMIT 1); 
SET @NowBatNumTimeStr   = (SELECT TimeStr FROM Batch_Number WHERE TimeStr BETWEEN @bStartTime AND @bEndTime ORDER BY TimeStr DESC LIMIT 1);

SELECT DISTINCT TimeStr, Value FROM  
    (SELECT 
        CASE 
        WHEN TimeStr = 1 THEN 
            (SELECT @NowPONumTimeStr AS TimeStr) 
                ELSE 
            (SELECT @LastPONumTimeStr AS TimeStr)
                END AS TimeStr,
        CASE 
        WHEN Value = 1 THEN 
            (SELECT (CONCAT('Set Load Number: ',@NowPONumber)) AS Value) 
                ELSE 
            (SELECT (CONCAT('Set Load Number: ',@LastPONumber)) AS Value)
                END AS Value
    FROM PONumber) AS X

UNION 

SELECT DISTINCT TimeStr, Value FROM  
    (SELECT 
        CASE 
        WHEN TimeStr = 1 THEN 
            (SELECT @NowBatNumTimeStr AS TimeStr) 
                ELSE 
            (SELECT @LastBatNumTimeStr AS TimeStr)
                END AS TimeStr,
        CASE 
        WHEN Value = 1 THEN 
            (SELECT (CONCAT('Set Batch Number: ',@NowBatNumber)) AS Value) 
                ELSE 
            (SELECT (CONCAT('Set Batch Number: ',@LastBatNumber)) AS Value)
                END AS Value
    FROM Batch_Number) AS X

UNION 

SELECT TimeStr, 
    CONCAT('Batch Weight: ',Value) AS Value
FROM batchweight
WHERE TimeStr BETWEEN @bStartTime AND @bEndTime

ORDER BY TimeStr;

Query Three Result

When the result of Query Three detects the Batch_Number table does have records between the defined time period, it only lists the most recent one record and doesn't list the other two batch number values (5521, and 5520) as shown in Query Two Result. This is obviously due to the @NowBatNumber query variable containing only the most recent 1 record.
The Problem

I need to be able to check for Batch_Number records between a
defined time period and do one of two things:

If the records between that time period exist then list all the records and not just the most recent one record
If no records are found between the defined time period then look back further outside that time period and list the most recent one record

Essentially for the Batch_Number table and how I tried that in Query Three I would expect the results to look exactly like the Query Two Result and still use the conditional logic to show what's needed otherwise.
Go back and up read the Question again please as it may make better sense now.

A:

Short and simple questions tend to get more attention than long/complex ones. This isn't because we can't answer but with so many questions, and so little volunteer time to give, it is hard to justify the time to read big questions.
However I think your basic requirement isn't that complex. You want a way to retrieve rows that fall within a time range OR if not in that range provide the closest rows to that range. 
In databases that support ROW_NUMBER() OVER() this is quite easy (and MySQL 8.x is planned to support this), but until that time to emulate row_number() you can use variables and an ordered subquery.
You can trial this solution here at SQL Fiddle
MySQL 5.6 Schema Setup:
CREATE TABLE `ponumber` (
  `TimeStr` datetime NOT NULL,
  `Value` int(11) NOT NULL,
  UNIQUE KEY `uk_Times` (`TimeStr`));

INSERT INTO `PONumber`     (`TimeStr`,`Value`) VALUES ('2017-09-28 10:47:55',0);
INSERT INTO `PONumber`     (`TimeStr`,`Value`) VALUES ('2017-09-28 06:26:07',1217911);
INSERT INTO `PONumber`     (`TimeStr`,`Value`) VALUES ('2017-09-28 05:24:18',1217906);

CREATE TABLE `batch_number` (
  `TimeStr` datetime NOT NULL,
  `Value` int(11) NOT NULL,
  UNIQUE KEY `uk_Times` (`TimeStr`));

INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-29 12:46:18',5522);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-29 12:25:33',5521);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-29 11:44:45',5520);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-28 06:26:05',5519);
INSERT INTO `batch_number` (`TimeStr`,`Value`) VALUES ('2017-09-28 05:22:58',5518);

CREATE TABLE `batchweight` (
  `TimeStr` datetime NOT NULL,
  `Value` int(11) NOT NULL,
  UNIQUE KEY `uk_Times` (`TimeStr`));

INSERT INTO `batchweight`  (`TimeStr`,`Value`) VALUES ('2017-09-29 12:46:19',38985);
INSERT INTO `batchweight`  (`TimeStr`,`Value`) VALUES ('2017-09-28 06:26:07',38985);
INSERT INTO `batchweight`  (`TimeStr`,`Value`) VALUES ('2017-09-28 05:23:03',31002);

Query:
SET @bStartTime  := '2017-09-29 11:10:00'   
SET @bEndTime    := '2017-09-29 12:48:00'

SELECT 
      SrcTable, TimeStr, Value
FROM (
      SELECT
            @row_num :=IF( @prev_value=u.SrcTable, @row_num + 1 ,1) AS RowNumber
          , u.*
          , @prev_value := u.SrcTable
      FROM (

          select 'ponumber' SrcTable , TimeStr, `Value`
          from ponumber
          union all
          select 'batch_number' SrcTable , TimeStr, `Value`
          from batch_number
          union all
          select 'batchweight' SrcTable , TimeStr, `Value`
          from batchweight
          ) u
      CROSS JOIN (SELECT @row_num := 1,  @prev_value :='') vars
      ORDER BY SrcTable, TimeStr DESC
      ) d
WHERE (d.TimeStr between @bStartTime and @bEndTime)
   OR (TimeStr < @bStartTime AND RowNumber = 1)

So, what this does is compute a "RowNumber" which starts at 1 for the most recent row for each source table. Then this derived table is filtered either by the time range, or by the row number if not within the time range.
Also note I have NOT used UNION but instead have used UNION ALL. There is a big difference in performance and should learn to use each according to need. If using UNION don't also use select distinct because you are just wasting effort.
Results:
|     SrcTable |              TimeStr | Value |
|--------------|----------------------|-------|
|  batchweight | 2017-09-29T12:46:19Z | 38985 |
| batch_number | 2017-09-29T12:46:18Z |  5522 |
| batch_number | 2017-09-29T12:25:33Z |  5521 |
| batch_number | 2017-09-29T11:44:45Z |  5520 |
|     ponumber | 2017-09-28T10:47:55Z |     0 |

