StorehouseServiceDaoImplMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="storehouseServiceDaoImpl">
  6. <!-- 保存仓库信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessStorehouseInfo" parameterType="Map">
  8. insert into business_storehouse(
  9. sh_desc,sh_type,sh_obj_id,operate,sh_id,sh_name,b_id,store_id
  10. ) values (
  11. #{shDesc},#{shType},#{shObjId},#{operate},#{shId},#{shName},#{bId},#{storeId}
  12. )
  13. </insert>
  14. <!-- 查询仓库信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessStorehouseInfo" parameterType="Map" resultType="Map">
  16. select t.sh_desc,t.sh_desc shDesc,t.sh_type,t.sh_type shType,t.sh_obj_id,t.sh_obj_id shObjId,t.operate,t.sh_id,t.sh_id shId,t.sh_name,t.sh_name shName,t.b_id,t.b_id bId,t.store_id,t.store_id storeId
  17. from business_storehouse t
  18. where 1 =1
  19. <if test="shDesc !=null and shDesc != ''">
  20. and t.sh_desc= #{shDesc}
  21. </if>
  22. <if test="shType !=null and shType != ''">
  23. and t.sh_type= #{shType}
  24. </if>
  25. <if test="shObjId !=null and shObjId != ''">
  26. and t.sh_obj_id= #{shObjId}
  27. </if>
  28. <if test="operate !=null and operate != ''">
  29. and t.operate= #{operate}
  30. </if>
  31. <if test="shId !=null and shId != ''">
  32. and t.sh_id= #{shId}
  33. </if>
  34. <if test="shName !=null and shName != ''">
  35. and t.sh_name= #{shName}
  36. </if>
  37. <if test="bId !=null and bId != ''">
  38. and t.b_id= #{bId}
  39. </if>
  40. <if test="storeId !=null and storeId != ''">
  41. and t.store_id= #{storeId}
  42. </if>
  43. </select>
  44. <!-- 保存仓库信息至 instance表中 add by wuxw 2018-07-03 -->
  45. <insert id="saveStorehouseInfoInstance" parameterType="Map">
  46. insert into storehouse(
  47. sh_desc,sh_type,sh_obj_id,sh_id,status_cd,sh_name,b_id,store_id
  48. ) select t.sh_desc,t.sh_type,t.sh_obj_id,t.sh_id,'0',t.sh_name,t.b_id,t.store_id from business_storehouse t where 1=1
  49. <if test="shDesc !=null and shDesc != ''">
  50. and t.sh_desc= #{shDesc}
  51. </if>
  52. <if test="shType !=null and shType != ''">
  53. and t.sh_type= #{shType}
  54. </if>
  55. <if test="shObjId !=null and shObjId != ''">
  56. and t.sh_obj_id= #{shObjId}
  57. </if>
  58. and t.operate= 'ADD'
  59. <if test="shId !=null and shId != ''">
  60. and t.sh_id= #{shId}
  61. </if>
  62. <if test="shName !=null and shName != ''">
  63. and t.sh_name= #{shName}
  64. </if>
  65. <if test="bId !=null and bId != ''">
  66. and t.b_id= #{bId}
  67. </if>
  68. <if test="storeId !=null and storeId != ''">
  69. and t.store_id= #{storeId}
  70. </if>
  71. </insert>
  72. <!-- 查询仓库信息 add by wuxw 2018-07-03 -->
  73. <select id="getStorehouseInfo" parameterType="Map" resultType="Map">
  74. select t.sh_desc,t.sh_desc shDesc,t.sh_type,t.sh_type shType,t.sh_obj_id,t.sh_obj_id shObjId,t.sh_id,t.sh_id shId,t.status_cd,t.status_cd statusCd,t.sh_name,t.sh_name shName,t.b_id,t.b_id bId,t.store_id,t.store_id storeId
  75. from storehouse t
  76. where 1 =1
  77. <if test="shDesc !=null and shDesc != ''">
  78. and t.sh_desc= #{shDesc}
  79. </if>
  80. <if test="shType !=null and shType != ''">
  81. and t.sh_type= #{shType}
  82. </if>
  83. <if test="shObjId !=null and shObjId != ''">
  84. and t.sh_obj_id= #{shObjId}
  85. </if>
  86. <if test="shId !=null and shId != ''">
  87. and t.sh_id= #{shId}
  88. </if>
  89. <if test="statusCd !=null and statusCd != ''">
  90. and t.status_cd= #{statusCd}
  91. </if>
  92. <if test="shName !=null and shName != ''">
  93. and t.sh_name= #{shName}
  94. </if>
  95. <if test="bId !=null and bId != ''">
  96. and t.b_id= #{bId}
  97. </if>
  98. <if test="storeId !=null and storeId != ''">
  99. and t.store_id= #{storeId}
  100. </if>
  101. order by t.create_time desc
  102. <if test="page != -1 and page != null ">
  103. limit #{page}, #{row}
  104. </if>
  105. </select>
  106. <!-- 修改仓库信息 add by wuxw 2018-07-03 -->
  107. <update id="updateStorehouseInfoInstance" parameterType="Map">
  108. update storehouse t set t.status_cd = #{statusCd}
  109. <if test="newBId != null and newBId != ''">
  110. ,t.b_id = #{newBId}
  111. </if>
  112. <if test="shDesc !=null and shDesc != ''">
  113. , t.sh_desc= #{shDesc}
  114. </if>
  115. <if test="shType !=null and shType != ''">
  116. , t.sh_type= #{shType}
  117. </if>
  118. <if test="shObjId !=null and shObjId != ''">
  119. , t.sh_obj_id= #{shObjId}
  120. </if>
  121. <if test="shName !=null and shName != ''">
  122. , t.sh_name= #{shName}
  123. </if>
  124. <if test="storeId !=null and storeId != ''">
  125. , t.store_id= #{storeId}
  126. </if>
  127. where 1=1 <if test="shId !=null and shId != ''">
  128. and t.sh_id= #{shId}
  129. </if>
  130. <if test="bId !=null and bId != ''">
  131. and t.b_id= #{bId}
  132. </if>
  133. </update>
  134. <!-- 查询仓库数量 add by wuxw 2018-07-03 -->
  135. <select id="queryStorehousesCount" parameterType="Map" resultType="Map">
  136. select count(1) count
  137. from storehouse t
  138. where 1 =1
  139. <if test="shDesc !=null and shDesc != ''">
  140. and t.sh_desc= #{shDesc}
  141. </if>
  142. <if test="shType !=null and shType != ''">
  143. and t.sh_type= #{shType}
  144. </if>
  145. <if test="shObjId !=null and shObjId != ''">
  146. and t.sh_obj_id= #{shObjId}
  147. </if>
  148. <if test="shId !=null and shId != ''">
  149. and t.sh_id= #{shId}
  150. </if>
  151. <if test="statusCd !=null and statusCd != ''">
  152. and t.status_cd= #{statusCd}
  153. </if>
  154. <if test="shName !=null and shName != ''">
  155. and t.sh_name= #{shName}
  156. </if>
  157. <if test="bId !=null and bId != ''">
  158. and t.b_id= #{bId}
  159. </if>
  160. <if test="storeId !=null and storeId != ''">
  161. and t.store_id= #{storeId}
  162. </if>
  163. </select>
  164. </mapper>