|
@@ -26,9 +26,9 @@
|
|
|
AND position_code != ''
|
|
|
AND arrival = 1
|
|
|
AND flio = 'A'
|
|
|
- AND IFNULL(IFNULL(frlt, IFNULL(felt, IFNULL(rstr, IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
+ AND IFNULL(IFNULL(IF(alte = 0, frlt, drlt), IFNULL(IF(alte = 0, felt, delt), IFNULL(rstr, IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
- AND IFNULL(IFNULL(frtt, IFNULL(fett, IFNULL(rend, eend))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) >=
|
|
|
+ AND IFNULL(IFNULL(rend, IFNULL(IF(alte = 0, frtt, drtt), IFNULL(IF(alte = 0, fett, dett), eend))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) >=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
AND (depe != 1 OR depe IS NULL)
|
|
|
AND del = 0
|
|
@@ -42,9 +42,9 @@
|
|
|
AND position_code != ''
|
|
|
AND flio = 'A'
|
|
|
AND rend IS NULL
|
|
|
- AND IFNULL(IFNULL(frlt, IFNULL(felt, IFNULL(rstr, IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
+ AND IFNULL(IFNULL(IF(alte = 0, frlt, drlt), IFNULL(IF(alte = 0, felt, delt), IFNULL(rstr, IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
- AND IFNULL(IFNULL(frtt, IFNULL(fett, IFNULL(rend, eend))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
+ AND IFNULL(IFNULL(rend, IFNULL(IF(alte = 0, frtt, drtt), IFNULL(IF(alte = 0, fett, dett), eend))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
AND (depe != 1 OR depe IS NULL)
|
|
|
AND del = 0
|
|
@@ -61,9 +61,9 @@
|
|
|
WHERE position_code IS NOT NULL
|
|
|
AND position_code != ''
|
|
|
AND flio = 'D'
|
|
|
- AND IFNULL(IFNULL(frlt, IFNULL(rstr, IFNULL(felt, IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
+ AND IFNULL(IFNULL(IF(alte = 0, frlt, drlt), IFNULL(rstr, IFNULL(IF(alte = 0, felt, delt), IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
- AND IFNULL(IFNULL(frtt, IFNULL(fett, IFNULL(rend, IFNULL(fptt, eend)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) >=
|
|
|
+ AND IFNULL(IFNULL(rend, IFNULL(IF(alte = 0, frtt, drtt), IFNULL(IF(alte = 0, fett, dett), IFNULL(fptt, eend)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) >=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
AND (depe != 1 OR depe IS NULL)
|
|
|
AND del = 0
|
|
@@ -76,9 +76,9 @@
|
|
|
WHERE position_code IS NOT NULL
|
|
|
AND position_code != ''
|
|
|
AND flio = 'D'
|
|
|
- AND IFNULL(IFNULL(frlt, IFNULL(rstr, IFNULL(felt, IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
+ AND IFNULL(IFNULL(IF(alte = 0, frlt, drlt), IFNULL(rstr, IFNULL(IF(alte = 0, felt, delt), IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
- AND IFNULL(IFNULL(frtt, IFNULL(fett, IFNULL(rend, IFNULL(fptt, eend)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) >=
|
|
|
+ AND IFNULL(IFNULL(rend, IFNULL(IF(alte = 0, frtt, drtt), IFNULL(IF(alte = 0, fett, dett), IFNULL(fptt, eend)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) >=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
AND (depe != 1 OR depe IS NULL)
|
|
|
AND afid IS NULL
|
|
@@ -92,9 +92,9 @@
|
|
|
WHERE position_code IS NOT NULL
|
|
|
AND position_code != ''
|
|
|
AND flio = 'D'
|
|
|
- AND IFNULL(IFNULL(frlt, IFNULL(rstr, IFNULL(felt, IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
+ AND IFNULL(IFNULL(IF(alte = 0, frlt, drlt), IFNULL(rstr, IFNULL(IF(alte = 0, felt, delt), IFNULL(fplt, estr)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
- AND IFNULL(IFNULL(frtt, IFNULL(fett, IFNULL(rend, IFNULL(fptt, eend)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
+ AND IFNULL(IFNULL(rend, IFNULL(IF(alte = 0, frtt, drtt), IFNULL(IF(alte = 0, fett, dett), IFNULL(fptt, eend)))), DATE_ADD(CURDATE(), INTERVAL 1 DAY)) <=
|
|
|
date_format(#{date,jdbcType=TIMESTAMP}, '%Y-%m-%d %H:%i:%s.%f')
|
|
|
AND (depe != 1 OR depe IS NULL)
|
|
|
AND del = 0
|