1.日期函数 在mysql 使用 如下函数进行日期范围查询 and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
在 翰高数据库
AND TO_CHAR ( create_time , 'yyyy-mm-dd' ) >= TO_CHAR ( CAST ( '2024-11-20' AS DATE
) , 'yyyy-mm-dd' )
2.模糊查询
MySQL模糊查询方式
在 翰高数据库
<bind name="pattern" value="'%'+ taskName +'%'"/> and task_name like #{pattern}
3. 字符串数组查询 例如 (String = " 1,2,3")
find_in_set
在MySQL中使用
select * from sys_dept where find_in_set(#{deptId}, ancestors)
在翰高数据库中
select * from sys_dept where CAST(#{deptId} AS text) = ANY(string_to_array(ancestors, ','))