/*
*========================================================================
*
*   SYSTEM   : NS_PLAZA_LANE APP
*   FILE     : tcs_db_def.h
*   Progrmer : JBY (baarong@neighbor21.co.kr)
*   Date     : 2019.05.20
*   Modified :
*   Remark   : Table Information.
*
*========================================================================
*/

#ifndef  _TCS_DB_DEF
#define  _TCS_DB_DEF
//exec sql begin declare section;
/***************************************************************************
   BOOTH_CODE_INFO : 차로정보
***************************************************************************/
struct   booth_code_info {
    unsigned char    c_booth_id[2+1]; /* 차로 코드 */
    unsigned char    c_booth_full_name[20+1]; /* 차로 Full 명 */
    unsigned char    c_in_out_kbn[1+1]; /* 유출.입 구분 */
    unsigned char    c_ip_address[16+1];
    unsigned char    c_port[8+1];
    unsigned char    c_sub_port[8+1];
};

typedef struct booth_code_info   T_BOOTH_CODE_INFO;
#define SZ_BOOTH_CODE_INFO    sizeof(T_BOOTH_CODE_INFO)

/***************************************************************************
   FARE_INFO : 요금정보
***************************************************************************/
struct   fare_info {
    unsigned char    c_collect_id[2+1]; /* 징수 유형 코드 */
    unsigned char    c_discount_kbn[1+1]; /* 할인구분 */
    unsigned int     d_trans_amount; /* 징수금액 */
    unsigned char    c_stt_date[8+1]; /* 시작일자 */
    unsigned char    c_end_date[8+1]; /* 종료일자 */
    unsigned int     d_discount_amount; /* 징수 할인금액 */
    unsigned int     d_fine_amount; /* 과태료 */
};

typedef struct fare_info   T_FARE_INFO;
#define SZ_FARE_INFO    sizeof(T_FARE_INFO)

/***************************************************************************
   TB_CFS_TABLENOM : 개정번호관리
***************************************************************************/
struct   tb_cfs_tablenom {
    unsigned char    c_fare_office_id[2+1]; /* 요금소번호 */
    unsigned char    c_bas_update_date[14+1]; /* 기초수정일시 */
    unsigned char    c_bas_apply_date[14+1]; /* 기초적용일시 */
    unsigned int     n_bas_rvs_no; /* 기초개정번호 */
    unsigned char    c_wrkr_update_date[14+1]; /* 사용자수정일시 */
    unsigned char    c_wrkr_apply_date[14+1]; /* 사용자적용일시 */
    unsigned int     n_wrkr_rvs_no; /* 사용자개정번호 */
    unsigned char    c_hday_update_date[14+1]; /* 휴일수정일시 */
    unsigned char    c_hday_apply_date[14+1]; /* 휴일적용일시 */
    unsigned int     n_hday_rvs_no; /* 휴일개정번호 */
    unsigned char    c_tcrd_bin_update_date[14+1]; /* 교통카드BIN수정일시 */
    unsigned char    c_tcrd_bin_apply_date[14+1]; /* 교통카드BIN적용일시 */
    unsigned int     n_tcrd_bin_rvs_no; /* 교통카드BIN개정번호 */
    unsigned char    c_imm_carno_update_date[14+1]; /* 차량번호면제수정일시 */
    unsigned char    c_imm_carno_apply_date[14+1]; /* 차량번호면제적용일시 */
    unsigned int     n_imm_carno_rvs_no; /* 차량번호면제개정번호 */
    unsigned char    c_rfid_update_date[14+1]; /* RFID요일제/저공해 수정일시 */
    unsigned char    c_rfid_apply_date[14+1]; /* RFID요일제/저공해 적용일시 */
    unsigned int     n_rfid_rvs_no; /* RFID요일제/저공해 개정번호 */
    unsigned char    c_bef_fare_update_date[14+1]; /* 사전등록수정일시 */
    unsigned char    c_bef_fare_apply_date[14+1]; /* 사전등록적용일시 */
    unsigned int     n_bef_fare_rvs_no; /* 사전등록개정번호 */
    unsigned char    c_tcrd_pl_update_date[14+1]; /* 교통카드PL수정일시 */
    unsigned char    c_tcrd_pl_apply_date[14+1]; /* 교통카드PL적용일시 */
    unsigned int     n_tcrd_pl_rvs_no; /* 교통카드PL개정번호 */
    unsigned char    c_tcrd_bl_update_date[14+1]; /* 교통카드BL수정일시 */
    unsigned char    c_tcrd_bl_apply_date[14+1]; /* 교통카드BL적용일시 */
    unsigned int     n_tcrd_bl_rvs_no; /* 교통카드BL개정번호 */
    unsigned char    c_carno_dc_update_date[14+1]; /* 차량번호감면수정일시 */
    unsigned char    c_carno_dc_apply_date[14+1]; /* 차량번호감면적용일시 */
    unsigned int     n_carno_dc_rvs_no; /* 차량번호감면개정번호 */
};

typedef struct tb_cfs_tablenom   T_TB_CFS_TABLENOM;
#define SZ_TB_CFS_TABLENOM    sizeof(T_TB_CFS_TABLENOM)

/***************************************************************************
   TB_CFS_TABLENOL : 개정번호관리 이력
***************************************************************************/
struct   tb_cfs_tablenol {
   char    plz_id[2+1];      /* 영업소 ID   pk1 asc */
   int     modf_no;          /* 수정번호<0>   pk2 asc */
   char    rvs_no_code[2+1]; /*    pk3 asc */
   char    admin_no[6+1];    /* 관리자ID */
   char    modf_dt[14+1];    /* 수정일시 */
   char    apl_dt[14+1];     /* 적용일시 */
   int     rvs_no;           /* 개정번호<4> */
};

typedef struct tb_cfs_tablenol   T_TB_CFS_TABLENOL;
#define SZ_TB_CFS_TABLENOL    sizeof(T_TB_CFS_TABLENOL)

/***************************************************************************
   TB_CFS_LANESTAT : 차로상태정보
***************************************************************************/
struct   tb_cfs_lanestat {
    unsigned char    c_fare_office_id[2+1]; /* 요금소번호 */
    unsigned char    c_booth_id[2+1]; /* 차로번호 */
    unsigned char    c_in_out_gbn[1+1]; /* 진입/진출구분(1:진입 2:진출) */
    unsigned char    c_mchi_stat[8+1]; /* 기기상태(0:전원키, 1:커버, 2:스태커, 3:호퍼,  5:신호등 */
    unsigned char    c_bas_stat[1+1]; /* 기초상태 */
    unsigned int     d_bas_rvs_no; /* 기초개정번호 */
    unsigned char    c_wrkr_stat[1+1]; /* 근무자상태 */
    unsigned int     d_wrkr_rvs_no; /* 근무자개정번호 */
    unsigned char    c_hday_stat[1+1]; /* 휴일상태 */
    unsigned int     d_hday_rvs_no; /* 휴일개정번호 */
    unsigned char    c_tcrd_bin_stat[1+1]; /* 발행사상태 */
    unsigned int     d_tcrd_bin_rvs_no; /* 발행사개정번호 */
    unsigned char    c_imm_carno_stat[1+1]; /* 차량번호면제상태 */
    unsigned int     d_imm_carno_rvs_no; /* 차량번호면제개정번호 */
    unsigned char    c_rfid_dc_stat[1+1]; /* RFID감면상태 */
    unsigned int     d_rfid_dc_rvs_no; /* RFID감면개정번호 */
    unsigned char    c_bef_fare_stat[1+1]; /* 사전결제등록상태 */
    unsigned int     d_bef_fare_rvs_no; /* 사전결제등록개정번호 */
    unsigned char    c_tcrd_pl_stat[1+1]; /* 교통카드PL상태 */
    unsigned int     d_tcrd_pl_rvs_no; /* 교통카드PL개정번호 */
    unsigned char    c_tcrd_bl_stat[1+1]; /* 교통카드BL상태 */
    unsigned int     d_tcrd_bl_rvs_no; /* 교통카드BL개정번호 */
    unsigned char    c_carno_dc_stat[1+1]; /* 차량번호감면상태 */
    unsigned int     d_carno_dc_rvs_no; /* 차량번호감면개정번호 */
    unsigned int     d_tcrd_bl_no; /* 교통카드B/L최종처리연번 */
    unsigned int     d_tcrd_pl_no; /* 교통카드P/L최종처리연번 */
    unsigned int     d_bef_fare_no; /* 사전등록결제최종처리연번 */
    unsigned char    c_anpr_cam_stat[1+1]; /* ANPR카메라접속상태 */
    unsigned char    c_anpr_rtu_temp[4+1]; /* ANPR RTU온도 */
    unsigned char    c_anpr_door_stat[1+1]; /* ANPR함체도어상태 */
    unsigned char    c_anpr_sd_stat[1+1]; /* ANPR SD카드상태 */
    unsigned char    c_comm_stat[1+1]; /* 통신상태(D:Disconnect,C:Connect) */
    unsigned char    c_last_recv_date[14+1]; /* 최종수신일시 */
};

typedef struct tb_cfs_lanestat   T_TB_CFS_LANESTAT;
#define SZ_TB_CFS_LANESTAT    sizeof(T_TB_CFS_LANESTAT)

/***************************************************************************
   MAINTENANCE_INFO : 보수정보
***************************************************************************/
struct   maintenance_info {
    unsigned char    c_fare_office_id[2+1]; /* 요금소코드 */
    unsigned char    c_booth_id[2+1]; /* 차로 코드 */
    unsigned char    c_bad_id[2+1]; /* 장비상태 코드 */
    unsigned char    c_exemption_id[2+1]; /* 장비 코드 */
    unsigned char    c_bad_occur_date[14+1]; /* 장애발생일시 */
    unsigned char    c_recovey_date[14+1]; /* 복구일자 */
    unsigned char    c_bad_reason[120+1]; /* 장애사유 */
    unsigned char    c_recovery_reason[120+1]; /* 조치사항 */
    unsigned char    c_recovery_yn[1+1]; /*  */
    unsigned char    c_file_kind_id[2+1]; /* File 코드 */
    unsigned char    c_data_seqno[10+1]; /* 자료번호 */
    unsigned char    c_year[4+1]; /* 년도 */
    unsigned char    c_month[2+1]; /* 월 */
    unsigned char    c_day[2+1]; /* 일 */
    unsigned char    c_create_date[14+1]; /* 작성일자 */
    unsigned char    c_creater[10+1]; /* 작성자 */
    unsigned char    c_update_date[14+1]; /* 수정일자 */
    unsigned char    c_updater[10+1]; /* 수정자 */
};

typedef struct maintenance_info   T_MAINTENANCE_INFO;
#define SZ_MAINTENANCE_INFO    sizeof(T_MAINTENANCE_INFO)

/***************************************************************************
   TB_CFS_PASSCLOSE : 야간계수
***************************************************************************/
struct   tb_cfs_passclose {
    unsigned char    c_fare_office_id[2+1]; /* 요금소번호 */
    unsigned char    c_booth_id[2+1]; /* 차로번호 */
    unsigned char    c_wrk_date[8+1]; /* 근무일자 */
    unsigned int     n_seqno; /* 일련번호 */
    unsigned char    c_year[4+1]; /* 발생 년 */
    unsigned char    c_month[2+1]; /* 발생 월 */
    unsigned char    c_day[2+1]; /* 발생 일 */
    unsigned char    c_work_times[6+1]; /* 발생시각 */
    unsigned char    c_in_out_kbn[1+1]; /* 입출구구분 */
    unsigned char    c_car_type_id[1+1]; /* 차종코드 */
    unsigned char    c_stop_check[1+1]; /* 정지영상유무여부 */
    unsigned char    c_car_no[14+1]; /* 차량번호 */
    unsigned int     n_x_position; /* X좌표 */
    unsigned int     n_y_position; /* Y좌표 */
    unsigned int     n_garo_len; /* 가로길이 */
    unsigned int     n_sero_len; /* 세로길이 */
};

typedef struct tb_cfs_passclose   T_TB_CFS_PASSCLOSE;
#define SZ_TB_CFS_PASSCLOSE    sizeof(T_TB_CFS_PASSCLOSE)

/***************************************************************************
   FARE_ADJUST_INFO : 근무정보
***************************************************************************/
struct   fare_adjust_info {
    unsigned char    c_worker_id[6+1]; /* 근무자 ID */
    unsigned char    c_fare_office_id[2+1]; /* 요금소 코드 */
    unsigned char    c_booth_id[2+1]; /* 차로 코드 */
    unsigned char    c_year[4+1]; /* 년도 */
    unsigned char    c_month[2+1]; /* 월 */
    unsigned char    c_day[2+1]; /* 일 */
    unsigned char    c_work_stt_time[6+1]; /* 근무 시작 시간 */
    unsigned char    c_work_end_time[6+1]; /* 근무 종료 시간 */
    unsigned int     n_exemption_quantity; /* 면제 통행량 */
    unsigned int     n_cash_quantity; /* 현금 통행량 */
    unsigned int     n_coupon_quantity; /* 쿠폰 통행량 */
    unsigned int     n_nonpayment_quantity; /* 미납 통행량 */
    unsigned int     n_card_before_quantity; /* 카드_선불 통행량 */
    unsigned int     n_card_after_quantity; /* 카드_후불 통행량 */
    unsigned int     n_coupon_sale_quantity; /* 쿠폰 판매량 */
    unsigned int     n_k_cash_q; /* 경차현금통행량 */
    unsigned int     n_k_coupon_q; /* 경차쿠폰통행량 */
    unsigned int     n_k_card_sun_q; /* 경차카드선불통행량 */
    unsigned int     n_k_card_who_q; /* 경차카드후불통행량 */
    unsigned int     n_k_coupon_sale_q; /* 경차정액권판매량 */
    unsigned int     n_total_income; /* 총 수입 금액 */
    unsigned int     n_cash_income; /* 현금 수입 금액 */
    unsigned int     n_card_before_income; /* 카드_선불 수입금액 */
    unsigned int     n_card_after_incme; /* 카드_후불 수입금액 */
    unsigned int     n_coupon_income; /* 쿠폰 수입금액 */
    unsigned int     n_coupon_sale; /* 쿠폰 판매금액 */
    unsigned int     n_k_cash_income; /* 경차현금수입금액 */
    unsigned int     n_k_card_sun_income; /* 경차카드선불수입금액 */
    unsigned int     n_k_card_who_income; /* 경차카드후불수입금액 */
    unsigned int     n_k_coupon_sale_income; /* 경차정액권판매금액 */
    unsigned int     n_deposit_pay; /* 입금액 */
    unsigned int     n_credit_pay; /* 출금액 */
    unsigned int     n_overfare_in_amount; /* 과오납 입금액 */
    unsigned int     n_overfare_out_amount; /* 과오납 출금액 */
    unsigned int     n_note_quantity; /* 수기 통행량 */
    unsigned int     n_note_income; /* 수기 통행금액 */
    unsigned char    c_income_adjust_yn[1+1]; /* 수입금정산여부(0:미정산,1:정산(검수원정산이 된 경우)) */
    unsigned char    c_income_date[8+1]; /* 수입금 정산일자 */
    unsigned char    c_income_part[1+1]; /* 수입금 정산그룹 */
    unsigned char    c_coupon_disuse_yn[1+1]; /* 회수쿠폰 폐기여부 */
    unsigned int     n_overcoupon_count; /* 과잉 쿠폰 매수 */
    unsigned int     n_coupon_return_count; /* 반납 쿠폰 매수 */
    unsigned int     n_k_overcoupon_cnt; /* 경차과잉쿠폰매수 */
    unsigned int     n_k_coupon_ret_cnt; /* 경차과잉쿠폰반납매수 */
    unsigned int     n_k_note_q; /* 경차수기통행량 */
    unsigned int     n_k_note_income; /* 경차수기수입금액 */
    unsigned int     n_repay_cnt; /* 환불건수 */
    unsigned int     n_repay_amount; /* 환불금액 */
    unsigned char    c_t_remark[60+1]; /* 비고 */
    unsigned char    c_fare_adjust_yn[1+1]; /* 정산 완료 여부 */
    unsigned char    c_file_kind_id[2+1]; /* File 코드 */
    unsigned char    c_data_seqno[10+1]; /* 자료번호 */
    unsigned char    c_trans_file_create_yn[1+1]; /* 전송화일 생성여부 */
    unsigned char    c_create_date[14+1]; /* 작성일자 */
    unsigned char    c_creater[10+1]; /* 작성자 */
    unsigned char    c_update_date[14+1]; /* 수정일자 */
    unsigned char    c_updater[10+1]; /* 수정자 */
    unsigned char    c_other_seqno[1+1]; /* 중복방지번호 */
    unsigned int     n_group_kbn; /* 그룹지정 */
    unsigned char    c_c_ampm[1+1]; /* 오전오후조구분 */
    unsigned int     n_rfid_cash_q; /* RFID 감면현금통행량 */
    unsigned int     n_rfid_sun_q; /* RFID 감면선불통행량 */
    unsigned int     n_rfid_who_q; /* RFID 감면후불통행량 */
    unsigned int     n_rfid_coupon_q; /* RFID 감면쿠폰통행량 */
    unsigned int     n_rfid_free_q; /* RFID 면제통행량 */
    unsigned int     n_rfid_cash_m; /* RFID 감면현금수입금 */
    unsigned int     n_rfid_sun_m; /* RFID 감면선불수입금 */
    unsigned int     n_rfid_who_m; /* RFID 감면후불수입금 */
    unsigned int     n_sale_card_q; /* 일반정액권카드판매권수 */
    unsigned int     n_sale_card_m; /* 일반정액권카드판매금액 */
    unsigned int     n_k_sale_card_q; /* 경차정액권카드판매권수 */
    unsigned int     n_k_sale_card_m; /* 경차정액권카드판매금액 */
};

typedef struct fare_adjust_info   T_FARE_ADJUST_INFO;
#define SZ_FARE_ADJUST_INFO    sizeof(T_FARE_ADJUST_INFO)

//exec sql end declare section;
#endif
