<?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.fzm.mall.server.admin.finance_center.mapper.PlatformAssetsFlowMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.finance_center.model.PlatformAssetsFlow">
        <id column="id" property="id"/>
        <result column="flow_id" property="flowId"/>
        <result column="coin" property="coin"/>
        <result column="amount" property="amount"/>
        <result column="type" property="type"/>
        <result column="status" property="status"/>
        <result column="other_side" property="otherSide"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <select id="page" resultType="com.fzm.mall.server.admin.finance_center.entity.vo.PlatformAssetsFlowVO">
        SELECT
        flow_id,coin AS assetsType,amount,other_side,type,status,create_time
        FROM
        platform_assets_flow
        <where>
            <if test="flowId!=null and flowId!=''">
                flow_id = #{flowId}
            </if>
            <if test="coin!=null and coin!=''">
                AND
                coin = #{coin}
            </if>
            <if test="type!=null">
                AND
                type = #{type}
            </if>
        </where>
        ORDER BY
        create_time
        DESC
    </select>
</mapper>
