select pay_alloc_cert_no,
pac.vou_date,
pac.agency_code,
pac.use,
pac.pay_amt,
pac.bgt_id,
bbi.summary,
pac.exp_func_code,
pac.exp_func_name,
pac.dep_bgt_eco_code,
pac.dep_bgt_eco_name,
pac.set_mode_code,
pac.set_mode_name,
pac.pay_type_code,
pac.pay_type_name,
pac.payee_acct_name,
pac.pro_code,
pac.pro_name,
bbi.pro_Cate_Code,
bbi.pro_Cate_Code
from pay_allocation_cert pac,bmp_quota.ba_bgt_info bbi where bbi.bgt_id = pac.bgt_id and pac.pay_alloc_cert_id NOT IN ( SELECT pay_alloc_cert_id FROM pay_allocation_cert where JSON_EXTRACT ( extend,
'$."PayStatus"' ) = '1')AND pac.is_delete = 0
AND pac.is_deleted = 0
and pac.vt_status = '12'