package top.lvzhiqiang.mapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import top.lvzhiqiang.entity.*;
import java.util.List;
import java.util.Map;
/**
* coin-Mapper
*
* @author lvzhiqiang
* 2023/9/9 17:37
*/
public interface CoinMapper {
@Insert({""})
int insertHistoryOrderList(List historyOrderList);
@Select({""})
List findHistoryOrderList(Map params);
@Select("select symbol,type,category,sort from coin_monitor_currency where delete_flag = 1 order by sort")
List findMonitorCurrencyList();
@Select("select * from coin_public_params where 1=1")
@MapKey("codeKey")
List findPublicParams();
@Insert({""})
void insertMixTradeList(List parseMixTradeList);
@Select({""})
List findMixTraderList(Map params);
@Select("select concat(traderUid, '|', traderNickName) from coin_monitor_trader where delete_flag = '1'")
List findMonitorTraderList();
@Select({""})
List findWatchlistList(Map params);
@Update("update coin_watchlist set cmc_id=#{cmcId},total_market_ranking=#{totalMarketRanking},total_market_value=#{totalMarketValue}," +
"mark_price=#{markPrice},highest_historical_price=#{highestHistoricalPrice},lowest_historical_price=#{lowestHistoricalPrice}," +
"highest_historical_date=#{highestHistoricalDate},lowest_historical_date=#{lowestHistoricalDate},increase_multiple=#{increaseMultiple}," +
"issuing_days=#{issuingDays},modify_time=now() where id = #{id}")
int updateCoinWatchlist(CoinWatchlist coinWatchlist);
@Update("update coin_watchlist set remark=#{remark},modify_time=now() where symbol = #{symbol}")
int updateCoinWatchlistRemark(CoinWatchlist coinWatchlist);
@Select("select * from coin_watchlist where symbol = #{symbol}")
CoinWatchlist findWatchlistBySymbol(String symbol);
@Insert("INSERT INTO file_image(old_name, new_name, size, path, remark, create_time, modify_time) " +
"VALUES (#{oldName}, #{newName}, #{size}, #{path}, #{remark}, now(), now())")
int insertFileImage(FileImage fileImage);
@Select({""})
List findImageList(Map params);
@Insert({""})
void insertCmcMapList(List cmcMapList);
@Select({""})
List findCmcMapList(Map params);
}