java sping boot 判断实现

//查询在其它库中是否已存在
RiskStockConfigDetail riskStockCon = new RiskStockConfigDetail();
riskStockCon.setStockCode(stockCode);
riskStockCon.setUid(Integer.valueOf(userId));
List riskStock = riskStockConfigDetailMapper.selectByStockCode(riskStockCon);
if (riskStock.size() > 0){
    RiskStockConfig riskStockConfig = riskStockConfigMapper.selectById(riskStock.get(0).getCateId());
    StockLibraryVO stockLibraryVO = new StockLibraryVO();
    stockLibraryVO.setLibraryId(riskStock.get(0).getCateId());
    stockLibraryVO.setLibraryName(riskStockConfig.getName());
    resultVO.setCode(10019);
    resultVO.setMsg("股票已存在");
    resultVO.setData(stockLibraryVO);
    return resultVO;
}

你可能感兴趣的:(java)