/*
 *========================================================================
 *
 *   시스템명 : 요금징수 시스템
 *   파 일 명 : ft_basictbl.pc
 *   작 성 자 : 오효섭 (catacath@neighbor21.co.kr)
 *   작 성 일 : 2012.10.10
 *   수 정 일 :
 *   설    명 : 기초상태테이블의 파일/테이블간 변환처리
 *
 *========================================================================
*/

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>

#include "wrk_stat.h"
#include "lane_stat_info.h"
#include "chg_struc.h"
#include "file_nm.h"
#include "file_no.h"
#include "dir_path.h"
#include "ora_sql.h"
#include "ipc_def.h"
#include "file_lb.h"
#include "tcs_db_def.h"
#include "wrkr_info.h"

static    struct    write_info         wi;
static    struct    wrk_stat_info         wrk_st_info_f;
static    struct    wrkr_personal_info      wrkr_personal_info_f;
static    struct    wrkr_personal_info        wrkr_personal_info_o; 
static    T_REVM_BASICINFO       revm_basicinfo;
static    T_REVM_LANEINFO        revm_laneinfo;
static    T_REVM_CARDRATE        revm_cardrate;
static    T_REVM_TABLENO         revm_tableno;
static    T_REVM_SCRATECAR       revm_scratecar;
static    T_REVM_RATE            revm_rate;
static    T_EXTM_LSAMMAXMIN      extm_lsammaxmin;
static    T_EXTM_LOADRATE        extm_loadrate;
static    T_EXTM_LOADMAX         extm_loadmax;
static    T_PUBM_DCCARTYPE       pubm_dccartype;
static    T_REVM_OBURATE         revm_oburate;

int main(int argc, char *argv[])
{
    int     isfd, isrc;
    char    path[128];
    char    temp[3+1];
    int options;
    char kmij[9];

    memset(&wrkr_personal_info_o, 0, sizeof(struct wrkr_personal_info));


    sprintf(path, "%s/%s/WRKRPERSONALINFO", DIR_TCS, DIR_BASEINFO);

    isfd = open(path, FINPUT+FC_MANULOCK);
    if(isfd < 0)
    {
	printf("open error\n");
	exit(0);
    }

    while(1)
    {

        isrc = read(isfd, &wrkr_personal_info_o, sizeof(struct wrkr_personal_info));
	if(isrc < 1) break;

    printf("+++++++++++++++++++++++++++ 근무자 테이블 ++++++++++++++++++++++++++ \n"); 
    printf("영업소번호 : %.03s\n", wrkr_personal_info_o.plz_id);
    printf("근무자번호 : %.5s\n", wrkr_personal_info_o.wrkr_no);
    printf("근무자병 : %.10s\n", wrkr_personal_info_o.wrkr_nm);
    printf("근무자일련번호 : %.12d\n", wrkr_personal_info_o.wrkr_sno);
    printf("직급 : %.8s\n", wrkr_personal_info_o.wrkr_rnk);
    printf("번호구분 : %d\n", wrkr_personal_info_o.num_div);

#if 0

    printf("차로번호 : %02d\n", wrk_st_info_o.lane_no);
    printf("근무순번 : %02d\n", wrk_st_info_o.wrk_turn);
    printf("근무상태구분 : %d\n", wrk_st_info_o.wrk_stat_div);
    printf("개시연번 : %d\n", wrk_st_info_o.strt_no);
    printf("종료연번 : %d\n", wrk_st_info_o.end_no);
    printf("근무자번호 : %.4s\n", wrk_st_info_o.wrkr_no);
    printf("근무구분 : %X\n", wrk_st_info_o.wrk_div);
    printf("개시일시 : %04d/%02d/%02d %02d:%02d:%02d\n", wrk_st_info_o.strt_year, wrk_st_info_o.strt_mon, wrk_st_info_o.strt_day, wrk_st_info_o.strt_hr, wrk_st_info_o.strt_min, wrk_st_info_o.strt_sec);
    printf("종료일시 : %04d/%02d/%02d %02d:%02d:%02d\n", wrk_st_info_o.end_year, wrk_st_info_o.end_mon, wrk_st_info_o.end_day, wrk_st_info_o.end_hr, wrk_st_info_o.end_min, wrk_st_info_o.end_sec);
    printf("유무인 구분 : %d\n", wrk_st_info_o.opr_div);
#endif

    }
    lb_close(isfd);
}
