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

	<select id="getRealTimeProfitRateList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.DateBigDecimalDto">
		SELECT distinct
			unixdt as `date`,
			profitrate as `value`,
			price
		FROM
			rt_dailyindsv3e1
			<where>
				<if test="vo.start != null and vo.start != ''">
					and unixdt &gt;= "${vo.start}"
				</if>
			</where>
		ORDER BY
			unixdt desc limit 300
	</select>

	<select id="getRealTimeFeesList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.DateBigDecimalDto">
		SELECT distinct
			unixdt as `date`,
			fees as `value`,
			price
		FROM
		rt_dailyindsv3e1
		<where>
			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>
		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeAddressList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.AddressDto">
		SELECT distinct
			unixdt as `date`,
			new_address as newAddress,
			new_address_volume as newAddressVolume,
			active_address as activeAddress,
			send_address as sendAddress,
			total_address as totalAddress,
			receive_address as receiveAddress,
			price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>
		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeVolumeList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.DateBigDecimalDto">
		SELECT distinct
		unixdt as `date`,
		volume as `value`,
		price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>
		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeeaVolumeList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.DateBigDecimalDto">
		SELECT distinct
		unixdt as `date`,
		eavolume as `value`,
		price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>

		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeSoprList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.SoprDto">
		SELECT distinct
			unixdt as `date`,
			sopr,
			asopr,
			easopr,
			lthsopr,
			sthsopr,
			price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>
		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeCDDList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.CoinDayDesDto">
		SELECT distinct
		unixdt as `date`,
		cdd,
		sacdd,
		eacdd,
		price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>
		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeAsolList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.ASOLDto">
		SELECT distinct
		unixdt as `date`,
		asol,
		eaasol,
		price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>
		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeDormancyList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.DormancyDto">
		SELECT distinct
		unixdt as `date`,
		dormancy,
		adormancy as sadormancy,
		eadormancy,
		price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>

		</where>
		ORDER BY
		unixdt desc limit 300
	</select>

	<select id="getRealTimeSoagList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.SOAGDto">
		SELECT distinct
		unixdt as `date`,
		day1,
		day7,
		day30,
		day60,
		day90,
		day180,
		day365,
		day730,
		price
		FROM
		rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>

		</where>
		ORDER BY
		unixdt desc limit 300
	</select>


	<select id="getRealTimePriceList" parameterType="com.jxy.marketall.vo.QueryVo" resultType="com.jxy.marketall.dto.DateBigDecimalDto">
		SELECT distinct
			unixdt as `time`,
			price
		FROM
			rt_dailyindsv3e1
		<where>

			<if test="vo.start != null and vo.start != ''">
				and unixdt &gt;= "${vo.start}"
			</if>

		</where>
		ORDER BY
			unixdt desc limit 300
	</select>

</mapper>
