AllocationUserStorehouseV1ServiceDaoImplMapper.xml 5.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="allocationUserAllocationUserStorehousehouseV1ServiceDaoImpl">
  6. <!-- 保存用户仓库信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveAllocationUserStorehouseInfo" parameterType="Map">
  8. insert into allocation_user_storehouse(
  9. res_name,start_user_id,accept_user_id,accept_user_name,start_user_name,aus_id,remark,store_id,stock,res_id,give_quantity
  10. ) values (
  11. #{resName},#{startUserId},#{acceptUserId},#{acceptUserName},#{startUserName},#{ausId},#{remark},#{storeId},#{stock},#{resId},#{giveQuantity}
  12. )
  13. </insert>
  14. <!-- 查询用户仓库信息 add by wuxw 2018-07-03 -->
  15. <select id="getAllocationUserStorehouseInfo" parameterType="Map" resultType="Map">
  16. select t.res_name,t.res_name resName,t.start_user_id,t.start_user_id startUserId,t.accept_user_id,t.accept_user_id acceptUserId,t.accept_user_name,t.accept_user_name acceptUserName,t.start_user_name,t.start_user_name startUserName,t.aus_id,t.aus_id ausId,t.status_cd,t.status_cd statusCd,t.remark,t.store_id,t.store_id storeId,t.stock,t.res_id,t.res_id resId,t.give_quantity,t.give_quantity giveQuantity
  17. from allocation_user_storehouse t
  18. where 1 =1
  19. <if test="resName !=null and resName != ''">
  20. and t.res_name= #{resName}
  21. </if>
  22. <if test="startUserId !=null and startUserId != ''">
  23. and t.start_user_id= #{startUserId}
  24. </if>
  25. <if test="acceptUserId !=null and acceptUserId != ''">
  26. and t.accept_user_id= #{acceptUserId}
  27. </if>
  28. <if test="acceptUserName !=null and acceptUserName != ''">
  29. and t.accept_user_name= #{acceptUserName}
  30. </if>
  31. <if test="startUserName !=null and startUserName != ''">
  32. and t.start_user_name= #{startUserName}
  33. </if>
  34. <if test="ausId !=null and ausId != ''">
  35. and t.aus_id= #{ausId}
  36. </if>
  37. <if test="statusCd !=null and statusCd != ''">
  38. and t.status_cd= #{statusCd}
  39. </if>
  40. <if test="remark !=null and remark != ''">
  41. and t.remark= #{remark}
  42. </if>
  43. <if test="storeId !=null and storeId != ''">
  44. and t.store_id= #{storeId}
  45. </if>
  46. <if test="stock !=null and stock != ''">
  47. and t.stock= #{stock}
  48. </if>
  49. <if test="resId !=null and resId != ''">
  50. and t.res_id= #{resId}
  51. </if>
  52. <if test="giveQuantity !=null and giveQuantity != ''">
  53. and t.give_quantity= #{giveQuantity}
  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="updateAllocationUserStorehouseInfo" parameterType="Map">
  62. update allocation_user_storehouse t set t.status_cd = #{statusCd}
  63. <if test="newBId != null and newBId != ''">
  64. ,t.b_id = #{newBId}
  65. </if>
  66. <if test="resName !=null and resName != ''">
  67. , t.res_name= #{resName}
  68. </if>
  69. <if test="startUserId !=null and startUserId != ''">
  70. , t.start_user_id= #{startUserId}
  71. </if>
  72. <if test="acceptUserId !=null and acceptUserId != ''">
  73. , t.accept_user_id= #{acceptUserId}
  74. </if>
  75. <if test="acceptUserName !=null and acceptUserName != ''">
  76. , t.accept_user_name= #{acceptUserName}
  77. </if>
  78. <if test="startUserName !=null and startUserName != ''">
  79. , t.start_user_name= #{startUserName}
  80. </if>
  81. <if test="remark !=null and remark != ''">
  82. , t.remark= #{remark}
  83. </if>
  84. <if test="storeId !=null and storeId != ''">
  85. , t.store_id= #{storeId}
  86. </if>
  87. <if test="stock !=null and stock != ''">
  88. , t.stock= #{stock}
  89. </if>
  90. <if test="resId !=null and resId != ''">
  91. , t.res_id= #{resId}
  92. </if>
  93. <if test="giveQuantity !=null and giveQuantity != ''">
  94. , t.give_quantity= #{giveQuantity}
  95. </if>
  96. where 1=1 <if test="ausId !=null and ausId != ''">
  97. and t.aus_id= #{ausId}
  98. </if>
  99. </update>
  100. <!-- 查询用户仓库数量 add by wuxw 2018-07-03 -->
  101. <select id="queryAllocationUserStorehousesCount" parameterType="Map" resultType="Map">
  102. select count(1) count
  103. from allocation_user_storehouse t
  104. where 1 =1
  105. <if test="resName !=null and resName != ''">
  106. and t.res_name= #{resName}
  107. </if>
  108. <if test="startUserId !=null and startUserId != ''">
  109. and t.start_user_id= #{startUserId}
  110. </if>
  111. <if test="acceptUserId !=null and acceptUserId != ''">
  112. and t.accept_user_id= #{acceptUserId}
  113. </if>
  114. <if test="acceptUserName !=null and acceptUserName != ''">
  115. and t.accept_user_name= #{acceptUserName}
  116. </if>
  117. <if test="startUserName !=null and startUserName != ''">
  118. and t.start_user_name= #{startUserName}
  119. </if>
  120. <if test="ausId !=null and ausId != ''">
  121. and t.aus_id= #{ausId}
  122. </if>
  123. <if test="statusCd !=null and statusCd != ''">
  124. and t.status_cd= #{statusCd}
  125. </if>
  126. <if test="remark !=null and remark != ''">
  127. and t.remark= #{remark}
  128. </if>
  129. <if test="storeId !=null and storeId != ''">
  130. and t.store_id= #{storeId}
  131. </if>
  132. <if test="stock !=null and stock != ''">
  133. and t.stock= #{stock}
  134. </if>
  135. <if test="resId !=null and resId != ''">
  136. and t.res_id= #{resId}
  137. </if>
  138. <if test="giveQuantity !=null and giveQuantity != ''">
  139. and t.give_quantity= #{giveQuantity}
  140. </if>
  141. </select>
  142. </mapper>