You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
1.3 KiB

# -*- coding: utf-8 -*-
# t11-users2.py — crm_auth_user 部门实锤 + dict_item 角色字典实锤(只读)
import io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import pymysql
conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456',
database='crm', charset='utf8mb4')
cur = conn.cursor()
print('== A/B/C/ADMIN 用户主表(crm_auth_user)==')
cur.execute("SELECT id, username, dept_id, employment_status, enabled FROM crm_auth_user "
"WHERE id IN (739564171091247104, 744842565802524672, 744842566742048768, 744842318024015872)")
for r in cur.fetchall():
print(' ', r)
print('== crm_auth_user 全量(团队成员候选)==')
cur.execute("SELECT id, username, dept_id FROM crm_auth_user WHERE deleted=0 ORDER BY id LIMIT 30")
for r in cur.fetchall():
print(' ', r)
print('== sys_user_dept 全量 ==')
cur.execute("SELECT * FROM sys_user_dept LIMIT 30")
for r in cur.fetchall():
print(' ', r)
print('== dict_item 结构 ==')
cur.execute("DESC dict_item")
for r in cur.fetchall():
print(' ', r)
print('== dict_group 商机相关 ==')
cur.execute("SELECT * FROM dict_group WHERE group_name LIKE '%%商机%%' OR group_code LIKE '%%opp%%'")
for r in cur.fetchall():
print(' ', r)
conn.close()
print('done')