PySQL

2018-07-23  本文已影响109人  刘月玮
    # -------- function: check whether the interview info has been recorded or not --------
    # coder: Liu Yuewei
    # updated date: 2018-07-06
    def fn_check_new_interview(candidate_id, interview_index):
        with DbUtil(useWareHouse=True, type=WAREHOUSE_TYPE_HR) as db_util:
            dict_info = db_util.fetch_one("SELECT InterviewerID, StartTime, TimeLength FROM RCT_InterviewRecord "
                                  "WHERE CandidateID=%(candidate_id)s AND InterviewIndex=%(interview_index)s LIMIT 1",
                                  {'candidate_id': candidate_id, 'interview_index': interview_index},
                                  as_dict=True)


    # -------- function: get department and related internal jobs -------
    # coder: Liu Yuewei
    # updated date: 2018-06-29
    def fn_get_dept_job():
        with DbUtil(useWareHouse=True, type=WAREHOUSE_TYPE_HR) as db_util:
            list_dept_job = db_util.fetch_all("SELECT InternalDept AS Dept, InternalAppJob AS Job FROM RCT_DeptJob", as_dict=True)



    # -------- function: insert data to RCT_StatusRecord --------
    # coder: Dai Lu
    # updated date: 2018-06-22
    def fn_insert_rct_interview_record(dict_candidate_info):
        dict_candidate_info["TimeMark"] = datetime.now()
        with DbUtil(useWareHouse=True, type=WAREHOUSE_TYPE_HR) as db_util:
            db_util.insert("RCT_InterviewRecord", dict_candidate_info)




    # -------- function: update RCT_CandBasicInfo --------
    # coder: Liu Yuewei
    # updated date: 2018-06-22
    def fn_update_rct_candidate_info(candidate_id, dict_candidate_info):
        with DbUtil(useWareHouse=True, type=WAREHOUSE_TYPE_HR) as db_util:
            db_util.update("RCT_CandBasicInfo", dict_candidate_info, ['Id=%s', [candidate_id]])
上一篇下一篇

猜你喜欢

热点阅读