package com.hai.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * mapper扩展类
 */
public interface HighGoldRecMapperExt {
    @Select({"<script>" +
            "SELECT" +
            " gold_type , SUM(gold) AS sum FROM high_gold_rec" +
            " WHERE" +
            " 1 = 1" +
            " <if test='map.createTimeS != null'> AND create_time BETWEEN '${map.createTimeS}' AND '${map.createTimeE}'</if>  " +
            " <if test='map.resType != null'> AND res_type = #{map.resType}</if>  " +
            " <if test='map.goldType != null'> AND gold_type = #{map.goldType}</if>" +
            " GROUP BY gold_type" +
            " </script>"})
        // 查询申请记录
    List<Map<Long,Long>> queryGold(@Param("map") Map<String,Object> map);
}
