<?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.storlead.sales.mapper.sku.CurrencyRateMapper">

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.storlead.sales.pojo.entity.sku.CurrencyRate">
                <id column="currency_rate_id" property="currencyRateId" />
                <result column="scur" property="scur" />
                <result column="tcur" property="tcur" />
                <result column="rate" property="rate" />
                <result column="ratenm" property="ratenm" />
                <result column="created_time" property="createdTime" />
                <result column="status" property="status" />
                <result column="update" property="update" />
        </resultMap>

        <!--人民币兑美元汇率 -->
        <select id="queryCurrencyRateUSDToCNY" resultType="decimal">
                select rate
                from currency_rate cr where cr.scur = 'USD' and cr.tcur ='CNY'
                order by cr.created_time desc limit 1
        </select>

</mapper>
