date_format(字段名,'%H:%i:%S')---可以取时分秒
DATE_FORMAT(字段名, '%Y-%m-%d')---可以取年月日
mysql中也是可以使用case when的
结果如下图: