简单来说就是将List传到SQL语句中进行查询操作

其实,这里将List传到SQL语句中进行查询,方法有很多,我这里只是记录我习惯用的一种方法,原因之初是因为我要判断的情况太多了,不方便全在SQL中进行操作。故此,现在前面代码中封装所需不同的List,然后将不同情况下的List分别传到后台SQL进行操作:

1、首先,这里是Controller层方法:

 @ResponseBody@RequestMapping("getQuotePriceAnalysisGrid")public Page<QuotePriceAnalysisDto> getQuotePriceAnalysisGrid() {Map<String, Object> map = this.getPageParam();//这里是个共通的方法,很多地方都要调用:具体看下面方法代码this.dealInSelect(map);map.put("userId", this.getLoginUser().getUserId());if("Y".equals(this.getLoginUser().getAdminFlag())){map.put("isAdmin",true);}else{map.put("isAdmin",false);}return quotePriceAnalysisService.getQuotePriceAnalysisGridTimeSlotByPage(map,false,true);}

这里是一个共通方法dealInSelect,也是这个方法将我们所需的分别装进不同的List中,再封装到map中,传到后台SQL中,

 private void dealInSelect(Map<String, Object> params) {if (params.get("portfolio_code") != null) {String str = StringUtil.genInStr(params.get("portfolio_code").toString());params.put("portfolio_code", str);}String assetKind = (String) params.get("assetKind");List<String> assetKindList = StringUtil.parseString2List(StringUtil.STR_COMMA, assetKind);//四种特殊资产List<String> resultList  = new ArrayList<>();//除六种特殊之外的所有*******即除了利率型计划、货币型计划、证券类净值型计划、其他类净值型计划,货币基金、非货币基金之外的List<String> resultList1  = new ArrayList<>();//除了四种特殊外(包含货币基金和非货币基金)List<String> resultList2  = new ArrayList<>();//除了四种特殊外(且不包含非货币基金之外的所有)List<String> resultList3  = new ArrayList<>();//除了四种特殊外(且不包含货币基金之外的所有)List<String> resultList4  = new ArrayList<>();if (StringUtil.isNotEmpty(params.get("assetKind"))) {//          List<String> assetKindList = new ArrayList<>();
//          String[] assetKindArr = params.get("assetKind").toString().split(",");
//          for (String item : assetKindArr) {//              assetKindList.add(item);
//          }for (String asset:assetKindList) {if("LLXJH".equals(asset)){resultList.add("PK_01");}else if("HBXJH".equals(asset)){resultList.add("PK_02");resultList2.add(asset);}else if("JZXJH".equals(asset)){resultList.add("PK_03");}else if("QTLJZXJH".equals(asset)){resultList.add("PK_06");}else{if(!"HBJJ".equals(asset)){resultList4.add(asset);}if(!"FHBJJ".equals(asset)){resultList3.add(asset);}if(!"HBJJ".equals(asset) && !"FHBJJ".equals(asset)){resultList1.add(asset);}resultList2.add(asset);}}//当货币基金和非货币基金都选中的话,将基金(“JJ”1105塞进去resultList2)if(resultList2.contains("HBJJ") && resultList2.contains("FHBJJ")){resultList2.add("JJ");}}if(!"".equals(resultList)){params.put("resultList", resultList);}if(!"".equals(resultList1)){params.put("resultList1", resultList1);}if(!"".equals(resultList2)){params.put("resultList2", resultList2);}if(!"".equals(resultList3)){params.put("resultList3", resultList3);}if(!"".equals(resultList4)){params.put("resultList4", resultList4);}params.put("assetKindList", assetKindList);}

2、其次,这里是service方法:

   public Page<QuotePriceAnalysisDto> getQuotePriceAnalysisGridTimeSlotByPage(Map<String, Object> map,Boolean isCT,Boolean isPage){long msOfDay = 24 * 60 * 60 * 1000;List<QuotePriceAnalysisDto> resultListTemp = new ArrayList<>();if (map.get("valDateStart") == null || map.get("valDate") == null){getLogger().error(">>>【错误】 valDateStart 或者 valDate 为空");return new Page<>();}Date valDate = DateUtil.parseStringToDate(map.get("valDateStart").toString());Date endDate = DateUtil.parseStringToDate(map.get("valDate").toString());Integer index = 1;while(valDate.compareTo(endDate) <= 0) {map.put("valDate",DateUtil.format(valDate,"yyyy-MM-dd"));List<QuotePriceAnalysisDto> list = new ArrayList<>();if (StringUtil.isEmpty((String) map.get("securityCode"))) {//这里底下会有具体方法,只拿出一例,看下面代码list = this.getQuotePriceAnalysisGridNullCode(map,index,isCT);} else {list = this.getQuotePriceAnalysisGrid(map,index,isCT);}if (CollectionUtils.isNotEmpty(list)){//解析日期this.parseDate2DateString(list,DateUtil.format(valDate));resultListTemp.addAll(list);QuotePriceAnalysisDto dto = list.get(list.size() -1);index = dto.getIndex() == null ? index + 1: dto.getIndex() +1;}valDate = new Date(valDate.getTime() + msOfDay);}//排序this.treeGridSort(resultListTemp);//分页int curPage = map.get("curPage") == null ? 1 : Integer.parseInt(map.get("curPage").toString());int pageSize = map.get("pageSize") == null ? 20 : Integer.parseInt(map.get("pageSize").toString());int startNum = (curPage - 1) * pageSize;int endNum = startNum + pageSize;List<QuotePriceAnalysisDto> resultList = null;if (isPage){if (endNum > resultListTemp.size()){resultList = resultListTemp.subList(startNum,resultListTemp.size());;}else {resultList = resultListTemp.subList(startNum,endNum);}}else {resultList = resultListTemp;}Integer records = resultListTemp.size();int pageCount = records / pageSize;if (records % pageSize != 0){pageCount = pageCount + 1;}//格式转换Page<QuotePriceAnalysisDto> page = new Page<>();PageList<QuotePriceAnalysisDto> pageList = new PageList<>();pageList.addAll(resultList);page.setRoot(pageList);page.setTotal(pageCount);page.setRecords(records);page.setPage(curPage);return page;}//**********这里是上面判断逻辑其中之一的方法:public List<QuotePriceAnalysisDto> getQuotePriceAnalysisGridNullCode(Map<String, Object> map,int index,Boolean isCT) {/*int index = 1;*/List<QuotePriceAnalysisDto> allList = new ArrayList<QuotePriceAnalysisDto>();if (map.get("securityCode") != null) {List<String> str = StringUtil.splitToList(StringUtil.STR_COMMA, map.get("securityCode").toString());map.put("securityCodeList", str);}List<QuotePriceAnalysisDto> listAll = null;if (isCT){listAll = quotePriceAnalysisMapper.getQuotePriceAnalysisCT(map);}else {listAll = quotePriceAnalysisMapper.getQuotePriceAnalysisFCT(map);}if (CollectionUtils.isEmpty(listAll)){listAll = new ArrayList<>();}listAll = changePortpilioNatureC(listAll);List<String> codeList = new ArrayList<>();for (QuotePriceAnalysisDto q : listAll) {if (codeList.contains(q.getSecurityCode())) {continue;} else {codeList.add(q.getSecurityCode());}}List<AssetNameDTO> assetNameDTOList = quotePriceAnalysisMapper.getParentName();if (CollectionUtils.isEmpty(assetNameDTOList)){assetNameDTOList = new ArrayList<>();}for (int i = 0; i < codeList.size(); i++) {List<QuotePriceAnalysisDto> list = new ArrayList<>();for (QuotePriceAnalysisDto q : listAll) {if (q.getSecurityCode() == null){continue;}if (q.getSecurityCode().toString().equals(codeList.get(i))) {list.add(q);}}if (list.size() > 0) {/*list = changePortpilioNatureC(list);*/QuotePriceAnalysisDto quotePriceAnalysisDto = new QuotePriceAnalysisDto();quotePriceAnalysisDto.setSecurityNum(BigDecimal.ZERO);quotePriceAnalysisDto.setSecurityCost(0.0);quotePriceAnalysisDto.setSMV(new BigDecimal(0));quotePriceAnalysisDto.setSMCpercent(new BigDecimal(0));quotePriceAnalysisDto.setParent("0");quotePriceAnalysisDto.setLevel(0);quotePriceAnalysisDto.setIndex(index++);quotePriceAnalysisDto.setIsLeaf(false);quotePriceAnalysisDto.setExpanded(false);quotePriceAnalysisDto.setLoaded(true);allList.add(quotePriceAnalysisDto);//判断相同组合的记录,只累加一次,防止数据翻倍List<String> portfolioNameList = new ArrayList<>();for (QuotePriceAnalysisDto q : list) {if (q.getParentCode() == null || q.getParentCode().toString().equals("-")) {q.setParentCode("-");} else {for (AssetNameDTO a : assetNameDTOList) {if (q.getParentCode().equals(a.getCode())) {q.setParentCode(a.getName());}}}quotePriceAnalysisDto.setSecurityCode(q.getSecurityCode());quotePriceAnalysisDto.setSecurityName(q.getSecurityName());q.setSecurityName("");q.setSecurityCode("");q.setParent(quotePriceAnalysisDto.getIndex() + "");q.setLevel(1);q.setIndex(index++);q.setIsLeaf(true);q.setExpanded(false);q.setLoaded(true);if(!portfolioNameList.contains(q.getPortpolioName())){quotePriceAnalysisDto.setSecurityNum(ArithmeticUtil.doAdd(quotePriceAnalysisDto.getSecurityNum(), q.getSecurityNum()));if (q.getSecurityCost() == null) {} else {Double cost1 = quotePriceAnalysisDto.getSecurityCost() == null ? 0 : quotePriceAnalysisDto.getSecurityCost();Double cost2 = q.getSecurityCost() == null ? 0 : q.getSecurityCost();quotePriceAnalysisDto.setSecurityCost(cost1 + cost2);}if (q.getSMV() == null) {} else {BigDecimal smv1 = quotePriceAnalysisDto.getSMV() == null ? new BigDecimal(0) : quotePriceAnalysisDto.getSMV();BigDecimal smv2 = q.getSMV() == null ? new BigDecimal(0) : q.getSMV();quotePriceAnalysisDto.setSMV(smv1.add(smv2));}if (q.getSMCpercent() == null) {} else {BigDecimal sp1 = quotePriceAnalysisDto.getSMCpercent() == null ? new BigDecimal(0) : quotePriceAnalysisDto.getSMCpercent();BigDecimal sp2 = q.getSMCpercent() == null ? new BigDecimal(0) : q.getSMCpercent();quotePriceAnalysisDto.setSMCpercent(sp1.add(sp2));}portfolioNameList.add(q.getPortpolioName());}  allList.add(q);}}}return allList;}

3、我们再看mapper文件:

 public List<QuotePriceAnalysisDto> getQuotePriceAnalysisCT(Map<String, Object> map);

4、最后,进入到SQL中对不同List进行分析判断:

<select id="getQuotePriceAnalysisCT"resultType="com.joyintech.tams.wwp.positionanalysis.quotepriceanalysis.dto.QuotePriceAnalysisDto"parameterType="Map">SELECTallList.*,portpolioCombine.parentCode  as parentCodeFROM(SELECTdetailList.valDate as valDate,detailList.portpolioCode as portpolioCode,detailList.securityName     AS      securityName,detailList.securityCode        AS      securityCode,detailList.portpolioName       AS      portpolioName,detailList.portpolioNature        AS      portpolioNature,detailList.securityNum      AS      securityNum ,detailList.securityCost    AS  securityCost,detailList.SMV AS  SMV,totalList.overallScale overallScale,(CASEWHEN detailList.valMethod='MV' THEN ROUND(detailList.SMV/totalList.overallScale,6)*100ELSE ROUND(detailList.securityCost/totalList.overallScale,6)*100END)  AS  SMCpercentFROM(SELECTASSET_OBJECT.ID,ASSET_OBJECT.SHORT_NAME                AS  securityName,ASSET_OBJECT.ASSET_CODE            as  securityCode,PORTFOLIO_ASSET_RIFT_VALUATION.VAL_DATE         AS valDate ,PORTFOLIO_ASSET_RIFT_VALUATION.PORTFOLIO_CODE  as portpolioCode,PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE    ,PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_NAME,PORTFOLIO_VAL_INFO.VAL_METHOD      AS  valMethod,PORTFOLIO_INFO.NAME                   AS  portpolioName,PORTFOLIO_INFO.PORTFOLIO_NATURE                   AS  portpolioNature ,PORTFOLIO_ASSET_RIFT_VALUATION.SECURITY_QUANTITY       AS  securityNum ,PORTFOLIO_ASSET_RIFT_VALUATION.SECURITY_COST       AS  securityCost    ,PORTFOLIO_ASSET_RIFT_VALUATION.SMV     AS  SMVFROMPORTFOLIO_ASSET_RIFT_VALUATION,PORTFOLIO_INFO,PORTFOLIO_VAL_INFO,(selectmax(VAL_DATE) AS valDate,portfolio_codefromPORTFOLIO_ASSET_RIFT_VALUATIONwhereVAL_DATE &lt;=#{valDate}group byportfolio_code) dd,ASSET_OBJECTLEFT JOIN   PORTFOLIO_INFO PORTFOLIO_INFO2ON  ASSET_OBJECT.ASSET_CODE = PORTFOLIO_INFO2.CODELEFT JOINASSET_FUND_INFO AFOONASSET_OBJECT.ID=AFO.ASSET_OBJECT_IDWHEREPORTFOLIO_ASSET_RIFT_VALUATION.PORTFOLIO_CODE=PORTFOLIO_INFO.CODEAND      PORTFOLIO_ASSET_RIFT_VALUATION.ASSET_OBJECT_ID=ASSET_OBJECT.IDAND      PORTFOLIO_VAL_INFO.CODE=PORTFOLIO_INFO.CODE<!--选:利率型计划、货币型计划、证券类净值型计划、其他类净值型计划  之外的资产维度 且(资产维度既选货币基金又选非货币基金或者这两个都没选) --><if test="resultList2 != null and resultList2.size()>0 and resultList.size()==0 and resultList3.size()==resultList4.size()">AND (SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4) IN (select SUBJECT_CODE fromASSET_CLASS_SUBJECT_CODE where ASSET_CLASS_CODE IN<foreach item="item" collection="resultList2" index="index" open="(" separator="," close=")">'${item}'</foreach>))</if><!--选:利率型计划、货币型计划、证券类净值型计划、其他类净值型计划  之外的资产维度 且(资产维度不包含非货币基金) --><if test="resultList3 != null and resultList3.size()>0 and resultList.size()==0 and resultList3.size()>resultList4.size()">AND (SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4) IN (select SUBJECT_CODE fromASSET_CLASS_SUBJECT_CODE where ASSET_CLASS_CODE IN<foreach item="item" collection="resultList3" index="index" open="(" separator="," close=")">'${item}'</foreach>)ORSUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)= '1105'AND AFO.FUND_TYPE ='01')</if><!--选:利率型计划、货币型计划、证券类净值型计划、其他类净值型计划  之外的资产维度 且(资产维度不包含货币基金) --><if test="resultList4 != null and resultList4.size()>0 and resultList.size()==0 and resultList4.size()>resultList3.size()">AND (SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4) IN (select SUBJECT_CODE fromASSET_CLASS_SUBJECT_CODE where ASSET_CLASS_CODE IN<foreach item="item" collection="resultList4" index="index" open="(" separator="," close=")">'${item}'</foreach>)ORSUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)= '1105'AND AFO.FUND_TYPE !='01')</if><!--仅选:利率型计划、货币型计划、证券类净值型计划、其他类净值型计划 其中之一的资产维度--><if test="resultList != null and resultList1.size()==0 and resultList2.size()==0 and resultList3.size()==0 and resultList4.size()==0 and resultList.size()>0 ">AND SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)='1701'AND  PORTFOLIO_INFO2.PORTFOLIO_KIND IN<foreach item="item" collection="resultList" index="index" open="(" separator="," close=")">'${item}'</foreach></if><!-- 既选了特殊的四种又选了四种之外的情况,选了非货币基金--><if test="resultList1 != null and resultList != null and resultList4!=null and resultList1.size()>0 and resultList.size()>0 and resultList4.size()>resultList3.size()">AND (SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4) IN (select SUBJECT_CODE fromASSET_CLASS_SUBJECT_CODE where ASSET_CLASS_CODE IN<foreach item="item" collection="resultList4" index="index" open="(" separator="," close=")">'${item}'</foreach>)ORSUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)= '1105'AND AFO.FUND_TYPE !='01'OR  SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)='1701'AND  PORTFOLIO_INFO2.PORTFOLIO_KIND IN<foreach item="item" collection="resultList" index="index" open="(" separator="," close=")">'${item}'</foreach>)</if><!-- 既选了特殊的四种又选了四种之外的情况,选了货币基金--><if test="resultList1 != null and resultList != null and resultList3 != null and resultList1.size()>0 and resultList.size()>0 and resultList3.size()>resultList4.size()">AND (SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4) IN (select SUBJECT_CODE fromASSET_CLASS_SUBJECT_CODE where ASSET_CLASS_CODE IN<foreach item="item" collection="resultList3" index="index" open="(" separator="," close=")">'${item}'</foreach>)ORSUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)= '1105'AND AFO.FUND_TYPE ='01'OR  SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)='1701'AND  PORTFOLIO_INFO2.PORTFOLIO_KIND IN<foreach item="item" collection="resultList" index="index" open="(" separator="," close=")">'${item}'</foreach>)</if><!-- 既选了特殊的四种又选了四种之外的情况(资产维度既选了货币基金又选了非货币基金或者这两个都没选)--><if test="resultList4 != null and resultList3 != null and resultList != null and resultList.size()>0 and resultList3.size()>0 and resultList4.size()>0 and resultList3.size()==resultList4.size()">AND (SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4) IN (select SUBJECT_CODE fromASSET_CLASS_SUBJECT_CODE where ASSET_CLASS_CODE IN<foreach item="item" collection="resultList2" index="index" open="(" separator="," close=")">'${item}'</foreach>)OR  SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4)='1701'AND  PORTFOLIO_INFO2.PORTFOLIO_KIND IN<foreach item="item" collection="resultList" index="index" open="(" separator="," close=")">'${item}'</foreach>)</if><!-- 资产维度不选的情况--><if test="resultList1.size()==0 and resultList.size()==0 and resultList3.size()==0 and resultList4.size()==0">AND      (SUBSTR(PORTFOLIO_ASSET_RIFT_VALUATION.SUBJECT_CODE,1,4) IN ('1102', '1103','1104','1105','3102', '3103','3101','3104','3105','1701','1901'))</if><if test="securityCodeList != null and !securityCodeList.isEmpty()">AND ASSET_OBJECT.ASSET_CODE in<foreach collection="securityCodeList" item="item" index="index" open="(" separator="," close=")">'${item}'</foreach></if><if test="securityName != null"  >AND ASSET_OBJECT.SHORT_NAME IN ${securityName}</if><if test="portfolio_code != null and portfolio_code != ''">AND PORTFOLIO_INFO.CODE IN ${portfolio_code}</if><!--update BY CJ 2019/9/10  start--><if test="zhwd == 'PD_02'">AND PORTFOLIO_INFO.PORTFOLIO_KIND IN('PK_04','PK_05')</if><if test="zhwd == 'PD_02' and isAdmin != true ">AND PORTFOLIO_INFO.CODE IN(SELECTPORTFOLIO_INFO.CODEFROMPORTFOLIO_INFO,SYS_PORTFOLIO_INFOwhereSYS_PORTFOLIO_INFO.GROUP_ID = PORTFOLIO_INFO.GROUP_IDAND SYS_PORTFOLIO_INFO.STATUS = 'E'<if test="userId != null and userId != ''">AND  SYS_PORTFOLIO_INFO.USER_ID = #{userId,jdbcType = VARCHAR}</if>)</if><if test="zhwd != null and zhwd != '' and (zhwd == 'PD_01' or zhwd == 'PD_03')  and isAdmin != true"><![CDATA[and  PORTFOLIO_INFO.code in (SELECTPORTFOLIO_CODEFROMSYS_DEPT_PORTFOLIOWHEREDEPT_CODE IN (SELECTDEPT_CODEFROMSYS_DEPT_USERWHEREUSER_ID = #{userId}UNION ALLSELECTDEPT_CODEFROMSYS_DEPARTMENTWHEREDIRECT_DEPT_CODE IN (SELECTDEPT_CODEFROMSYS_DEPT_USERWHEREUSER_ID  = #{userId})))]]></if><if test="zhwd == 'PD_01'">and PORTFOLIO_INFO.PORTFOLIO_KIND in ('PK_01','PK_02','PK_03','PK_06','PK_09')</if><!--update BY CJ 2019/9/10  end-->AND       PORTFOLIO_ASSET_RIFT_VALUATION.VAL_DATE &lt;=#{valDate}and PORTFOLIO_ASSET_RIFT_VALUATION.val_date=dd.valDateand PORTFOLIO_ASSET_RIFT_VALUATION.portfolio_code=dd.portfolio_code)  detailListLEFT JOIN(SELECTPSV.VAL_DATE    as valDate  ,PSV.PORTFOLIO_CODE as portpolioCode    ,SUM(CASEWHEN PORTFOLIO_VAL_INFO.VAL_METHOD='MV' THEN PSV.SMVELSE PSV.SECURITY_COSTEND) AS overallScaleFROMPORTFOLIO_SUM_VALUATION PSV,PORTFOLIO_VAL_INFOWHEREPSV.PORTFOLIO_CODE=PORTFOLIO_VAL_INFO.CODEAND     PSV.SUM_CODE='604'AND        PSV.VAL_DATE &lt;= #{valDate}AND NOT EXISTS (SELECT 1 FROMPORTFOLIO_SUM_VALUATION PAVWHERE 1=1AND PAV.PORTFOLIO_CODE = PSV.PORTFOLIO_CODEAND PAV.VAL_DATE > PSV.VAL_DATEAND PAV.PORTFOLIO_CODE=PORTFOLIO_VAL_INFO.CODEAND        PAV.SUM_CODE='604'AND        PAV.VAL_DATE &lt;= #{valDate})Group BY      PSV.VAL_DATE,PSV.PORTFOLIO_CODE) totalListONtotalList.valDate=detailList.valDateAND       totalList.portpolioCode=detailList.portpolioCodeORDER  BYdetailList.securityCode)  allListLEFT JOIN(SELECT  distinctPRT.PORTFOLIO_CODE as portpolioCode,PRT.PARENT_PCODE   as  parentCode,PRT.TOP_PCODE            ,(CASEWHEN PRT.PARENT_PCODE='-' THEN NULLELSE PORTFOLIO_INFO.NAMEEND) AS parentPCodeFROMPORTFOLIO_RELATE_TREE PRTLEFT JOINPORTFOLIO_INFOONPRT.PARENT_PCODE=PORTFOLIO_INFO.CODEWHEREPRT.RELATE_DATE&lt;=#{valDate}AND NOT EXISTS (SELECT 1 FROMPORTFOLIO_RELATE_TREE PAVWHERE 1=1AND PAV.PORTFOLIO_CODE = PRT.PORTFOLIO_CODEAND PAV.RELATE_DATE > PRT.RELATE_DATEAND PAV.RELATE_DATE&lt;=#{valDate}))portpolioCombineON   allList.portpolioCode=portpolioCombine.portpolioCode</select>

总结

其实这个方法不难,可能也有不妥的地方,请大神多多指教。我传的代码可能也有冗余,但是我想记录的是之前开始在做逻辑思考的时候,想复杂了以至于乱的一塌糊涂。所以,时候隔了很久我想记录下来,提醒我自己,时刻保持清醒,这里也可以供有心人参考一下,不当之处,烦请指教,谢谢。。。。。。

如何将不同情况下的List带到SQL中进行判断操作相关推荐

  1. python交互式窗口怎么换行_Python多版本情况下四种快速进入交互式命令行的操作技巧

    原标题:Python多版本情况下四种快速进入交互式命令行的操作技巧 因为工作需求或者学习需要等原因,部分小伙伴的电脑中同时安装了Python2和Python3,相信在Python多版本的切换中常常会遇 ...

  2. 如何打开python的交互窗口-Python多版本情况下四种快速进入交互式命令行的操作技巧...

    原标题:Python多版本情况下四种快速进入交互式命令行的操作技巧 因为工作需求或者学习需要等原因,部分小伙伴的电脑中同时安装了Python2和Python3,相信在Python多版本的切换中常常会遇 ...

  3. android弹出选择usb,android 解决:默认情况下用于该USB设备 自动获取USB操作权限...

    很多android 的应用在使用USB设备时,总会遇到一个很烦人的问题. 即每次都会弹出对话框: 每次插入USB设备,都会弹出.每次选上默认情况下使用该USB设备.但总还是会弹出.用户体验很差. 似乎 ...

  4. 在不停业务的情况下重启ES集群中的节点

    之前写了一篇文章如何安全重启ES集群的节点,这又一个前提,就是需要停止写入业务.但是,有些时候业务是不能停的,又需要重启某一个节点(例如补丁修复,服务器更换等),这就需要用到本篇文章提到的不停业务重启 ...

  5. 如何在使用eclipse的情况下,清理android项目中的冗余class文件和资源文件以及冗余图片...

    在我们迭代项目的过程中,经常会启用某些功能,或者修改某些界面的问题,那么问题来了,这样很容易出现大量的冗余.java文件,冗余资源文件,一些冗余的界面文件等.那么问题既然出现了,那么如何去解决呢,这就 ...

  6. 周末总是被工作打扰_如何在不打扰任何人的情况下问为什么在工作中

    周末总是被工作打扰 我记得几年前的一个晚上,那时我正坐在沙发上和一些朋友一起看电影. 那是在小型翻盖手机的时代,当时根本没有手机. 几杯各种饮料撒在咖啡桌上,当我的朋友雷切尔坐在沙发上时,她随便扔掉了 ...

  7. 在不丢失堆栈跟踪的情况下重新抛出Java中的异常

    在C#中,我可以使用throw; 保留堆栈跟踪时重新抛出异常的语句: try {... } catch (Exception e) {if (e is FooException)throw; } Ja ...

  8. 终于知道什么情况下需要实现.NET Core中的IOptions接口

    自从接触 IOptions 之后,一直纠结这样的问题:自己定义的 Options 要不要实现 IOptions 接口. 微软有的项目中实现了,比如 Caching 中的 MemoryCacheOpti ...

  9. C/C++在不确定输入字符串长度情况下,对其进行存储和字符操作问题

    在很多IT公司的编程笔试题中都会提到,输如长度未知的字符串以及整数数组进行各种操作,本文进行简单地归纳. 对于输入一行随意大小的(中间不含空格)字符串求其长度并输出指定位上字符,用C++可以编程为: ...

最新文章

  1. 代码实践 | CVPR2020——AdderNet(加法网络)迁移到检测网络(代码分享)
  2. 关于java的对象数组
  3. 五类和超五类网线的区别
  4. (转载)hive文件存储格式
  5. linux 工具 SecureCRT 使用 rz 和 sz 命令
  6. hms能适配鸿蒙吗,国产手机即将抱团?魅族率先使用HMS服务,或多家国产适配鸿蒙!...
  7. input type=submit 和button的区别及表单提交
  8. 设计模式之结构类模式PK
  9. Java基础学习总结(96)——Java虚拟机JVM及Tomcat中的JVM有关内存的设置与调优
  10. 漫画:给女朋友解释为什么随机播放歌曲并不随机
  11. Jmeter远程启动负载机
  12. 【TPshop踩雷篇 — 数据库连接配置失败】
  13. 倍福PLC使用Visualization功能实现可视化界面
  14. 【 华为云计算专家 HCIE-Cloud Computing V3.0 预发布】
  15. Linux AHCI驱动分析之设备初始化
  16. 【积分变换】积分变换常用公式定理与方法
  17. js实现xml转json和json转xml
  18. ucla计算机科学博士排名,加州大学洛杉矶分校专业排名一览及最强专业推荐(QS世界大学排名)...
  19. 网易云音乐评论 可视化分析
  20. python 如何读取excel表格数据

热门文章

  1. Chrome访问https页面 攻击者可能会试图从 XX.XX.XX.XX 窃取您的信息(例如:密码、通讯内容或信用卡信息)直接键盘敲入这11个字符:thisisunsafe
  2. 一些关于国内腿足式机器人公司研究所的信息分享
  3. 网页设计作业-个人博客
  4. 高频前端面试题汇总之计算机网络篇
  5. 易知微入选「2022爱分析·低代码厂商全景报告」|共创数字孪生未来
  6. bulid.prop优化代码(好像很强?)
  7. DeFi之道丨一文了解Uniswap v3 LP 自动化管理器
  8. Filecoin投资者自白:我承认含有赌的成分
  9. 智慧全媒体 5G新视听,共探新时代广播电视!
  10. 补充“为什么Scrum不行” (转自陈勇)