commit
bf8b17a5dc
@ -0,0 +1,29 @@
|
|||||||
|
package au.com.royalpay.payment.manage.mappers.system;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
|
||||||
|
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
|
||||||
|
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
|
||||||
|
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create by yixian at 2017-12-19 19:09
|
||||||
|
*/
|
||||||
|
@AutoMapper(tablename = "sys_exchange_rate", pkName = "id")
|
||||||
|
public interface ExchangeRateMapper {
|
||||||
|
@AutoSql(type = SqlType.SELECT)
|
||||||
|
@AdvanceSelect(addonWhereClause = "type = 1")
|
||||||
|
JSONObject findMaxRate(@Param("create_date") Date create_time);
|
||||||
|
|
||||||
|
@AutoSql(type = SqlType.SELECT)
|
||||||
|
@AdvanceSelect(addonWhereClause = "type = 2")
|
||||||
|
JSONObject findMinRate(@Param("create_date") Date create_time);
|
||||||
|
|
||||||
|
List<JSONObject> listExchangeRates(@Param("begin") Date begin, @Param("end") Date end, @Param("channel") String channel);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
<?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="au.com.royalpay.payment.manage.mappers.system.ExchangeRateMapper">
|
||||||
|
<select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
create_date mx ,
|
||||||
|
rate exchange_rate ,
|
||||||
|
create_date `date`
|
||||||
|
FROM sys_exchange_rate
|
||||||
|
WHERE create_date >= #{begin} And create_date <= #{end} AND channel = #{channel} and type = 1
|
||||||
|
GROUP BY
|
||||||
|
create_date
|
||||||
|
ORDER BY
|
||||||
|
`date` ASC
|
||||||
|
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in new issue