MaterialRetentionLogMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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.zkqy.amichi.mapper.MaterialRetentionLogMapper">
  6. <resultMap type="com.zkqy.amichi.domain.MaterialRetentionLog" id="MaterialRetentionLogResult">
  7. <result property="id" column="id" />
  8. <result property="materialCode" column="material_code" />
  9. <result property="materialName" column="material_name" />
  10. <result property="specification" column="specification" />
  11. <result property="model" column="model" />
  12. <result property="unit" column="unit" />
  13. <result property="actualQuantityIssued" column="actual_quantity_issued" />
  14. <result property="deliveryWarehouse" column="delivery_warehouse" />
  15. <result property="ckNumber" column="ck_number" />
  16. <result property="documentRemarks" column="document_remarks" />
  17. <result property="documentType" column="document_type" />
  18. <result property="inventoryOrganization" column="inventory_organization" />
  19. <result property="receivingTissue" column="receiving_tissue" />
  20. <result property="inventoryDirection" column="inventory_direction" />
  21. <result property="dateOfDelivery" column="date_of_delivery" />
  22. <result property="materialsRequisitionDepartment" column="materials_requisition_department" />
  23. <result property="materialTaker" column="material_taker" />
  24. <result property="businessType" column="business_type" />
  25. <result property="ownerType" column="owner_type" />
  26. <result property="owner" column="owner" />
  27. <result property="documentStatus" column="document_status" />
  28. <result property="detailedRemarks" column="detailed_remarks" />
  29. <result property="createById" column="create_by_id" />
  30. <result property="createBy" column="create_by" />
  31. <result property="createTime" column="create_time" />
  32. <result property="updateById" column="update_by_id" />
  33. <result property="updateBy" column="update_by" />
  34. <result property="updateTime" column="update_time" />
  35. <result property="delFlag" column="del_flag" />
  36. <result property="productCode" column="product_code" />
  37. <result property="productName" column="product_name" />
  38. <result property="productModel" column="product_model" />
  39. <result property="productSpecification" column="product_specification" />
  40. <result property="materialType" column="material_type" />
  41. <result property="process" column="process" />
  42. <result property="orderNumber" column="order_number" />
  43. <result property="productionOrderNumber" column="production_order_number" />
  44. </resultMap>
  45. <sql id="selectMaterialRetentionLogVo">
  46. select id, material_code, material_name, specification, model, unit,
  47. CASE
  48. WHEN CAST(actual_quantity_issued AS CHAR) LIKE '%.0000' THEN FLOOR(actual_quantity_issued)
  49. ELSE actual_quantity_issued
  50. END AS actual_quantity_issued,delivery_warehouse, ck_number, document_remarks,
  51. document_type, inventory_organization, receiving_tissue, inventory_direction, date_of_delivery, materials_requisition_department,
  52. material_taker, business_type, owner_type, owner, document_status, detailed_remarks, create_by_id, create_by, create_time,
  53. update_by_id, update_by, update_time, del_flag,product_code,product_name,product_model,product_specification,material_type,process,order_number,production_order_number from fjqydb.material_retention_log
  54. </sql>
  55. <select id="selectMaterialRetentionLogList" parameterType="com.zkqy.amichi.domain.MaterialRetentionLog" resultMap="MaterialRetentionLogResult">
  56. <include refid="selectMaterialRetentionLogVo"/>
  57. <where>
  58. <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
  59. <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
  60. <if test="specification != null and specification != ''"> and specification = #{specification}</if>
  61. <if test="model != null and model != ''"> and model = #{model}</if>
  62. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  63. <if test="actualQuantityIssued != null and actualQuantityIssued != ''"> and actual_quantity_issued = #{actualQuantityIssued}</if>
  64. <if test="deliveryWarehouse != null and deliveryWarehouse != ''"> and delivery_warehouse = #{deliveryWarehouse}</if>
  65. <if test="ckNumber != null and ckNumber != ''"> and ck_number = #{ckNumber}</if>
  66. <if test="documentRemarks != null and documentRemarks != ''"> and document_remarks = #{documentRemarks}</if>
  67. <if test="documentType != null and documentType != ''"> and document_type = #{documentType}</if>
  68. <if test="inventoryOrganization != null and inventoryOrganization != ''"> and inventory_organization = #{inventoryOrganization}</if>
  69. <if test="receivingTissue != null and receivingTissue != ''"> and receiving_tissue = #{receivingTissue}</if>
  70. <if test="inventoryDirection != null and inventoryDirection != ''"> and inventory_direction = #{inventoryDirection}</if>
  71. <if test="dateOfDelivery != null and dateOfDelivery != ''"> and date_of_delivery = #{dateOfDelivery}</if>
  72. <if test="materialsRequisitionDepartment != null and materialsRequisitionDepartment != ''"> and materials_requisition_department = #{materialsRequisitionDepartment}</if>
  73. <if test="materialTaker != null and materialTaker != ''"> and material_taker = #{materialTaker}</if>
  74. <if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
  75. <if test="ownerType != null and ownerType != ''"> and owner_type = #{ownerType}</if>
  76. <if test="owner != null and owner != ''"> and owner = #{owner}</if>
  77. <if test="documentStatus != null and documentStatus != ''"> and document_status = #{documentStatus}</if>
  78. <if test="detailedRemarks != null and detailedRemarks != ''"> and detailed_remarks = #{detailedRemarks}</if>
  79. <if test="createById != null "> and create_by_id = #{createById}</if>
  80. <if test="updateById != null "> and update_by_id = #{updateById}</if>
  81. <if test="productCode != null "> and product_code = #{productCode}</if>
  82. <if test="productName != null "> and product_name = #{productName}</if>
  83. <if test="process!=null">and process=#{process}</if>
  84. <if test="productModel != null "> and product_model = #{productModel}</if>
  85. <if test="productSpecification != null "> and product_specification = #{productSpecification}</if>
  86. <if test="orderNumber!=null">and order_number = #{orderNumber}</if>
  87. <if test="productionOrderNumber!=null">and production_order_number =#{productionOrderNumber}</if>
  88. <if test="createTimeString != null and createTimeString[0] != null and createTimeString[0] != ''">
  89. and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{createTimeString[0]}
  90. </if>
  91. <if test="createTimeString != null and createTimeString[1] != null and createTimeString[1] != ''">
  92. and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{createTimeString[1]}
  93. </if>
  94. </where>
  95. order by create_time desc
  96. </select>
  97. <sql id="selectMaterialRetentionLogVo2">
  98. SELECT
  99. mrl.id,
  100. mrl.material_code,
  101. mrl.material_name,
  102. mrl.specification,
  103. mrl.model,
  104. mrl.unit,
  105. CASE
  106. WHEN CAST( mrl.actual_quantity_issued AS CHAR ) LIKE '%.0000' THEN
  107. FLOOR( mrl.actual_quantity_issued ) ELSE mrl.actual_quantity_issued
  108. END AS actual_quantity_issued,
  109. mrl.delivery_warehouse,
  110. mrl.ck_number,
  111. mrl.document_remarks,
  112. mrl.document_type,
  113. mrl.inventory_organization,
  114. mrl.receiving_tissue,
  115. mrl.inventory_direction,
  116. mrl.date_of_delivery,
  117. mrl.materials_requisition_department,
  118. mrl.material_taker,
  119. mrl.business_type,
  120. mrl.owner_type,
  121. mrl.OWNER,
  122. mrl.document_status,
  123. mrl.detailed_remarks,
  124. mrl.create_by_id,
  125. mrl.create_by,
  126. mrl.create_time,
  127. mrl.update_by_id,
  128. mrl.update_by,
  129. mrl.update_time,
  130. mrl.del_flag,
  131. mrl.product_code,
  132. mrl.product_name,
  133. mrl.product_model,
  134. mrl.product_specification,
  135. mrl.material_type,
  136. mrl.process,
  137. mrl.order_number,
  138. mrl.production_order_number
  139. FROM
  140. fjqydb.material_retention_log AS mrl
  141. LEFT JOIN fjqydb.plan_task_details AS ptd ON ptd.demand_document = mrl.production_order_number
  142. </sql>
  143. <select id="selectMaterialRetentionLogListNoProduction" parameterType="com.zkqy.amichi.domain.MaterialRetentionLog" resultMap="MaterialRetentionLogResult">
  144. <include refid="selectMaterialRetentionLogVo2"/>
  145. <where>
  146. <if test="materialCode != null and materialCode != ''"> and ptd.material_code = #{materialCode}</if>
  147. <if test="materialName != null and materialName != ''"> and ptd.material_name like concat('%', #{materialName}, '%')</if>
  148. <if test="specification != null and specification != ''"> and ptd.specification = #{specification}</if>
  149. <if test="model != null and model != ''"> and ptd.model = #{model}</if>
  150. <if test="unit != null and unit != ''"> and ptd.unit = #{unit}</if>
  151. <if test="actualQuantityIssued != null and actualQuantityIssued != ''"> and ptd.actual_quantity_issued = #{actualQuantityIssued}</if>
  152. <if test="deliveryWarehouse != null and deliveryWarehouse != ''"> and ptd.delivery_warehouse = #{deliveryWarehouse}</if>
  153. <if test="ckNumber != null and ckNumber != ''"> and ptd.ck_number = #{ckNumber}</if>
  154. <if test="documentRemarks != null and documentRemarks != ''"> and ptd.document_remarks = #{documentRemarks}</if>
  155. <if test="documentType != null and documentType != ''"> and ptd.document_type = #{documentType}</if>
  156. <if test="inventoryOrganization != null and inventoryOrganization != ''"> and ptd.inventory_organization = #{inventoryOrganization}</if>
  157. <if test="receivingTissue != null and receivingTissue != ''"> and ptd.receiving_tissue = #{receivingTissue}</if>
  158. <if test="inventoryDirection != null and inventoryDirection != ''"> and ptd.inventory_direction = #{inventoryDirection}</if>
  159. <if test="dateOfDelivery != null and dateOfDelivery != ''"> and ptd.date_of_delivery = #{dateOfDelivery}</if>
  160. <if test="materialsRequisitionDepartment != null and materialsRequisitionDepartment != ''"> and ptd.materials_requisition_department = #{materialsRequisitionDepartment}</if>
  161. <if test="materialTaker != null and materialTaker != ''"> and ptd.material_taker = #{materialTaker}</if>
  162. <if test="businessType != null and businessType != ''"> and ptd.business_type = #{businessType}</if>
  163. <if test="ownerType != null and ownerType != ''"> and ptd.owner_type = #{ownerType}</if>
  164. <if test="owner != null and owner != ''"> and ptd.owner = #{owner}</if>
  165. <if test="documentStatus != null and documentStatus != ''"> and ptd.document_status = #{documentStatus}</if>
  166. <if test="detailedRemarks != null and detailedRemarks != ''"> and ptd.detailed_remarks = #{detailedRemarks}</if>
  167. <if test="createById != null "> and ptd.create_by_id = #{createById}</if>
  168. <if test="updateById != null "> and ptd.update_by_id = #{updateById}</if>
  169. <if test="productCode != null "> and ptd.product_code = #{productCode}</if>
  170. <if test="productName != null "> and ptd.product_name = #{productName}</if>
  171. <if test="productModel != null "> and ptd.product_model = #{productModel}</if>
  172. <if test="productSpecification != null "> and ptd.product_specification = #{productSpecification}</if>
  173. <if test="orderNumber!=null">and ptd.order_number = #{orderNumber}</if>
  174. <if test="productionOrderNumber!=null">and ptd.production_order_number =#{productionOrderNumber}</if>
  175. and ptd.status !=3
  176. </where>
  177. </select>
  178. <select id="selectMaterialRetentionLogById" parameterType="Long" resultMap="MaterialRetentionLogResult">
  179. <include refid="selectMaterialRetentionLogVo"/>
  180. where id = #{id}
  181. </select>
  182. <insert id="insertMaterialRetentionLog" parameterType="com.zkqy.amichi.domain.MaterialRetentionLog" useGeneratedKeys="true" keyProperty="id">
  183. insert into fjqydb.material_retention_log
  184. <trim prefix="(" suffix=")" suffixOverrides=",">
  185. <if test="materialCode != null and materialCode != ''">material_code,</if>
  186. <if test="materialName != null and materialName != ''">material_name,</if>
  187. <if test="specification != null">specification,</if>
  188. <if test="model != null">model,</if>
  189. <if test="unit != null">unit,</if>
  190. <if test="actualQuantityIssued != null">actual_quantity_issued,</if>
  191. <if test="deliveryWarehouse != null">delivery_warehouse,</if>
  192. <if test="ckNumber != null">ck_number,</if>
  193. <if test="documentRemarks != null">document_remarks,</if>
  194. <if test="documentType != null">document_type,</if>
  195. <if test="inventoryOrganization != null">inventory_organization,</if>
  196. <if test="receivingTissue != null">receiving_tissue,</if>
  197. <if test="inventoryDirection != null">inventory_direction,</if>
  198. <if test="dateOfDelivery != null">date_of_delivery,</if>
  199. <if test="materialsRequisitionDepartment != null">materials_requisition_department,</if>
  200. <if test="materialTaker != null">material_taker,</if>
  201. <if test="businessType != null">business_type,</if>
  202. <if test="ownerType != null">owner_type,</if>
  203. <if test="owner != null">owner,</if>
  204. <if test="documentStatus != null">document_status,</if>
  205. <if test="detailedRemarks != null">detailed_remarks,</if>
  206. <if test="createById != null">create_by_id,</if>
  207. <if test="createBy != null">create_by,</if>
  208. <if test="createTime != null">create_time,</if>
  209. <if test="updateById != null">update_by_id,</if>
  210. <if test="updateBy != null">update_by,</if>
  211. <if test="updateTime != null">update_time,</if>
  212. <if test="delFlag != null">del_flag,</if>
  213. <if test="productCode != null ">product_code,</if>
  214. <if test="productName != null ">product_name,</if>
  215. <if test="prouuctModel != null ">prouuct_model,</if>
  216. <if test="productSpecification != null ">product_specification,</if>
  217. <if test="item.orderNumber!=null">order_number,</if>
  218. <if test="item.productionOrderNumber!=null">production_order_number,</if>
  219. </trim>
  220. <trim prefix="values (" suffix=")" suffixOverrides=",">
  221. <if test="materialCode != null and materialCode != ''">#{materialCode},</if>
  222. <if test="materialName != null and materialName != ''">#{materialName},</if>
  223. <if test="specification != null">#{specification},</if>
  224. <if test="model != null">#{model},</if>
  225. <if test="unit != null">#{unit},</if>
  226. <if test="actualQuantityIssued != null">#{actualQuantityIssued},</if>
  227. <if test="deliveryWarehouse != null">#{deliveryWarehouse},</if>
  228. <if test="ckNumber != null">#{ckNumber},</if>
  229. <if test="documentRemarks != null">#{documentRemarks},</if>
  230. <if test="documentType != null">#{documentType},</if>
  231. <if test="inventoryOrganization != null">#{inventoryOrganization},</if>
  232. <if test="receivingTissue != null">#{receivingTissue},</if>
  233. <if test="inventoryDirection != null">#{inventoryDirection},</if>
  234. <if test="dateOfDelivery != null">#{dateOfDelivery},</if>
  235. <if test="materialsRequisitionDepartment != null">#{materialsRequisitionDepartment},</if>
  236. <if test="materialTaker != null">#{materialTaker},</if>
  237. <if test="businessType != null">#{businessType},</if>
  238. <if test="ownerType != null">#{ownerType},</if>
  239. <if test="owner != null">#{owner},</if>
  240. <if test="documentStatus != null">#{documentStatus},</if>
  241. <if test="detailedRemarks != null">#{detailedRemarks},</if>
  242. <if test="createById != null">#{createById},</if>
  243. <if test="createBy != null">#{createBy},</if>
  244. <if test="createTime != null">#{createTime},</if>
  245. <if test="updateById != null">#{updateById},</if>
  246. <if test="updateBy != null">#{updateBy},</if>
  247. <if test="updateTime != null">#{updateTime},</if>
  248. <if test="delFlag != null">#{delFlag},</if>
  249. <if test="productCode != null ">#{productCode},</if>
  250. <if test="productName != null ">#{productName},</if>
  251. <if test="prouuctModel != null ">#{prouuctModel},</if>
  252. <if test="productSpecification != null ">#{productSpecification}</if>
  253. <if test="item.orderNumber!=null">#{orderNumber},</if>
  254. <if test="item.productionOrderNumber!=null">#{productionOrderNumber},</if>
  255. </trim>
  256. </insert>
  257. <insert id="insertMaterialRetentionLogBatch" parameterType="com.zkqy.amichi.jd.domain.MaterialRetentionLogVo" useGeneratedKeys="true" keyProperty="id">
  258. <foreach collection ="list" item="item" separator =";">
  259. INSERT INTO fjqydb.material_retention_log
  260. <trim prefix="(" suffix=")" suffixOverrides=",">
  261. <if test="item.materialCode != null and item.materialCode != ''">material_code,</if>
  262. <if test="item.materialName != null and item.materialName != ''">material_name,</if>
  263. <if test="item.specification != null">specification,</if>
  264. <if test="item.model != null">model,</if>
  265. <if test="item.unit != null">unit,</if>
  266. <if test="item.actualQuantityIssued != null">actual_quantity_issued,</if>
  267. <if test="item.deliveryWarehouse != null">delivery_warehouse,</if>
  268. <if test="item.ckNumber != null">ck_number,</if>
  269. <if test="item.documentRemarks != null">document_remarks,</if>
  270. <if test="item.documentType != null">document_type,</if>
  271. <if test="item.inventoryOrganization != null">inventory_organization,</if>
  272. <if test="item.receivingTissue != null">receiving_tissue,</if>
  273. <if test="item.inventoryDirection != null">inventory_direction,</if>
  274. <if test="item.dateOfDelivery != null">date_of_delivery,</if>
  275. <if test="item.materialsRequisitionDepartment != null">materials_requisition_department,</if>
  276. <if test="item.materialTaker != null">material_taker,</if>
  277. <if test="item.businessType != null">business_type,</if>
  278. <if test="item.ownerType != null">owner_type,</if>
  279. <if test="item.owner != null">owner,</if>
  280. <if test="item.documentStatus != null">document_status,</if>
  281. <if test="item.detailedRemarks != null">detailed_remarks,</if>
  282. <if test="item.createById != null">create_by_id,</if>
  283. <if test="item.createBy!= null">create_by,</if>
  284. <if test="item.createTime != null">create_time,</if>
  285. <if test="item.updateById != null">update_by_id,</if>
  286. <if test="item.updateBy != null">update_by,</if>
  287. <if test="item.updateTime != null">update_time,</if>
  288. <if test="item.delFlag != null">del_flag,</if>
  289. <if test="item.productCode != null ">product_code,</if>
  290. <if test="item.productName != null ">product_name,</if>
  291. <if test="item.productModel != null ">product_model,</if>
  292. <if test="item.productSpecification != null ">product_specification,</if>
  293. <if test="item.materialType!=null">material_type,</if>
  294. <if test="item.flowSequenceNumber!=null">flow_sequence_number,</if>
  295. <if test="item.process!=null">process,</if>
  296. <if test="item.orderNumber!=null">order_number,</if>
  297. <if test="item.productionOrderNumber!=null">production_order_number,</if>
  298. <if test="item.mesprocess!=null">mesprocess</if>
  299. </trim>
  300. VALUES
  301. <trim prefix="(" suffix=")" suffixOverrides=",">
  302. <if test="item.materialCode != null and item.materialCode != ''">#{item.materialCode},</if>
  303. <if test="item.materialName != null and item.materialName != ''">#{item.materialName},</if>
  304. <if test="item.specification != null">#{item.specification},</if>
  305. <if test="item.model != null">#{item.model},</if>
  306. <if test="item.unit != null">#{item.unit},</if>
  307. <if test="item.actualQuantityIssued != null">#{item.actualQuantityIssued},</if>
  308. <if test="item.deliveryWarehouse != null">#{item.deliveryWarehouse},</if>
  309. <if test="item.ckNumber != null">#{item.ckNumber},</if>
  310. <if test="item.documentRemarks != null">#{item.documentRemarks},</if>
  311. <if test="item.documentType != null">#{item.documentType},</if>
  312. <if test="item.inventoryOrganization != null">#{item.inventoryOrganization},</if>
  313. <if test="item.receivingTissue != null">#{item.receivingTissue},</if>
  314. <if test="item.inventoryDirection != null">#{item.inventoryDirection},</if>
  315. <if test="item.dateOfDelivery != null">#{item.dateOfDelivery},</if>
  316. <if test="item.materialsRequisitionDepartment != null">#{item.materialsRequisitionDepartment},</if>
  317. <if test="item.materialTaker != null">#{item.materialTaker},</if>
  318. <if test="item.businessType != null">#{item.businessType},</if>
  319. <if test="item.ownerType != null">#{item.ownerType},</if>
  320. <if test="item.owner != null">#{item.owner},</if>
  321. <if test="item.documentStatus != null">#{item.documentStatus},</if>
  322. <if test="item.detailedRemarks != null">#{item.detailedRemarks},</if>
  323. <if test="item.createById != null">#{item.createById},</if>
  324. <if test="item.createBy != null">#{item.createBy},</if>
  325. <if test="item.createTime != null">#{item.createTime},</if>
  326. <if test="item.updateById != null">#{item.updateById},</if>
  327. <if test="item.updateBy != null">#{item.updateBy},</if>
  328. <if test="item.updateTime != null">#{item.updateTime},</if>
  329. <if test="item.delFlag != null">#{item.delFlag},</if>
  330. <if test="item.productCode != null ">#{item.productCode},</if>
  331. <if test="item.productName != null ">#{item.productName},</if>
  332. <if test="item.productModel != null ">#{item.productModel},</if>
  333. <if test="item.productSpecification != null ">#{item.productSpecification},</if>
  334. <if test="item.materialType!=null">#{item.materialType},</if>
  335. <if test="item.flowSequenceNumber!=null">#{item.flowSequenceNumber},</if>
  336. <if test="item.process!=null">#{item.process},</if>
  337. <if test="item.orderNumber!=null">#{item.orderNumber},</if>
  338. <if test="item.productionOrderNumber!=null">#{item.productionOrderNumber},</if>
  339. <if test="item.mesprocess!=null">#{item.mesprocess},</if>
  340. </trim>
  341. </foreach>
  342. </insert>
  343. <update id="updateMaterialRetentionLog" parameterType="com.zkqy.amichi.domain.MaterialRetentionLog">
  344. update fjqydb.material_retention_log
  345. <trim prefix="SET" suffixOverrides=",">
  346. <if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
  347. <if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
  348. <if test="specification != null">specification = #{specification},</if>
  349. <if test="model != null">model = #{model},</if>
  350. <if test="unit != null">unit = #{unit},</if>
  351. <if test="actualQuantityIssued != null">actual_quantity_issued = #{actualQuantityIssued},</if>
  352. <if test="deliveryWarehouse != null">delivery_warehouse = #{deliveryWarehouse},</if>
  353. <if test="ckNumber != null">ck_number = #{ckNumber},</if>
  354. <if test="documentRemarks != null">document_remarks = #{documentRemarks},</if>
  355. <if test="documentType != null">document_type = #{documentType},</if>
  356. <if test="inventoryOrganization != null">inventory_organization = #{inventoryOrganization},</if>
  357. <if test="receivingTissue != null">receiving_tissue = #{receivingTissue},</if>
  358. <if test="inventoryDirection != null">inventory_direction = #{inventoryDirection},</if>
  359. <if test="dateOfDelivery != null">date_of_delivery = #{dateOfDelivery},</if>
  360. <if test="materialsRequisitionDepartment != null">materials_requisition_department = #{materialsRequisitionDepartment},</if>
  361. <if test="materialTaker != null">material_taker = #{materialTaker},</if>
  362. <if test="businessType != null">business_type = #{businessType},</if>
  363. <if test="ownerType != null">owner_type = #{ownerType},</if>
  364. <if test="owner != null">owner = #{owner},</if>
  365. <if test="documentStatus != null">document_status = #{documentStatus},</if>
  366. <if test="detailedRemarks != null">detailed_remarks = #{detailedRemarks},</if>
  367. <if test="createById != null">create_by_id = #{createById},</if>
  368. <if test="createBy != null">create_by = #{createBy},</if>
  369. <if test="createTime != null">create_time = #{createTime},</if>
  370. <if test="updateById != null">update_by_id = #{updateById},</if>
  371. <if test="updateBy != null">update_by = #{updateBy},</if>
  372. <if test="updateTime != null">update_time = #{updateTime},</if>
  373. <if test="delFlag != null">del_flag = #{delFlag},</if>
  374. <if test="productCode != null ">product_code = #{productCode}</if>
  375. <if test="productName != null ">product_name = #{productName}</if>
  376. <if test="productModel != null ">product_model = #{productModel}</if>
  377. <if test="productSpecification != null ">product_specification = #{productSpecification}</if>
  378. </trim>
  379. where id = #{id}
  380. </update>
  381. <delete id="deleteMaterialRetentionLogById" parameterType="Long">
  382. delete from fjqydb.material_retention_log where id = #{id}
  383. </delete>
  384. <delete id="deleteMaterialRetentionLogByIds" parameterType="String">
  385. delete from fjqydb.material_retention_log where id in
  386. <foreach item="id" collection="array" open="(" separator="," close=")">
  387. #{id}
  388. </foreach>
  389. </delete>
  390. </mapper>