InvoiceApplyItemV1ServiceDaoImplMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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="invoiceApplyItemV1ServiceDaoImpl">
  6. <!-- 保存发票申请项信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveInvoiceApplyItemInfo" parameterType="Map">
  8. insert into invoice_apply_item(
  9. item_id,apply_id,item_type,item_name,item_amount,item_obj_id,remark,community_id
  10. ) values (
  11. #{itemId},#{applyId},#{itemType},#{itemName},#{itemAmount},#{itemObjId},#{remark},#{communityId}
  12. )
  13. </insert>
  14. <insert id="saveInvoiceApplyItems" parameterType="Map">
  15. insert into invoice_apply_item(
  16. item_id,apply_id,item_type,item_name,item_amount,item_obj_id,remark,community_id
  17. ) values
  18. <foreach collection="invoiceApplyItemPos" item="item" separator=",">
  19. (#{item.itemId},#{item.applyId},#{item.itemType},#{item.itemName},#{item.itemAmount},#{item.itemObjId},#{item.remark},#{item.communityId})
  20. </foreach>
  21. </insert>
  22. <!-- 查询发票申请项信息 add by wuxw 2018-07-03 -->
  23. <select id="getInvoiceApplyItemInfo" parameterType="Map" resultType="Map">
  24. select t.item_id,t.item_id itemId,t.apply_id,t.apply_id applyId,t.item_type,t.item_type
  25. itemType,t.item_name,t.item_name itemName,t.item_amount,t.item_amount itemAmount,t.item_obj_id,t.item_obj_id
  26. itemObjId,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId
  27. from invoice_apply_item t
  28. where 1 =1
  29. <if test="itemId !=null and itemId != ''">
  30. and t.item_id= #{itemId}
  31. </if>
  32. <if test="applyId !=null and applyId != ''">
  33. and t.apply_id= #{applyId}
  34. </if>
  35. <if test="itemType !=null and itemType != ''">
  36. and t.item_type= #{itemType}
  37. </if>
  38. <if test="itemName !=null and itemName != ''">
  39. and t.item_name= #{itemName}
  40. </if>
  41. <if test="itemAmount !=null and itemAmount != ''">
  42. and t.item_amount= #{itemAmount}
  43. </if>
  44. <if test="itemObjId !=null and itemObjId != ''">
  45. and t.item_obj_id= #{itemObjId}
  46. </if>
  47. <if test="remark !=null and remark != ''">
  48. and t.remark= #{remark}
  49. </if>
  50. <if test="statusCd !=null and statusCd != ''">
  51. and t.status_cd= #{statusCd}
  52. </if>
  53. <if test="communityId !=null and communityId != ''">
  54. and t.community_id= #{communityId}
  55. </if>
  56. order by t.create_time desc
  57. <if test="page != -1 and page != null ">
  58. limit #{page}, #{row}
  59. </if>
  60. </select>
  61. <!-- 修改发票申请项信息 add by wuxw 2018-07-03 -->
  62. <update id="updateInvoiceApplyItemInfo" parameterType="Map">
  63. update invoice_apply_item t set t.status_cd = #{statusCd}
  64. <if test="newBId != null and newBId != ''">
  65. ,t.b_id = #{newBId}
  66. </if>
  67. <if test="itemType !=null and itemType != ''">
  68. , t.item_type= #{itemType}
  69. </if>
  70. <if test="itemName !=null and itemName != ''">
  71. , t.item_name= #{itemName}
  72. </if>
  73. <if test="itemAmount !=null and itemAmount != ''">
  74. , t.item_amount= #{itemAmount}
  75. </if>
  76. <if test="itemObjId !=null and itemObjId != ''">
  77. , t.item_obj_id= #{itemObjId}
  78. </if>
  79. <if test="remark !=null and remark != ''">
  80. , t.remark= #{remark}
  81. </if>
  82. where 1=1
  83. <if test="applyId !=null and applyId != ''">
  84. and t.apply_id= #{applyId}
  85. </if>
  86. <if test="itemId !=null and itemId != ''">
  87. and t.item_id= #{itemId}
  88. </if>
  89. <if test="communityId !=null and communityId != ''">
  90. and t.community_id= #{communityId}
  91. </if>
  92. </update>
  93. <!-- 查询发票申请项数量 add by wuxw 2018-07-03 -->
  94. <select id="queryInvoiceApplyItemsCount" parameterType="Map" resultType="Map">
  95. select count(1) count
  96. from invoice_apply_item t
  97. where 1 =1
  98. <if test="itemId !=null and itemId != ''">
  99. and t.item_id= #{itemId}
  100. </if>
  101. <if test="applyId !=null and applyId != ''">
  102. and t.apply_id= #{applyId}
  103. </if>
  104. <if test="itemType !=null and itemType != ''">
  105. and t.item_type= #{itemType}
  106. </if>
  107. <if test="itemName !=null and itemName != ''">
  108. and t.item_name= #{itemName}
  109. </if>
  110. <if test="itemAmount !=null and itemAmount != ''">
  111. and t.item_amount= #{itemAmount}
  112. </if>
  113. <if test="itemObjId !=null and itemObjId != ''">
  114. and t.item_obj_id= #{itemObjId}
  115. </if>
  116. <if test="remark !=null and remark != ''">
  117. and t.remark= #{remark}
  118. </if>
  119. <if test="statusCd !=null and statusCd != ''">
  120. and t.status_cd= #{statusCd}
  121. </if>
  122. <if test="communityId !=null and communityId != ''">
  123. and t.community_id= #{communityId}
  124. </if>
  125. </select>
  126. </mapper>