SELECT * FROM ( SELECT *,TIMESTAMPDIFF(month, registration_date, NOW()) as dis, CASE WHEN registration_date <![CDATA[ <= ]]> DATE_SUB(NOW(), INTERVAL 8 YEAR) AND audit =1 THEN 1 ELSE 2 END AS sort_order FROM care_record ${ew.customSqlSegment} ) AS subquery ORDER BY sort_order, registration_date DESC, create_time desc
本文来自博客园,作者:狂躁的键盘,转载请注明原文链接:https://www.cnblogs.com/wangweiip/p/18042970