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

	<select id="getFundingRateByTime" resultType="com.jxy.marketall.dto.ExchangeTempDto">
		select ts ,fundingRate valueA from  fundingrate
		<where>
			<if test="vo.symbol != null and vo.symbol != ''">
				and symbol = #{vo.symbol}
			</if>
		</where>
	</select>

	<select id="getOpenInterestByTime" resultType="com.jxy.marketall.dto.ExchangeTempDto">
			select ts ,openInterest valueA from  openInterest
		<where>
			<if test="vo.symbol != null and vo.symbol != ''">
				and symbol = #{vo.symbol}
			</if>
			<if test="vo.start != null and vo.start != '' and vo.start != '0'">
				and ts &gt;= #{vo.start}
			</if>
			<if test="vo.end != null and vo.end != '' and vo.end != '0'">
				and ts &lt;= #{vo.end}
			</if>
		</where>
		order by ts desc limit 3000;
	</select>

	<select id="getTakerLongShortRatioByTime" resultType="com.jxy.marketall.dto.ExchangeTempDto">
		select
			ts ,
			buyVol valueA,
			sellVol valueB,
			buySellRatio valueC
		from longshortratio5m
		<where>
			<if test="vo.symbol != null and vo.symbol != ''">
				and symbol =  #{vo.symbol}
			</if>
		</where>
	</select>

</mapper>
