PayInvoicePrintMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.bz.smart_city.dao.pay.PayInvoicePrintMapper">
  4. <insert id="insert" parameterType="com.bz.smart_city.entity.pay.PayInvoiceprinted" useGeneratedKeys="true" keyProperty="id">
  5. INSERT INTO pay_invoice_printed(
  6. print_no,
  7. old_invoice_code,
  8. old_invoice_no,
  9. payseriesno,
  10. account_id,
  11. total_print_amount,
  12. total_amount,
  13. invoice_amount,
  14. invoice_code,
  15. invoice_no,
  16. ciphertext,
  17. check_code,
  18. print_date,
  19. state,
  20. invoice_type,
  21. type,
  22. create_by,
  23. create_date,
  24. update_by,
  25. update_date,
  26. remarks,
  27. del_flag,
  28. message,
  29. order_no,
  30. pdf_url,
  31. jpg_url,
  32. buyername,
  33. taxnum,
  34. canceltime,
  35. invoice_line,
  36. fpqqlsh,
  37. sendtype,
  38. site_id,
  39. customer_id,
  40. usercode,
  41. cancelinvoice_id,
  42. saleidentity
  43. ) VALUES (
  44. #{printNo},
  45. #{oldInvoiceCode},
  46. #{oldInvoiceNo},
  47. #{payseriesno},
  48. #{accountId},
  49. #{totalPrintAmount},
  50. #{totalAmount},
  51. #{invoiceAmount},
  52. #{invoiceCode},
  53. #{invoiceNo},
  54. #{ciphertext},
  55. #{checkCode},
  56. #{printDate},
  57. #{state},
  58. #{invoiceType},
  59. #{type},
  60. #{createBy},
  61. #{createDate},
  62. #{updateBy},
  63. #{updateDate},
  64. #{remarks},
  65. #{delFlag},
  66. #{message},
  67. #{orderNo},
  68. #{pdfUrl},
  69. #{jpgUrl},
  70. #{buyername},
  71. #{taxnum},
  72. #{canceltime},
  73. #{invoiceLine},
  74. #{fpqqlsh},
  75. #{sendtype},
  76. #{siteId},
  77. #{customerId},
  78. #{userCode},
  79. #{cancelInvoiceId},
  80. #{saleIdentity}
  81. )
  82. </insert>
  83. <select id="findInvoiceByPayseriesno" resultType="com.bz.smart_city.entity.pay.PayInvoiceprinted">
  84. select a.id, a.invoice_code as invoiceCode,a.invoice_no as invoiceNo,a.payseriesno
  85. from pay_invoice_printed a
  86. where a.id=#{invoicePrintId} and a.state=1 and a.site_id=#{siteId} and a.customer_id=#{customerId}
  87. limit 1
  88. </select>
  89. <update id="update">
  90. update pay_invoice_printed
  91. <set>
  92. <if test="payInvoiceprinted.state != null"> state=#{payInvoiceprinted.state},</if>
  93. <if test="payInvoiceprinted.orderNo != null">order_no=#{payInvoiceprinted.orderNo},</if>
  94. <if test="payInvoiceprinted.invoiceCode != null">invoice_code=#{payInvoiceprinted.invoiceCode},</if>
  95. <if test="payInvoiceprinted.printDate != null">print_date=#{payInvoiceprinted.printDate},</if>
  96. <if test="payInvoiceprinted.invoiceNo != null">invoice_no=#{payInvoiceprinted.invoiceNo},</if>
  97. <if test="payInvoiceprinted.message != null">message=#{payInvoiceprinted.message},</if>
  98. <if test="payInvoiceprinted.totalAmount != null">total_amount=#{payInvoiceprinted.totalAmount},</if>
  99. <if test="payInvoiceprinted.invoiceAmount != null">invoice_amount=#{payInvoiceprinted.invoiceAmount},</if>
  100. <if test="payInvoiceprinted.totalPrintAmount != null">total_print_amount=#{payInvoiceprinted.totalPrintAmount},</if>
  101. <if test="payInvoiceprinted.checkCode != null">check_code=#{payInvoiceprinted.checkCode},</if>
  102. <if test="payInvoiceprinted.pdfUrl != null">pdf_url=#{payInvoiceprinted.pdfUrl},</if>
  103. <if test="payInvoiceprinted.jpgUrl != null">jpg_url=#{payInvoiceprinted.jpgUrl},</if>
  104. <if test="payInvoiceprinted.remarks != null">remarks=#{payInvoiceprinted.remarks},</if>
  105. <if test="payInvoiceprinted.buyername != null">buyername=#{payInvoiceprinted.buyername},</if>
  106. <if test="payInvoiceprinted.taxnum != null">taxnum=#{payInvoiceprinted.taxnum},</if>
  107. </set>
  108. where id=#{payInvoiceprinted.id,jdbcType=BIGINT}
  109. </update>
  110. <select id="findListByState" resultType="com.bz.smart_city.entity.pay.PayInvoiceprinted">
  111. SELECT a.invoice_code as invoiceCode,a.invoice_no as invoiceNo,a.id as id,a.usercode as userCode,
  112. a.cancelinvoice_id as cancelInvoiceId,a.fpqqlsh as fpqqlsh,a.saleidentity as saleIdentity,
  113. a.invoice_type as invoiceType,customer_id as customerId
  114. from pay_invoice_printed a
  115. where a.state=0 or a.state=2
  116. </select>
  117. <update id="updateReceivedIsPrint">
  118. update pay_pay_received set isprint=#{isPrint}
  119. where payseriesno=#{payseriesno} and customer_id=#{customerId}
  120. </update>
  121. </mapper>