mysql查询之将数据库Date时间直接转换为时间戳long

       SELECT
            a.`id`,
            a.`type`,
            UNIX_TIMESTAMP(a.`createTime`/1000) AS createTime,
            a.`status`,
            u.`name` AS creatorName,
            a.`name`,
            a.`score`,
            ar.`content`
        FROM activity a
            LEFT JOIN activity_record ar ON a.`id` = ar.`activityId`
            LEFT JOIN user u ON u.`id` = a.`creatorId`
        WHERE a.`childrenHomeId` = #{childrenHomeId};

你可能感兴趣的:(mysql查询之将数据库Date时间直接转换为时间戳long)