<?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.Utxos2ndMapper">


	<select id="getNewUtxos2nd" resultType="com.jxy.marketall.dto.Utxos2ndDto">
        SELECT
			DATE_FORMAT(unixdt,'%Y-%m-%d') AS dateTime,
			balance_amount_0,
			balance_amount_01,
			balance_amount_001,
			balance_amount_1,
			balance_amount_10,
			balance_amount_100,
			balance_amount_1000,
			balance_amount_10000
		FROM
			`utxos3nd`
		ORDER BY
			unixdt DESC
			LIMIT 1
	</select>

	<select id="getUtxos2ndList" resultType="com.jxy.marketall.dto.Utxos2ndBalanceDto">
		SELECT
			u.total_balance totalBalance,
			DATE_FORMAT(u2.unixdt,'%Y-%m-%d') AS dateTime,
			balance_amount_0,
			balance_amount_01,
			balance_amount_001,
			balance_amount_1,
			balance_amount_10,
			balance_amount_100,
			balance_amount_1000,
			balance_amount_10000
		FROM
			`utxos3nd` u2
			left join utxosv3 u on u.unixdt = u2.unixdt
		where
			u.total_balance is not null
		ORDER BY
			u2.unixdt
	</select>

</mapper>
