PySQL

    # -------- 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]])
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。