MaterialDistributionMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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="com.supervision.materialManagement.mapper.MaterialDistributionMapper">
  6. <resultMap type="MaterialDistribution" id="MaterialDistributionResult">
  7. <result property="id" column="id" />
  8. <result property="barcode" column="barcode" />
  9. <result property="wuPinType" column="wu_pin_type" />
  10. <result property="name" column="name" />
  11. <result property="materialSpecification" column="material_specification" />
  12. <result property="materialXh" column="material_xh" />
  13. <result property="yingJuType" column="ying_ju_type" />
  14. <result property="responsibilityUnit" column="responsibility_unit" />
  15. <result property="personLiable" column="person_liable" />
  16. <result property="putOut" column="put_out" />
  17. <result property="createName" column="create_name" />
  18. <result property="createTime" column="create_time" />
  19. <result property="putOutTime" column="put_out_time" />
  20. <result property="storageLocation" column="storage_location" />
  21. <result property="buyingTime" column="buying_time" />
  22. <result property="price" column="price" />
  23. <result property="remark" column="remark" />
  24. <result property="warehouse" column="warehouse" />
  25. <result property="archivesId" column="archives_id" />
  26. <result property="total" column="total" />
  27. <result property="outUnit" column="out_unit" />
  28. <result property="outPeople" column="out_people" />
  29. <result property="recipient" column="recipient" />
  30. <result property="registrationId" column="registration_id" />
  31. <result property="responsibilityUnitId" column="responsibility_unit_id" />
  32. <result property="personLiableId" column="person_liable_id" />
  33. <result property="createId" column="create_id" />
  34. <result property="outUnitId" column="out_unit_id" />
  35. <result property="recipientId" column="recipient_id" />
  36. <result property="outPeopleId" column="out_people_id" />
  37. </resultMap>
  38. <sql id="selectMaterialDistributionVo">
  39. select id,barcode, wu_pin_type, name, material_specification, material_xh, ying_ju_type, responsibility_unit, person_liable, put_out, create_name, create_time, put_out_time, storage_location, buying_time, price, remark, warehouse, archives_id, total, out_unit, out_people, recipient, registration_id, responsibility_unit_id, person_liable_id, create_id, out_unit_id, recipient_id, out_people_id from material_distribution
  40. </sql>
  41. <select id="selectMaterialDistributionList" parameterType="MaterialDistribution" resultMap="MaterialDistributionResult">
  42. <include refid="selectMaterialDistributionVo"/>
  43. <where>
  44. <if test="wuPinType != null and wuPinType != ''"> and wu_pin_type = #{wuPinType}</if>
  45. <if test="barcode != null and barcode != ''"> and barcode = #{barcode}</if>
  46. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  47. <if test="materialSpecification != null and materialSpecification != ''"> and material_specification = #{materialSpecification}</if>
  48. <if test="materialXh != null and materialXh != ''"> and material_xh = #{materialXh}</if>
  49. <if test="yingJuType != null and yingJuType != ''"> and ying_ju_type = #{yingJuType}</if>
  50. <if test="responsibilityUnit != null and responsibilityUnit != ''"> and responsibility_unit = #{responsibilityUnit}</if>
  51. <if test="personLiable != null and personLiable != ''"> and person_liable = #{personLiable}</if>
  52. <if test="putOut != null "> and put_out = #{putOut}</if>
  53. <if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
  54. <if test="putOutTime != null "> and put_out_time = #{putOutTime}</if>
  55. <if test="storageLocation != null and storageLocation != ''"> and storage_location = #{storageLocation}</if>
  56. <if test="buyingTime != null "> and buying_time = #{buyingTime}</if>
  57. <if test="price != null "> and price = #{price}</if>
  58. <if test="warehouse != null and warehouse != ''"> and warehouse = #{warehouse}</if>
  59. <if test="archivesId != null "> and archives_id = #{archivesId}</if>
  60. <if test="total != null "> and total = #{total}</if>
  61. <if test="outUnit != null and outUnit != ''"> and out_unit = #{outUnit}</if>
  62. <if test="outPeople != null and outPeople != ''"> and out_people = #{outPeople}</if>
  63. <if test="recipient != null and recipient != ''"> and recipient = #{recipient}</if>
  64. <if test="registrationId != null "> and registration_id = #{registrationId}</if>
  65. <if test="responsibilityUnitId != null "> and responsibility_unit_id = #{responsibilityUnitId}</if>
  66. <if test="personLiableId != null "> and person_liable_id = #{personLiableId}</if>
  67. <if test="createId != null "> and create_id = #{createId}</if>
  68. <if test="outUnitId != null "> and out_unit_id = #{outUnitId}</if>
  69. <if test="recipientId != null "> and recipient_id = #{recipientId}</if>
  70. <if test="outPeopleId != null "> and out_people_id = #{outPeopleId}</if>
  71. </where>
  72. order by id desc
  73. </select>
  74. <select id="selectMaterialDistributionById" parameterType="Long" resultMap="MaterialDistributionResult">
  75. <include refid="selectMaterialDistributionVo"/>
  76. where id = #{id}
  77. </select>
  78. <insert id="insertMaterialDistribution" parameterType="MaterialDistribution">
  79. insert into material_distribution
  80. <trim prefix="(" suffix=")" suffixOverrides=",">
  81. <if test="id != null">id,</if>
  82. <if test="barcode != null">barcode,</if>
  83. <if test="wuPinType != null">wu_pin_type,</if>
  84. <if test="name != null">name,</if>
  85. <if test="materialSpecification != null">material_specification,</if>
  86. <if test="materialXh != null">material_xh,</if>
  87. <if test="yingJuType != null">ying_ju_type,</if>
  88. <if test="responsibilityUnit != null">responsibility_unit,</if>
  89. <if test="personLiable != null">person_liable,</if>
  90. <if test="putOut != null">put_out,</if>
  91. <if test="createName != null">create_name,</if>
  92. <if test="createTime != null">create_time,</if>
  93. <if test="putOutTime != null">put_out_time,</if>
  94. <if test="storageLocation != null">storage_location,</if>
  95. <if test="buyingTime != null">buying_time,</if>
  96. <if test="price != null">price,</if>
  97. <if test="remark != null">remark,</if>
  98. <if test="warehouse != null">warehouse,</if>
  99. <if test="archivesId != null">archives_id,</if>
  100. <if test="total != null">total,</if>
  101. <if test="outUnit != null">out_unit,</if>
  102. <if test="outPeople != null">out_people,</if>
  103. <if test="recipient != null">recipient,</if>
  104. <if test="registrationId != null">registration_id,</if>
  105. <if test="responsibilityUnitId != null">responsibility_unit_id,</if>
  106. <if test="personLiableId != null">person_liable_id,</if>
  107. <if test="createId != null">create_id,</if>
  108. <if test="outUnitId != null">out_unit_id,</if>
  109. <if test="recipientId != null">recipient_id,</if>
  110. <if test="outPeopleId != null">out_people_id,</if>
  111. </trim>
  112. <trim prefix="values (" suffix=")" suffixOverrides=",">
  113. <if test="id != null">#{id},</if>
  114. <if test="barcode != null">#{barcode},</if>
  115. <if test="wuPinType != null">#{wuPinType},</if>
  116. <if test="name != null">#{name},</if>
  117. <if test="materialSpecification != null">#{materialSpecification},</if>
  118. <if test="materialXh != null">#{materialXh},</if>
  119. <if test="yingJuType != null">#{yingJuType},</if>
  120. <if test="responsibilityUnit != null">#{responsibilityUnit},</if>
  121. <if test="personLiable != null">#{personLiable},</if>
  122. <if test="putOut != null">#{putOut},</if>
  123. <if test="createName != null">#{createName},</if>
  124. <if test="createTime != null">#{createTime},</if>
  125. <if test="putOutTime != null">#{putOutTime},</if>
  126. <if test="storageLocation != null">#{storageLocation},</if>
  127. <if test="buyingTime != null">#{buyingTime},</if>
  128. <if test="price != null">#{price},</if>
  129. <if test="remark != null">#{remark},</if>
  130. <if test="warehouse != null">#{warehouse},</if>
  131. <if test="archivesId != null">#{archivesId},</if>
  132. <if test="total != null">#{total},</if>
  133. <if test="outUnit != null">#{outUnit},</if>
  134. <if test="outPeople != null">#{outPeople},</if>
  135. <if test="recipient != null">#{recipient},</if>
  136. <if test="registrationId != null">#{registrationId},</if>
  137. <if test="responsibilityUnitId != null">#{responsibilityUnitId},</if>
  138. <if test="personLiableId != null">#{personLiableId},</if>
  139. <if test="createId != null">#{createId},</if>
  140. <if test="outUnitId != null">#{outUnitId},</if>
  141. <if test="recipientId != null">#{recipientId},</if>
  142. <if test="outPeopleId != null">#{outPeopleId},</if>
  143. </trim>
  144. </insert>
  145. <update id="updateMaterialDistribution" parameterType="MaterialDistribution">
  146. update material_distribution
  147. <trim prefix="SET" suffixOverrides=",">
  148. <if test="wuPinType != null">wu_pin_type = #{wuPinType},</if>
  149. <if test="name != null">name = #{name},</if>
  150. <if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
  151. <if test="materialXh != null">material_xh = #{materialXh},</if>
  152. <if test="yingJuType != null">ying_ju_type = #{yingJuType},</if>
  153. <if test="responsibilityUnit != null">responsibility_unit = #{responsibilityUnit},</if>
  154. <if test="personLiable != null">person_liable = #{personLiable},</if>
  155. <if test="putOut != null">put_out = #{putOut},</if>
  156. <if test="createName != null">create_name = #{createName},</if>
  157. <if test="createTime != null">create_time = #{createTime},</if>
  158. <if test="putOutTime != null">put_out_time = #{putOutTime},</if>
  159. <if test="storageLocation != null">storage_location = #{storageLocation},</if>
  160. <if test="buyingTime != null">buying_time = #{buyingTime},</if>
  161. <if test="price != null">price = #{price},</if>
  162. <if test="remark != null">remark = #{remark},</if>
  163. <if test="warehouse != null">warehouse = #{warehouse},</if>
  164. <if test="archivesId != null">archives_id = #{archivesId},</if>
  165. <if test="total != null">total = #{total},</if>
  166. <if test="outUnit != null">out_unit = #{outUnit},</if>
  167. <if test="outPeople != null">out_people = #{outPeople},</if>
  168. <if test="recipient != null">recipient = #{recipient},</if>
  169. <if test="registrationId != null">registration_id = #{registrationId},</if>
  170. <if test="responsibilityUnitId != null">responsibility_unit_id = #{responsibilityUnitId},</if>
  171. <if test="personLiableId != null">person_liable_id = #{personLiableId},</if>
  172. <if test="createId != null">create_id = #{createId},</if>
  173. <if test="outUnitId != null">out_unit_id = #{outUnitId},</if>
  174. <if test="recipientId != null">recipient_id = #{recipientId},</if>
  175. <if test="outPeopleId != null">out_people_id = #{outPeopleId},</if>
  176. </trim>
  177. where id = #{id}
  178. </update>
  179. <delete id="deleteMaterialDistributionById" parameterType="Long">
  180. delete from material_distribution where id = #{id}
  181. </delete>
  182. <delete id="deleteMaterialDistributionByIds" parameterType="String">
  183. delete from material_distribution where id in
  184. <foreach item="id" collection="array" open="(" separator="," close=")">
  185. #{id}
  186. </foreach>
  187. </delete>
  188. </mapper>