| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class StockConfigServicesImpl implements IStockConfigServices { |
| | |
| | | queryWrapper.eq("c_key",key); |
| | | return stockConfigMapper.selectOne(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, StockConfig> queryByKeys(List<String> keys) { |
| | | QueryWrapper<StockConfig> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.in("c_key", keys); |
| | | |
| | | List<StockConfig> stockConfigs = stockConfigMapper.selectList(queryWrapper); |
| | | |
| | | // 构建结果的 Map |
| | | Map<String, StockConfig> resultMap = new HashMap<>(); |
| | | for (StockConfig config : stockConfigs) { |
| | | resultMap.put(config.getCKey(), config); |
| | | } |
| | | |
| | | return resultMap; |
| | | } |
| | | } |