lhove 2019-10-24 13:49 采纳率: 100%
浏览 268
已采纳

这段逻辑代码怎么改为表驱动编程?

if (that.activeName=='') {
parmam.grpBody.push({idxCompartorType:0,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_CODE',idxValue:that.activeName,idxCompartor:'='});
}else if(that.zhaiType.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'A_TYPE',idxValue:that.zhaiType.join(',')+',',idxCompartor:'in'});
}else if(that.objJixi.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'B_RATE_MODE',idxValue:that.objJixi.join(',')+',',idxCompartor:'in'});
}else if(that.objNei.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_INCRT',idxValue:that.objNei.join(',')+',',idxCompartor:'in'});
}else if(that.objCity.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_ISCITY',idxValue:that.objCity.join(',')+',',idxCompartor:'in'});
}else if(that.objLei.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_TYPE',idxValue:that.objLei.join(',')+',',idxCompartor:'in'});
}else if(that.objShi.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_ISMARKET',idxValue:that.objShi.join(',')+',',idxCompartor:'in'});
}else if(that.objWai.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_OUTCRT',idxValue:that.objWai.join(',')+',',idxCompartor:'in'});
}else if(that.objArea.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_REGION',idxValue:that.objArea.join(',')+',',idxCompartor:'in'});
}else if(that.faNei.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_INCRT',idxValue:that.faNei.join(',')+',',idxCompartor:'in'});
}else if(that.faCity.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_ISCITY',idxValue:that.faCity.join(',')+',',idxCompartor:'in'});
}else if(that.faLei.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_TYPE',idxValue:that.faLei.join(',')+',',idxCompartor:'in'});
}else if(that.faShi.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_ISMARKET',idxValue:that.faShi.join(',')+',',idxCompartor:'in'});
}else if(that.faWai.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_OUTCRT',idxValue:that.faWai.join(',')+',',idxCompartor:'in'});
}else if(that.faArea.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_REGION',idxValue:that.faArea.join(',')+',',idxCompartor:'in'});
}else if(that.danNei.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_INCRT',idxValue:that.danNei.join(',')+',',idxCompartor:'in'});
}else if(that.danCity.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_ISCITY',idxValue:that.danCity.join(',')+',',idxCompartor:'in'});
}else if(that.danLei.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_TYPE',idxValue:that.danLei.join(',')+',',idxCompartor:'in'});
}else if(that.danShi.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_ISMARKET',idxValue:that.danShi.join(',')+',',idxCompartor:'in'});
}else if(that.danWai.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_OUTCRT',idxValue:that.danWai.join(',')+',',idxCompartor:'in'});
}else if(that.danArea.length>0){
parmam.grpBody.push({idxCompartorType:1,isUserDefine:0,soType:that.setpNums.groupOtype,tabCode:that.setpNums.groupOtype==3?"CORP":"BOND",idxCode:'O_REGION',idxValue:that.danArea.join(',')+',',idxCompartor:'in'});
};

  • 写回答

1条回答 默认 最新

  • 关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题