package link.at17.mid.tushare.playground;

import java.util.List;

import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import com.github.yulichang.query.MPJLambdaQueryWrapper;
import link.at17.mid.tushare.data.models.StockInfo;
import link.at17.mid.tushare.data.service.StockInfoService;
import lombok.extern.slf4j.Slf4j;

@SpringBootTest
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class StockInfoServiceTest {

    
    @Autowired
    StockInfoService stockInfoService;

    @Test
    @Order(5)
    void testListWithWrapper() {
        
        MPJLambdaQueryWrapper<StockInfo> ew = new MPJLambdaQueryWrapper<>();
        ew.setAlias("i");
        ew.likeLeft(StockInfo::getTsCode, "SZ");
        List<StockInfo> stockInfoList = stockInfoService.list(ew);
        for (StockInfo stockInfo : stockInfoList) {
            log.info("{}", stockInfo);
        }
    }
    
}
