InvoiceApplyV1ServiceDaoImplMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="invoiceApplyV1ServiceDaoImpl">
  6. <!-- 保存发票申请信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveInvoiceApplyInfo" parameterType="Map">
  8. insert into invoice_apply(
  9. apply_id,oi_id,create_user_id,owner_name,invoice_type,apply_tel,invoice_amount,create_user_name,remark,state,community_id
  10. ) values (
  11. #{applyId},#{oiId},#{createUserId},#{ownerName},#{invoiceType},#{applyTel},#{invoiceAmount},#{createUserName},#{remark},#{state},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询发票申请信息 add by wuxw 2018-07-03 -->
  15. <select id="getInvoiceApplyInfo" parameterType="Map" resultType="Map">
  16. select t.apply_id,t.apply_id applyId,t.oi_id,t.oi_id oiId,t.create_user_id,t.create_user_id
  17. createUserId,t.owner_name,t.owner_name ownerName,t.invoice_type,t.invoice_type
  18. invoiceType,t.apply_tel,t.apply_tel applyTel,t.invoice_amount,t.invoice_amount
  19. invoiceAmount,t.create_user_name,t.create_user_name createUserName,t.remark,t.status_cd,t.status_cd
  20. statusCd,t.state,t.community_id,t.community_id communityId,oi.invoice_name invoiceName,oi.invoice_num invoiceNum,oi.invoice_address invoiceAddress
  21. from invoice_apply t
  22. left join owner_invoice oi on t.oi_id = oi.oi_id
  23. where 1 =1
  24. <if test="applyId !=null and applyId != ''">
  25. and t.apply_id= #{applyId}
  26. </if>
  27. <if test="oiId !=null and oiId != ''">
  28. and t.oi_id= #{oiId}
  29. </if>
  30. <if test="createUserId !=null and createUserId != ''">
  31. and t.create_user_id= #{createUserId}
  32. </if>
  33. <if test="ownerName !=null and ownerName != ''">
  34. and t.owner_name= #{ownerName}
  35. </if>
  36. <if test="invoiceType !=null and invoiceType != ''">
  37. and t.invoice_type= #{invoiceType}
  38. </if>
  39. <if test="applyTel !=null and applyTel != ''">
  40. and t.apply_tel= #{applyTel}
  41. </if>
  42. <if test="invoiceAmount !=null and invoiceAmount != ''">
  43. and t.invoice_amount= #{invoiceAmount}
  44. </if>
  45. <if test="createUserName !=null and createUserName != ''">
  46. and t.create_user_name= #{createUserName}
  47. </if>
  48. <if test="remark !=null and remark != ''">
  49. and t.remark= #{remark}
  50. </if>
  51. <if test="statusCd !=null and statusCd != ''">
  52. and t.status_cd= #{statusCd}
  53. </if>
  54. <if test="state !=null and state != ''">
  55. and t.state= #{state}
  56. </if>
  57. <if test="communityId !=null and communityId != ''">
  58. and t.community_id= #{communityId}
  59. </if>
  60. order by t.create_time desc
  61. <if test="page != -1 and page != null ">
  62. limit #{page}, #{row}
  63. </if>
  64. </select>
  65. <!-- 修改发票申请信息 add by wuxw 2018-07-03 -->
  66. <update id="updateInvoiceApplyInfo" parameterType="Map">
  67. update invoice_apply t set t.status_cd = #{statusCd}
  68. <if test="newBId != null and newBId != ''">
  69. ,t.b_id = #{newBId}
  70. </if>
  71. <if test="oiId !=null and oiId != ''">
  72. , t.oi_id= #{oiId}
  73. </if>
  74. <if test="createUserId !=null and createUserId != ''">
  75. , t.create_user_id= #{createUserId}
  76. </if>
  77. <if test="ownerName !=null and ownerName != ''">
  78. , t.owner_name= #{ownerName}
  79. </if>
  80. <if test="invoiceType !=null and invoiceType != ''">
  81. , t.invoice_type= #{invoiceType}
  82. </if>
  83. <if test="applyTel !=null and applyTel != ''">
  84. , t.apply_tel= #{applyTel}
  85. </if>
  86. <if test="invoiceAmount !=null and invoiceAmount != ''">
  87. , t.invoice_amount= #{invoiceAmount}
  88. </if>
  89. <if test="createUserName !=null and createUserName != ''">
  90. , t.create_user_name= #{createUserName}
  91. </if>
  92. <if test="remark !=null and remark != ''">
  93. , t.remark= #{remark}
  94. </if>
  95. <if test="state !=null and state != ''">
  96. , t.state= #{state}
  97. </if>
  98. <if test="communityId !=null and communityId != ''">
  99. , t.community_id= #{communityId}
  100. </if>
  101. where 1=1
  102. <if test="applyId !=null and applyId != ''">
  103. and t.apply_id= #{applyId}
  104. </if>
  105. </update>
  106. <!-- 查询发票申请数量 add by wuxw 2018-07-03 -->
  107. <select id="queryInvoiceApplysCount" parameterType="Map" resultType="Map">
  108. select count(1) count
  109. from invoice_apply t
  110. where 1 =1
  111. <if test="applyId !=null and applyId != ''">
  112. and t.apply_id= #{applyId}
  113. </if>
  114. <if test="oiId !=null and oiId != ''">
  115. and t.oi_id= #{oiId}
  116. </if>
  117. <if test="createUserId !=null and createUserId != ''">
  118. and t.create_user_id= #{createUserId}
  119. </if>
  120. <if test="ownerName !=null and ownerName != ''">
  121. and t.owner_name= #{ownerName}
  122. </if>
  123. <if test="invoiceType !=null and invoiceType != ''">
  124. and t.invoice_type= #{invoiceType}
  125. </if>
  126. <if test="applyTel !=null and applyTel != ''">
  127. and t.apply_tel= #{applyTel}
  128. </if>
  129. <if test="invoiceAmount !=null and invoiceAmount != ''">
  130. and t.invoice_amount= #{invoiceAmount}
  131. </if>
  132. <if test="createUserName !=null and createUserName != ''">
  133. and t.create_user_name= #{createUserName}
  134. </if>
  135. <if test="remark !=null and remark != ''">
  136. and t.remark= #{remark}
  137. </if>
  138. <if test="statusCd !=null and statusCd != ''">
  139. and t.status_cd= #{statusCd}
  140. </if>
  141. <if test="state !=null and state != ''">
  142. and t.state= #{state}
  143. </if>
  144. <if test="communityId !=null and communityId != ''">
  145. and t.community_id= #{communityId}
  146. </if>
  147. </select>
  148. </mapper>