SELECT a.payment_no,a.po_no,a.sc_no,a.payment_money,a.pc_no,b.pc_name,c.signed_company_name,c.vendor_name,c.sign_date,c.order_date,applicant_name from TPC_PAYMENT aleft join tma_po_base b on a.po_no = b.po_noleft join tma_pc_base c on b.pc_no = c.pc_nowhere 1=1 ${if(len(depart_name) == 0,"","and c.signed_company_name = '" + depart_name + "'")}order by c.sign_date