1 @Select("<script>" +
2 "DECLARE @edi_Invoice_Details edi_Invoice_Details;" +
3 "DECLARE @edi_Invoice_OrderItem edi_Invoice_OrderItem;" +
4
5 "INSERT INTO @edi_Invoice_Details (" +
6 "oldso,so,po,invoiceTaxNo,invoiceType,invoiceTitle,
" +
7 "invoiceAddress,invoiceState,invoiceTaxRate,invoiceContent,
" +
8 "invoiceRatePrice,invoiceNoTaxPrice,invoiceId,invoiceDate,invoiceTaxPrice,invoiceNO,invoiceCode" +
9 " ) " +
10 "VALUES " +
11 "<foreach collection="ediInvoiceDetails" item="ediInvoiceDetail" index="index" separator="," close=";">" +
12 "( " +
13 "#{ediInvoiceDetail.oldso},#{ediInvoiceDetail.so},#{ediInvoiceDetail.po},#{ediInvoiceDetail.invoiceTaxNo},#{ediInvoiceDetail.invoiceType},#{ediInvoiceDetail.invoiceTitle}," +
14 "#{ediInvoiceDetail.invoiceAddress},#{ediInvoiceDetail.invoiceState},#{ediInvoiceDetail.invoiceTaxRate},#{ediInvoiceDetail.invoiceContent},#{ediInvoiceDetail.invoiceRatePrice}," +
15 "#{ediInvoiceDetail.invoiceNoTaxPrice},#{ediInvoiceDetail.invoiceId},CONVERT(DATETIME,#{ediInvoiceDetail.invoiceDate},105),#{ediInvoiceDetail.invoiceTaxPrice},"+
16 "#{ediInvoiceDetail.invoiceNO},#{ediInvoiceDetail.invoiceCode}"+
17 " )" +
18 "</foreach> " +
19 "<foreach collection="ediInvoiceDetails" item="ediInvoiceDetail" index="index" open="begin" close=";end;" separator=";">" +
20 "INSERT INTO @edi_Invoice_OrderItem ( " +
21 "invoiceDetailsId, so, bomCode, agreementPrice,productAmount, productName " +
22 ") " +
23 "VALUES " +
24
25 "<foreach collection="ediInvoiceDetail.sodetails" item="sodetail" index="index" separator=",">( " +
26 "#{sodetail.invoiceDetailsId},#{sodetail.so},#{sodetail.bomCode},#{sodetail.agreementPrice},#{sodetail.productAmount},#{sodetail.productName} "+
27 " )</foreach></foreach> " +
28
29 "EXEC up_EDI_Sync_SaveEDIInvoiceDetails @edi_Invoice_Details,@edi_Invoice_OrderItem"+
30 "</script>")
31 @Options(statementType = StatementType.CALLABLE)
32 void saveEdiInvoiceDetails(@Param("ediInvoiceDetails") List<EDIInvoiceDetails> ediInvoiceDetails);