PurchaseApplyDetailV1ServiceDaoImplMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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="purchaseApplyDetailV1ServiceDaoImpl">
  6. <!-- 保存采购申请明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="savePurchaseApplyDetailInfo" parameterType="Map">
  8. insert into purchase_apply_detail(
  9. original_stock,quantity,operate,price,purchase_remark,purchase_quantity,rs_id,apply_order_id,remark,id,res_id
  10. ) values (
  11. #{originalStock},#{quantity},#{operate},#{price},#{purchaseRemark},#{purchaseQuantity},#{rsId},#{applyOrderId},#{remark},#{id},#{resId}
  12. )
  13. </insert>
  14. <!-- 查询采购申请明细信息 add by wuxw 2018-07-03 -->
  15. <select id="getPurchaseApplyDetailInfo" parameterType="Map" resultType="Map">
  16. select t.original_stock,t.original_stock originalStock,t.quantity,t.price,t.purchase_remark,t.purchase_remark
  17. purchaseRemark,t.purchase_quantity,t.purchase_quantity purchaseQuantity,t.rs_id,t.rs_id
  18. rsId,t.apply_order_id,t.apply_order_id applyOrderId,t.remark,t.status_cd,t.status_cd
  19. statusCd,t.id,t.res_id,t.res_id resId
  20. from purchase_apply_detail t
  21. where 1 =1
  22. <if test="originalStock !=null and originalStock != ''">
  23. and t.original_stock= #{originalStock}
  24. </if>
  25. <if test="quantity !=null and quantity != ''">
  26. and t.quantity= #{quantity}
  27. </if>
  28. <if test="price !=null and price != ''">
  29. and t.price= #{price}
  30. </if>
  31. <if test="purchaseRemark !=null and purchaseRemark != ''">
  32. and t.purchase_remark= #{purchaseRemark}
  33. </if>
  34. <if test="purchaseQuantity !=null and purchaseQuantity != ''">
  35. and t.purchase_quantity= #{purchaseQuantity}
  36. </if>
  37. <if test="rsId !=null and rsId != ''">
  38. and t.rs_id= #{rsId}
  39. </if>
  40. <if test="applyOrderId !=null and applyOrderId != ''">
  41. and t.apply_order_id= #{applyOrderId}
  42. </if>
  43. <if test="remark !=null and remark != ''">
  44. and t.remark= #{remark}
  45. </if>
  46. <if test="statusCd !=null and statusCd != ''">
  47. and t.status_cd= #{statusCd}
  48. </if>
  49. <if test="id !=null and id != ''">
  50. and t.id= #{id}
  51. </if>
  52. <if test="resId !=null and resId != ''">
  53. and t.res_id= #{resId}
  54. </if>
  55. order by t.create_time desc
  56. <if test="page != -1 and page != null ">
  57. limit #{page}, #{row}
  58. </if>
  59. </select>
  60. <!-- 修改采购申请明细信息 add by wuxw 2018-07-03 -->
  61. <update id="updatePurchaseApplyDetailInfo" parameterType="Map">
  62. update purchase_apply_detail t set t.status_cd = #{statusCd}
  63. <if test="newBId != null and newBId != ''">
  64. ,t.b_id = #{newBId}
  65. </if>
  66. <if test="originalStock !=null and originalStock != ''">
  67. , t.original_stock= #{originalStock}
  68. </if>
  69. <if test="quantity !=null and quantity != ''">
  70. , t.quantity= #{quantity}
  71. </if>
  72. <if test="price !=null and price != ''">
  73. , t.price= #{price}
  74. </if>
  75. <if test="purchaseRemark !=null and purchaseRemark != ''">
  76. , t.purchase_remark= #{purchaseRemark}
  77. </if>
  78. <if test="purchaseQuantity !=null and purchaseQuantity != ''">
  79. , t.purchase_quantity= #{purchaseQuantity}
  80. </if>
  81. <if test="rsId !=null and rsId != ''">
  82. , t.rs_id= #{rsId}
  83. </if>
  84. <if test="applyOrderId !=null and applyOrderId != ''">
  85. , t.apply_order_id= #{applyOrderId}
  86. </if>
  87. <if test="remark !=null and remark != ''">
  88. , t.remark= #{remark}
  89. </if>
  90. <if test="resId !=null and resId != ''">
  91. , t.res_id= #{resId}
  92. </if>
  93. where 1=1
  94. <if test="id !=null and id != ''">
  95. and t.id= #{id}
  96. </if>
  97. </update>
  98. <!-- 查询采购申请明细数量 add by wuxw 2018-07-03 -->
  99. <select id="queryPurchaseApplyDetailsCount" parameterType="Map" resultType="Map">
  100. select count(1) count
  101. from purchase_apply_detail t
  102. where 1 =1
  103. <if test="originalStock !=null and originalStock != ''">
  104. and t.original_stock= #{originalStock}
  105. </if>
  106. <if test="quantity !=null and quantity != ''">
  107. and t.quantity= #{quantity}
  108. </if>
  109. <if test="price !=null and price != ''">
  110. and t.price= #{price}
  111. </if>
  112. <if test="purchaseRemark !=null and purchaseRemark != ''">
  113. and t.purchase_remark= #{purchaseRemark}
  114. </if>
  115. <if test="purchaseQuantity !=null and purchaseQuantity != ''">
  116. and t.purchase_quantity= #{purchaseQuantity}
  117. </if>
  118. <if test="rsId !=null and rsId != ''">
  119. and t.rs_id= #{rsId}
  120. </if>
  121. <if test="applyOrderId !=null and applyOrderId != ''">
  122. and t.apply_order_id= #{applyOrderId}
  123. </if>
  124. <if test="remark !=null and remark != ''">
  125. and t.remark= #{remark}
  126. </if>
  127. <if test="statusCd !=null and statusCd != ''">
  128. and t.status_cd= #{statusCd}
  129. </if>
  130. <if test="id !=null and id != ''">
  131. and t.id= #{id}
  132. </if>
  133. <if test="resId !=null and resId != ''">
  134. and t.res_id= #{resId}
  135. </if>
  136. </select>
  137. </mapper>