package com.muchinfo.mtp3interface.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.muchinfo.mtp3pojos.entity.Market;
import com.muchinfo.mtp3pojos.entity.Marketcalendar;
import com.muchinfo.mtp3pojos.entity.Usergroup;
import com.muchinfo.mtp3pojos.vo.MarketDto;
import com.muchinfo.mtp3pojos.vo.investor.PersonalizationDelParam;
import com.muchinfo.mtp3pojos.vo.systemsetup.SystemMarketNameResult;
import com.muchinfo.mtp3pojos.vo.systemsetup.SystemMarketSetResult;
import com.muchinfo.mtp3pojos.vo.tradingmarket.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 市场表 Mapper 接口
 * </p>
 *
 * @author XKF
 * @since 2024-07-02
 */
@Mapper
public interface IMarketMapper extends BaseMapper<Market> {

    List<Market> getMarketsNameByUseridAndrole(@Param("uid") Long uid, @Param("roletype") List<Integer> roletype, @Param("isqq") Integer isqq);

    List<Market> getNoTradeConfigMarkets(@Param("areauserid") Long areauserid, @Param("usergroupid") Long usergroupid);

    List<Usergroup> getNoTradeConfigGroups(@Param("areauserid") Long areauserid);

    List<Market> queryAreaGoodsMarkets(@Param("userid") Long userid);

    void updateExchareaid(@Param("marketids") List<Integer> marketids, @Param("exchareaid") Long exchareaid);

    void updateExchareaidNull(@Param("userid") Long userid);

    List<Market> getNoTradeConfigMarketsForAccount(@Param("vo") PersonalizationDelParam param);

    List<Market> queryoperatemarkets(@Param("areauserid") Long areauserid);

    List<SystemMarketSetResult> queryTradeModeListNew(@Param("editmarketsectionid") Integer editmarketsectionid, @Param("selectedmarketids") String[] strings);

    List<Market> getMarketsByTradeMode(@Param("exchareaid") Long exchareaid, @Param("status") List<Integer> status);

    IPage<MarketRunSectiionResult> querymarketrunsectiion(IPage<MarketRunSectiionResult> page, @Param("trademarkettype") int trademarkettype, @Param("exchareaid") Long exchareaid);

    IPage<MarketCalendarResult> queryMarketCalendar(IPage<MarketCalendarResult> page, @Param("trademarkettype") int trademarkettype, @Param("exchareaid") Long exchareaid, @Param("nottrademode") int nottrademode, @Param("marketName") String marketName);

    void deleteMarketCanlendarByMap(@Param("vo") MarketCalendarDelParam param);

    List<Marketcalendar> queryMarketCalendarById(@Param("markerid") Long markerid, @Param("year") String year);

    IPage<MarketManageResult> querymarketmanage(IPage<MarketManageResult> page, @Param("vo") MarketManageParam param);

    MarketDto queryMarketExtension(Long marketid);

    List<SystemMarketNameResult> querymarkets(@Param("trademode") Long trademode, @Param("selectedmarketids") String[] splits);
}
