<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.iotechn.unimall.data.mapper.MessageMapper">
    <select id="getMessageList" resultType="com.iotechn.unimall.data.dto.MessageDTO">
       SELECT
            m.id,
            m.customer,
            m.operation,
            m.result,
            DATE_FORMAT(
                m.gmt_update,
                "%Y年%m月%d日"
            ) AS gmtUpdate1,
            DATE_FORMAT(
                m.gmt_update,
                "%H:%i:%S"
            ) AS gmtUpdate
        FROM
            unimall_message m
        WHERE
            m.user_id = #{userId}
        ORDER BY
            m.gmt_update DESC
    </select>
</mapper>