zoukankan      html  css  js  c++  java
  • sql多表查询时怎么获取查到的字段

    首先,多表查询不能用hql(貌似hql就是不支持多表查询,如果可以,希望看到的朋友给个例子)

    List  list = systemService.findListbySql("SELECT ana.USERID,ANA.SPC_APPLY_NUMBER,SUM(ANA.ANALYZE_RESULT) as sum FROM T_PDMIS_SPCAPPLY_ANALYZE ana RIGHT JOIN T_PDMIS_SPECIAL_APPLY app ON ANA.SPC_APPLY_NUMBER = APP.APP_ID WHERE APP.STATUS='04' AND ANA.SPC_APPLY_NUMBER LIKE '"+month1+"__05%' GROUP BY ANA.USERID,ANA.SPC_APPLY_NUMBER");
    Object[] oo1 = (Object[])list.get(0);
    String lle=oo1[2].toString(); lle就获取到了0.5


    String sqlMonList = "SELECT ST_NO,PRODUCTION_UNIT,"SUM"("NVL"(EXP3,TLD_DOSE)) AS TLD_DOSE FROM T_PDMIS_TLD_REPORT where month='" + month + "' GROUP BY PRODUCTION_UNIT,ST_NO";
    List<Map<String, Object>> queryMonreportList = systemService.findForJdbc(sqlMonList.toString(), null);
    sum=queryMonreportList.size();
    for(Map<String,Object> map:queryMonreportList) {
      String onlyId = changMapValue(map.get("ST_NO"));
    }
    public static String changMapValue(Object obj) {
    if (obj != null) {
    return obj.toString();
    } else {
    return "";
    }
    }


  • 相关阅读:
    L1-021 重要的话说三遍
    L1-020 帅到没朋友
    pytest--钩子
    pytest--allure
    pytest--常用插件
    pytest--高级用法
    pytest--配置文件
    pytest--控制运行
    pytest--fixture
    pytest--使用前提
  • 原文地址:https://www.cnblogs.com/xlj227/p/6046814.html
Copyright © 2011-2022 走看看