this.PRD_O_CODE == undefined || this.PRD_O_CODE == ''
时间: 2024-06-22 18:04:02 浏览: 161
在JavaScript中,`this.PRD_O_CODE == undefined || this.PRD_O_CODE == ''`是一个条件表达式,用于检查`PRD_O_CODE`属性是否为`undefined`或空字符串。`PRD_O_CODE`是`this`对象的一个属性。
这个表达式的含义是:
- 如果`this.PRD_O_CODE`的值是`undefined`(即该属性不存在或者被设置为`undefined`),或者
- 如果`this.PRD_O_CODE`的值是空字符串`''`(即没有内容的字符串)
那么整个表达式的结果将会为`true`。否则,结果为`false`。这种检查通常用于在进行操作前验证某个变量是否存在或者其值是否为空,以避免运行时错误。
相关问题
优化下这个代码 select sum(auth_amt) sum_auth_amt from auth_cont auth where auth_sts = '1' and exists (select 1 from RPT_DUE_LOAN_ACC_M loan where loan.cif_no = auth.cif_no AND loan.send_flag = '2' AND LOAN.PRD_USERDF_TYPE != '3017' AND LOAN.BANK_ID = 162000 and (loan.cif_no in (select cif_no from RPT_DUE_LOAN_ACC_M a where 1 = 1 AND LOAN.YEAR = '2021' AND LOAN.MONTH = '12' AND LOAN.ACCOUNT_STATUS NOT IN ('0', '2') AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) or substr(LOAN.SETTL_DATE, 0, 6) = '202112') AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = '162000' CONNECT BY PRIOR BR_NO = UP_ONE) group by cif_no and (loan.cif_no in (select cif_no from RPT_DUE_LOAN_ACC_M a where 1 = 1 AND LOAN.YEAR = '2021' AND LOAN.MONTH = '12' AND LOAN.ACCOUNT_STATUS NOT IN ('0', '2') AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) or substr(LOAN.SETTL_DATE, 0, 6) = '202112') AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = '162000' CONNECT BY PRIOR BR_NO = UP_ONE) group by cif_no AND LOAN.YEAR = '2021' AND LOAN.MONTH = '12' AND LOAN.ACCOUNT_STATUS NOT IN ('0', '2') AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) or substr(LOAN.SETTL_DATE, 0, 6) = '202112') AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = '162000' CONNECT BY PRIOR BR_NO = UP_ONE))
答案:SELECT SUM(AUTH_AMT) SUM_AUTH_AMT FROM AUTH_CONT AUTH WHERE AUTH_STS = 1 AND EXISTS(SELECT 1 FROM RPT_DUE_LOAN_ACC_M LOAN WHERE LOAN.CIF_NO = AUTH.CIF_NO AND LOAN.SEND_FLAG = 2 AND LOAN.PRD_USERDF_TYPE != 3017 AND LOAN.BANK_ID = 162000 AND LOAN.CIF_NO IN (SELECT CIF_NO FROM RPT_DUE_LOAN_ACC_M A WHERE LOAN.YEAR = 2021 AND LOAN.MONTH = 12 AND LOAN.ACCOUNT_STATUS NOT IN (0, 2) AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) OR SUBSTR(LOAN.SETTL_DATE, 0, 6) = 202112) AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = 162000 CONNECT BY PRIOR BR_NO = UP_ONE) GROUP BY CIF_NO) AND LOAN.YEAR = 2021 AND LOAN.MONTH = 12 AND LOAN.ACCOUNT_STATUS NOT IN (0, 2) AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) OR SUBSTR(LOAN.SETTL_DATE, 0, 6) = 202112) AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = 162000 CONNECT BY PRIOR BR_NO = UP_ONE));
优化下这个代码 select sum(auth_amt) sum_auth_amt from auth_cont auth left join (select * from RPT_DUE_LOAN_ACC_M loan where loan.send_flag = '2' and loan.prd_userdf_type != '3017' and loan.bank_id = 162000 and (loan.cif_no in (select cif_no from RPT_DUE_LOAN_ACC_M a where 1 = 1 AND LOAN.YEAR = '2021' AND LOAN.MONTH = '12' AND LOAN.ACCOUNT_STATUS NOT IN ('0', '2') AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) or substr(LOAN.SETTL_DATE, 0, 6) = '202112') AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = '162000' CONNECT BY PRIOR BR_NO = UP_ONE) group by cif_no and (loan.cif_no in (select cif_no from RPT_DUE_LOAN_ACC_M a where 1 = 1 AND LOAN.YEAR = '2021' AND LOAN.MONTH = '12' AND LOAN.ACCOUNT_STATUS NOT IN ('0', '2') AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) or substr(LOAN.SETTL_DATE, 0, 6) = '202112') AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = '162000' CONNECT BY PRIOR BR_NO = UP_ONE) group by cif_no group by cif_no) loan on loan.cif_no = auth.cif_no where auth_sts = '1' AND LOAN.YEAR = '2021' AND LOAN.MONTH = '12' AND LOAN.ACCOUNT_STATUS NOT IN ('0', '2') AND ((LOAN.LOAN_BAL > 0 OR LOAN.IN_INTST > 0 OR LOAN.OUT_INTST > 0 OR LOAN.CMPD_INTST > 0) or substr(LOAN.SETTL_DATE, 0, 6) = '202112') AND LOAN.MANG_BR_NO IN (SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = '162000' CONNECT BY PRIOR BR_NO = UP_ONE)
答:SELECT SUM(AUTH_AMT)SUM_AUTH_AMT FROM AUTH_CONT AUTH LEFT JOIN(SELECT * FROM RPT_DUE_LOAN_ACC_M LOAN WHERE LOAN.SEND_FLAG = 2 AND LOAN.PRD_USERDF_TYPE != 3017 AND LOAN.BANK_ID = 162000 AND(LOAN.CIF_NO IN(SELECT CIF_NO FROM RPT_DUE_LOAN_ACC_M A WHERE LOAN.YEAR = 2021 AND LOAN.MONTH = 12 AND LOAN.ACCOUNT_STATUS NOT IN(0,2)AND((LOAN.LOAN_BAL>0 OR LOAN.IN_INTST>0 OR LOAN.OUT_INTST>0 OR LOAN.CMPD_INTST>0)OR SUBSTR(LOAN.SETTL_DATE,0,6)= 202112)AND LOAN.MANG_BR_NO IN(SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = 162000 CONNECT BY PRIOR BR_NO = UP_ONE)GROUP BY CIF_NO)ON LOAN.CIF_NO = AUTH.CIF_NO WHERE AUTH_STS = 1 AND LOAN.YEAR = 2021 AND LOAN.MONTH = 12 AND LOAN.ACCOUNT_STATUS NOT IN(0,2)AND((LOAN.LOAN_BAL>0 OR LOAN.IN_INTST>0 OR LOAN.OUT_INTST>0 OR LOAN.CMPD_INTST>0)OR SUBSTR(LOAN.SETTL_DATE,0,6)= 202112)AND LOAN.MANG_BR_NO IN(SELECT BR_NO FROM TBL_ORG_DEPARTMENTS START WITH BR_NO = 162000 CONNECT BY PRIOR BR_NO = UP_ONE)GROUP BY CIF_NO)LOAN ON LOAN.CIF_NO = AUTH.CIF_NO WHERE AUTH_STS = 1。
阅读全文