et_CACC_NO.py 443 B

12345678910111213141516171819
  1. from django import http
  2. from django.db import connection
  3. # 用于判断银行账号是否存在
  4. def et_CACC_NO(CACC_NO):
  5. """
  6. :return:
  7. """
  8. if len(CACC_NO)<=0:
  9. return 'NO'
  10. sql = "SELECT COUNT(*) FROM BACC WHERE BACC_NO=%s" % (CACC_NO)
  11. with connection.cursor() as cursor:
  12. # 判断单号是否重复
  13. SUM_CACC_NO = cursor.execute(sql).fetchall()[0][0]
  14. if SUM_CACC_NO <=0:
  15. return 'NO'