select thisTab.id, thisTab.order_no, thisTab.invoice_info_id, thisTab.invoice_seller_id, thisTab.customer_name, thisTab.invoice_seller_name, thisTab.invoice_company_name, thisTab.invoice_credit_code, thisTab.invoice_seller_credit_code, thisTab.invoice_bank_name, thisTab.invoice_bank_no, thisTab.invoice_operating_license_address, thisTab.invoice_operating_license_phone, thisTab.invoice_seller_address, thisTab.invoice_seller_phone, thisTab.invoice_operating_license_email, thisTab.status, thisTab.invoice_no, thisTab.invoice_date, thisTab.invoice_amount, thisTab.related_bill_billed_amount, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted, thisTab.invoice_type, thisTab.enterprise_type from invoice_manage AS thisTab
select count(0) from invoice_manage as thisTab
and thisTab.order_no = #{orderNo}
and thisTab.invoice_info_id = #{invoiceInfoId}
and thisTab.invoice_seller_id = #{invoiceSellerId}
and thisTab.customer_name like concat('%', #{customerName}, '%')
and thisTab.invoice_seller_name like concat('%', #{invoiceSellerName}, '%')
and thisTab.invoice_company_name like concat('%', #{invoiceCompanyName}, '%')
and thisTab.invoice_credit_code = #{invoiceCreditCode}
and thisTab.invoice_seller_credit_code = #{invoiceSellerCreditCode}
and thisTab.invoice_bank_name like concat('%', #{invoiceBankName}, '%')
and thisTab.invoice_bank_no = #{invoiceBankNo}
and thisTab.invoice_operating_license_address = #{invoiceOperatingLicenseAddress}
and thisTab.invoice_operating_license_phone = #{invoiceOperatingLicensePhone}
and thisTab.invoice_seller_address = #{invoiceSellerAddress}
and thisTab.invoice_seller_phone = #{invoiceSellerPhone}
and thisTab.invoice_operating_license_email = #{invoiceOperatingLicenseEmail}
and thisTab.status = #{status}
and thisTab.invoice_no = #{invoiceNo}
and thisTab.invoice_date = #{invoiceDate}
and thisTab.invoice_amount = #{invoiceAmount}
and thisTab.deleted = #{deleted}
and thisTab.invoice_type = #{invoiceType}
and thisTab.enterprise_type = #{enterpriseType}
insert into invoice_manage
order_no,
invoice_info_id,
invoice_seller_id,
customer_name,
invoice_seller_name,
invoice_company_name,
invoice_credit_code,
invoice_seller_credit_code,
invoice_bank_name,
invoice_bank_no,
invoice_operating_license_address,
invoice_operating_license_phone,
invoice_seller_address,
invoice_seller_phone,
invoice_operating_license_email,
status,
invoice_no,
invoice_date,
invoice_amount,
related_bill_billed_amount,
create_by,
update_by,
create_time,
update_time,
deleted,
invoice_type,
enterprise_type,
#{orderNo},
#{invoiceInfoId},
#{invoiceSellerId},
#{customerName},
#{invoiceSellerName},
#{invoiceCompanyName},
#{invoiceCreditCode},
#{invoiceSellerCreditCode},
#{invoiceBankName},
#{invoiceBankNo},
#{invoiceOperatingLicenseAddress},
#{invoiceOperatingLicensePhone},
#{invoiceSellerAddress},
#{invoiceSellerPhone},
#{invoiceOperatingLicenseEmail},
#{status},
#{invoiceNo},
#{invoiceDate},
#{invoiceAmount},
#{relatedBillBilledAmount},
#{createBy},
#{updateBy},
#{createTime},
#{updateTime},
#{deleted},
#{invoiceType},
#{enterpriseType},
insert into invoice_manage
id,order_no,invoice_info_id,invoice_seller_id,customer_name,invoice_seller_name,invoice_company_name,invoice_credit_code,invoice_seller_credit_code,invoice_bank_name,invoice_bank_no,invoice_operating_license_address,invoice_operating_license_phone,invoice_seller_address,invoice_seller_phone,invoice_operating_license_email,status,invoice_no,invoice_date,invoice_amount,related_bill_billed_amount,create_by,update_by,create_time,update_time,deleted,invoice_type,enterprise_type,
#{item.id},#{item.orderNo},#{item.invoiceInfoId},#{item.invoiceSellerId},#{item.customerName},#{item.invoiceSellerName},#{item.invoiceCompanyName},#{item.invoiceCreditCode},#{item.invoiceSellerCreditCode},#{item.invoiceBankName},#{item.invoiceBankNo},#{item.invoiceOperatingLicenseAddress},#{item.invoiceOperatingLicensePhone},#{item.invoiceSellerAddress},#{item.invoiceSellerPhone},#{item.invoiceOperatingLicenseEmail},#{item.status},#{item.invoiceNo},#{item.invoiceDate},#{item.invoiceAmount},#{item.relatedBillBilledAmount},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},#{item.invoiceType},#{item.enterpriseType},
update invoice_manage
order_no = #{orderNo},
invoice_info_id = #{invoiceInfoId},
invoice_seller_id = #{invoiceSellerId},
customer_name = #{customerName},
invoice_seller_name = #{invoiceSellerName},
invoice_company_name = #{invoiceCompanyName},
invoice_credit_code = #{invoiceCreditCode},
invoice_seller_credit_code = #{invoiceSellerCreditCode},
invoice_bank_name = #{invoiceBankName},
invoice_bank_no = #{invoiceBankNo},
invoice_operating_license_address = #{invoiceOperatingLicenseAddress},
invoice_operating_license_phone = #{invoiceOperatingLicensePhone},
invoice_seller_address = #{invoiceSellerAddress},
invoice_seller_phone = #{invoiceSellerPhone},
invoice_operating_license_email = #{invoiceOperatingLicenseEmail},
status = #{status},
invoice_no = #{invoiceNo},
invoice_date = #{invoiceDate},
invoice_amount = #{invoiceAmount},
related_bill_billed_amount = #{relatedBillBilledAmount},
create_by = #{createBy},
update_by = #{updateBy},
create_time = #{createTime},
update_time = #{updateTime},
deleted = #{deleted},
invoice_type = #{invoiceType},
enterprise_type = #{enterpriseType},
where id = #{id}
update invoice_manage
order_no = #{item.orderNo},
invoice_info_id = #{item.invoiceInfoId},
invoice_seller_id = #{item.invoiceSellerId},
customer_name = #{item.customerName},
invoice_seller_name = #{item.invoiceSellerName},
invoice_company_name = #{item.invoiceCompanyName},
invoice_credit_code = #{item.invoiceCreditCode},
invoice_seller_credit_code = #{item.invoiceSellerCreditCode},
invoice_bank_name = #{item.invoiceBankName},
invoice_bank_no = #{item.invoiceBankNo},
invoice_operating_license_address = #{item.invoiceOperatingLicenseAddress},
invoice_operating_license_phone = #{item.invoiceOperatingLicensePhone},
invoice_seller_address = #{item.invoiceSellerAddress},
invoice_seller_phone = #{item.invoiceSellerPhone},
invoice_operating_license_email = #{item.invoiceOperatingLicenseEmail},
status = #{item.status},
invoice_no = #{item.invoiceNo},
invoice_date = #{item.invoiceDate},
invoice_amount = #{item.invoiceAmount},
related_bill_billed_amount = #{item.relatedBillBilledAmount},
create_by = #{item.createBy},
update_by = #{item.updateBy},
create_time = #{item.createTime},
update_time = #{item.updateTime},
deleted = #{item.deleted},
invoice_type = #{item.invoiceType},
enterprise_type = #{item.enterpriseType},
where id = #{item.id}
delete from invoice_manage where id = #{id}
delete from invoice_manage where id in
#{id}
delete from invoice_detail where invoice_manage_id in
#{invoiceManageId}
delete from invoice_detail where invoice_manage_id = #{invoiceManageId}
insert into invoice_detail( invoice_manage_id, receivable_bill_no, receivable_bill_amount, receivable_bill_currency, billed_amount, unbilled_amount, current_billed_amount, create_time, update_time, deleted) values
( #{item.invoiceManageId}, #{item.receivableBillNo}, #{item.receivableBillAmount}, #{item.receivableBillCurrency}, #{item.billedAmount}, #{item.unbilledAmount}, #{item.currentBilledAmount}, #{item.createTime}, #{item.updateTime}, #{item.deleted})