コード例 #1
0
ファイル: api_mysql_oa_select.py プロジェクト: TeaEra/CZT_Web
def get_oas():
    #
    sql_where = ADMIN_OA.get_where_from_fs(fs)
    sql_limit = ADMIN_OA.get_limit_from_fs(fs)
    #
    res = dict()
    res["oas"] = list()
    #
    try:
        conn, cur = ADMIN_OA.get_conn_for_mysql_oa()
        select_sql = "select * from t_account_manager"
        #
        select_sql += sql_where
        #
        select_sql += sql_limit
        all_data = UTIL.run_conn_select(cur, select_sql)
        #
        for row in all_data:
            res["oas"].append(UTIL.get_dict_in_utf8(row))
        #
        cur.close()
        conn.close()
        #
        UTIL.append_result_ok(res)
    except Exception, e:
        #
        UTIL.append_result_error(res, e)
コード例 #2
0
ファイル: api_mysql_oa_delete.py プロジェクト: TeaEra/CZT_Web
def get_res():
    #
    sql_where = ADMIN_OA.get_where_from_fs(fs)
    #
    res = dict()
    #
    try:
        conn, cur = ADMIN_OA.get_conn_for_mysql_oa()
        sql_delete = "delete from t_account_manager"
        #
        sql_delete += sql_where 
        #
        #print sql_delete
        TE_CUSTOM.run_sql(cur, sql_delete)
        #
        cur.close()
        conn.close()
        #
        UTIL.append_result_ok(res)
    except Exception, e:
        #
        UTIL.append_result_error(res, e)
コード例 #3
0
def get_count():
    #
    sql_where = ADMIN_OA.get_where_from_fs(fs)
    #
    res = dict()
    #
    try:
        conn, cur = ADMIN_OA.get_conn_for_mysql_oa()
        sql_select = "select exists(select 1 from t_account_manager"
        sql_select += sql_where
        sql_select += ") as dup_check"
        #
        all_data = UTIL.run_conn_select(cur, sql_select)
        res["count"] = all_data
        #
        cur.close()
        conn.close()
        #
        UTIL.append_result_ok(res)
    except Exception, e:
        #
        UTIL.append_result_error(res, e)
コード例 #4
0
ファイル: api_mysql_oa_count.py プロジェクト: TeaEra/CZT_Web
def get_count():
    #
    sql_where = ADMIN_OA.get_where_from_fs(fs)
    #
    res = dict()
    #
    try:
        conn, cur = ADMIN_OA.get_conn_for_mysql_oa()
        select_sql = "select count(*) as total_num from t_account_manager"
        #
        select_sql += sql_where
        #
        all_data = UTIL.run_conn_select(cur, select_sql)
        res["count"] = all_data
        #
        cur.close()
        conn.close()
        #
        UTIL.append_result_ok(res)
    except Exception, e:
        #
        UTIL.append_result_error(res, e)