17 lines
836 B
Python
17 lines
836 B
Python
#!/usr/bin/env python3
|
|
import sys, os
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
from config import DB_CONFIG
|
|
import pymysql
|
|
DB = dict(DB_CONFIG)
|
|
DB['cursorclass'] = pymysql.cursors.DictCursor
|
|
conn = pymysql.connect(**DB)
|
|
cur = conn.cursor()
|
|
cur.execute("SELECT DISTINCT tax_rate FROM new_product_bom WHERE tax_rate IS NOT NULL AND tax_rate != '' LIMIT 20")
|
|
print("税点现有值:", [r['tax_rate'] for r in cur.fetchall()])
|
|
cur.execute("SELECT DISTINCT lead_time FROM new_product_bom WHERE lead_time IS NOT NULL AND lead_time != '' LIMIT 10")
|
|
print("货期现有值:", [r['lead_time'] for r in cur.fetchall()])
|
|
cur.execute("SELECT DISTINCT unit_price FROM new_product_bom WHERE unit_price IS NOT NULL AND unit_price != '' LIMIT 10")
|
|
print("单价现有值:", [r['unit_price'] for r in cur.fetchall()])
|
|
conn.close()
|