create or replace view bp_tenant_rate_detail_lv as
select "BP_DETAL_ID",
       "PROJECT_ID",
       "BP_BIRTH",
       "BP_MARRIAGE",
       "BP_HEALTH",
       "BP_BORN",
       "PROPERTY_BELONG",
       "OWN_PROPERTY_ADDRESS",
       "HOUSE_AREA",
       "HOUSE_VALUE",
       "OWN_MONEY",
       "BANK_CREDIT_APPROVAL",
       "OTHER_OWN_ASSETS",
       "FAMILY_SOURCE_INCOME",
       "FAMILY_AVG_INCOME",
       "FAMILY_MONTH_AVG_OUTCOME",
       "BANK_LOAN",
       "OTHER_LOAN",
       "FIXED_ASSETS",
       "CAPITAL",
       "CAPITAL_PLACE",
       "CAR_TYPE",
       "CAR_BRAND",
       "CAR_NUM",
       "CAR_BUY_DATE",
       "CAR_BUY_MONEY",
       "WORK_EXPERIENCE",
       "WORK_OPERATOR",
       "WORK_TYPE",
       "WORK_AVG_MONTH_INCOME",
       "WORK_AVG_MONTH_OUTCOME",
       "OTHER_DESCRIPTION",
       "PAYMENT_SOURCE",
       "E_PLACE",
       "E_CONTRACT_AMOUNT",
       "CONTRACT_COPY",
       "E_CON_AUTHENTICITY",
       "SURVEY_FIT",
       "DAILY_CREDIT",
       "BORROW_SITUATION",
       "RENT_REPAYMENT",
       "RENTAL_BALANCE",
       "LIQUIDATED_DAMAGES",
       "GUAR_MORTGAGE_STATUS",
       "PAST_CONT_EXE_STATUS",
       "INDUSTRY_JUDGEMENT",
       "THIRD_PARTY_GUARANTEE",
       "THIRD_PARTY_CREDIBILITY",
        (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'MARITAL_STATUS'
           and scv.code_value = t1.bp_marriage
           and  scv.code_enabled_flag='Y') bp_marriage_n,
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'HEALTH_STATUS'
           and scv.code_value = t1.bp_health
           and  scv.code_enabled_flag='Y') bp_health_n,
              (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'HOUSEHOLD_CODE'
           and scv.code_value = t1.bp_born
           and  scv.code_enabled_flag='Y') bp_born_n,
            (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'A51000000'
           and scv.code_value = t1.property_belong
           and  scv.code_enabled_flag='Y') property_belong_n,
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'HOUSEHOLD_ASSET'
           and scv.code_value = t1.house_value
           and  scv.code_enabled_flag='Y') house_value_n,
            (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'BANK_CREDIT_APPROVAL'
           and scv.code_value = t1.bank_credit_approval
           and  scv.code_enabled_flag='Y') bank_credit_approval_n,
           
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'HLS_YEARLY_INCOME'
           and scv.code_value = t1.family_avg_income
           and  scv.code_enabled_flag='Y') family_avg_income_n,
           
              (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'HLS_CUS_WORKING_AGE_TYPE'
           and scv.code_value = t1.work_experience
           and  scv.code_enabled_flag='Y') work_experience_n,
           
                (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'WORK_OPERATOR'
           and scv.code_value = t1.work_operator
           and  scv.code_enabled_flag='Y') work_operator_n,
            (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'WORK_STYLE'
           and scv.code_value = t1.work_type
           and  scv.code_enabled_flag='Y') work_type_n,
           
              (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'WORK_AVG_MONTH_INCOME'
           and scv.code_value = t1.work_avg_month_income
           and  scv.code_enabled_flag='Y') work_avg_month_income_n,
           
                  (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'HOUSEHOLD_CODE'
           and scv.code_value = t1.e_place
           and  scv.code_enabled_flag='Y') e_place_n,
                 (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'E_CONTRACT_AMOUNT'
           and scv.code_value = t1.e_contract_amount
           and  scv.code_enabled_flag='Y') e_contract_amount_n,
           
               (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'YES_OR_NO'
           and scv.code_value = t1.contract_copy
           and  scv.code_enabled_flag='Y') contract_copy_n,
               (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'E_CON_AUTHENTICITY'
           and scv.code_value = t1.e_con_authenticity
           and  scv.code_enabled_flag='Y') e_con_authenticity_n,
           
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'SURVEY_FIT'
           and scv.code_value = t1.survey_fit
           and  scv.code_enabled_flag='Y') survey_fit_n,
           
           
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'BP_CREDIT_CONSCIOUS'
           and scv.code_value = t1.daily_credit
           and  scv.code_enabled_flag='Y') daily_credit_n,
           
            (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'REPAYMENT_STATE'
           and scv.code_value = t1.borrow_situation
           and  scv.code_enabled_flag='Y') borrow_situation_n,
           
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'YES_OR_NO'
           and scv.code_value = t1.guar_mortgage_status
           and  scv.code_enabled_flag='Y') guar_mortgage_status_n,
           
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'PAST_CONT_EXE_STATUS'
           and scv.code_value = t1.past_cont_exe_status
           and  scv.code_enabled_flag='Y') past_cont_exe_status_n,
           
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'INDUSTRY_JUDGEMENT'
           and scv.code_value = t1.industry_judgement
           and  scv.code_enabled_flag='Y') industry_judgement_n,
             (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'YES_OR_NO'
           and scv.code_value = t1.third_party_guarantee
           and  scv.code_enabled_flag='Y') third_party_guarantee_n,
           
            (select code_value_name
          from sys_code_values_v scv
         where scv.code = 'THIRD_PARTY_CREDIBILITY'
           and scv.code_value = t1.third_party_credibility
           and  scv.code_enabled_flag='Y') third_party_credibility_n
           
           
  from bp_tenant_rate_detail t1;