SELECT DATEDIFF(JSON_UNQUOTE(JSON_EXTRACT(content,'$.departuretime')),NOW()) AS daysnum,id,content->'$.title' AS title
FROM tablename
WHERE `type` = 2
AND (DATEDIFF(JSON_UNQUOTE(JSON_EXTRACT(content,'$.departuretime')),NOW())+ JSON_UNQUOTE(JSON_EXTRACT(content,'$.plandays'))) >-1
;