select<include refid="searchPageSqlNew"></include>
from pay_voucher_bill pvb inner join pay_voucher pv on pvb.pay_cert_id = pv.pay_cert_id where pvb.is_deleted = 0
and pvb.vt_status = '12'
and pvb.clear_date is not null
and pvb.purchase_flag = '1'
and pvb.pay_cert_id NOT IN ( SELECT pay_cert_id FROM pay_voucher_bill where JSON_EXTRACT ( extend, '$."ContractStatus"' ) = '1')
AND pvb.is_delete = 0
AND pv.is_deleted = 0
AND pv.is_delete = 0
and pvb.contract_guid is not null