<?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.jxy.marketall.mapper.USDMapper">

    <select id="getETHMintedList" resultType="com.jxy.marketall.dto.USDMintedDto">
        select
        unixdt `date`,
        fromaddress fromAddress,
        toaddress toAddress,
        amount,
        height,
        txid,
        `action`
        from
        ethminttxv2
        <where>
            coin = #{vo.coin}
            <if test="vo.start != null and vo.start != ''">
                and unixdt &gt;= #{vo.start}
            </if>
            <if test="vo.end != null and vo.end != ''">
                and unixdt &lt;= #{vo.end}
            </if>
            <if test="vo.amount != null and vo.amount != 0">
                and amount &gt;= #{vo.amount}
            </if>
            <if test="vo.address != null and vo.address != ''">
                and fromaddress = #{vo.address}
            </if>
            <if test="vo.action != null and vo.action != ''">
                and `action` = #{vo.action}
            </if>
            <if test="vo.txid != null and vo.txid != ''">
                and txid = #{vo.txid}
            </if>
        </where>
        order by unixdt;
    </select>

    <select id="getETHMintedListToAddr" resultType="com.jxy.marketall.dto.USDMintedDto">
        select
        unixdt `date`,
        fromaddress fromAddress,
        toaddress toAddress,
        amount,
        height,
        txid,
        `action`
        from
        ethminttxv2
        <where>
            coin = #{vo.coin}
            <if test="vo.start != null and vo.start != ''">
                and unixdt &gt;= #{vo.start}
            </if>
            <if test="vo.end != null and vo.end != ''">
                and unixdt &lt;= #{vo.end}
            </if>
            <if test="vo.amount != null and vo.amount != 0">
                and amount &gt;= #{vo.amount}
            </if>

            <if test="vo.action != null and vo.action != ''">
                and `action` = #{vo.action}
            </if>
            <if test="vo.address != null and vo.address != ''">
                and toaddress = #{vo.address}
            </if>
            <if test="vo.txid != null and vo.txid != ''">
                and txid = #{vo.txid}
            </if>
        </where>
        order by unixdt;
    </select>

    <select id="getDailyMinted" resultType="com.jxy.marketall.dto.ETHMintedCountDto">
        select unixdt `date`,issue,redeem
        from ethmintv2
        <where>
            coin = #{coin}
            <if test="vo.start != null and vo.start != ''">
                and unixdt &gt;= #{vo.start}
            </if>
            <if test="vo.end != null and vo.end != ''">
                and unixdt &lt;= #{vo.end}
            </if>
        </where>
        order by unixdt;
    </select>

</mapper>
