select max(tagvalue) as max_value from 表名称 where 1=1
and samptime >='2022-03-18 00:00:00'
and samptime <='2022-03-18 23:59:59'
----前一天---
select max(tagvalue) as max_value from 表名称 where 1=1
and samptime >='2022-03-17 00:00:00'
and samptime <='2022-03-17 23:59:59'
/*参数的*/
select max(tagvalue) as max_value from 表名称 where 1=1
and samptime >='${date_code} 00:00:00'
and samptime <='${date_code} 23:59:59'
/*参数前一天的日期*/
select max(tagvalue) as max_value from 表名称 where 1=1
and samptime >='${DATEDELTA(date_code,-1)} 00:00:00'
and samptime <='${DATEDELTA(date_code,-1)} 23:59:59'