Esempio n. 1
0
#encoding=UTF-8
#
#	2015.12.10 by shenwei @GuiYang
#	==============================
#	利用判断表单命名是否包含业务线的关键词来确定业务线的表单ID
#

import utils

cur_mysql = utils.mysql_conn()
oracle_conn = utils.oracle_conn()
cur_oracle = oracle_conn.cursor()

# 业务线1的关键词是:人力资源
utils.get_form(cur_oracle, cur_mysql, 1, '人力资源服务许可')
# 业务线2的关键词是:劳务派遣
utils.get_form(cur_oracle, cur_mysql, 2, '劳务派遣')
# 同步其它类型的表单
utils.get_form(cur_oracle, cur_mysql, 1, '分管领导指派优先办理')
utils.get_form(cur_oracle, cur_mysql, 2, '分管领导指派优先办理')

cur_mysql.close()
cur_oracle.close()
oracle_conn.close()

#
# Eof
#
        sql += ")"
        # print("++++")
        # print(sql)
        cur_mysql.execute(sql)


tables = [
    {
        "select": "id,member_id,logon_time,logout_time,ip_address",
        "table": "logon_log where logon_time=logout_time order by logon_time",
        "mysql_table": "login_log(id,member_id,login,logout,ip) values(",
    }
]

cur_mysql = utils.mysql_conn()
oracle_conn = utils.oracle_conn()
cur_oracle = oracle_conn.cursor()

"""清除原有记录
"""
sql = "DELETE FROM login_log"
cur_mysql.execute(sql)

sql = "SELECT " + tables[0]["select"] + " FROM " + tables[0]["table"]
in_sql = "INSERT into " + tables[0]["mysql_table"]
info = cur_oracle.execute(sql)

do_rec(info, cur_mysql, in_sql)

cur_oracle.close()
cur_mysql.close()