|
@@ -0,0 +1,296 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.zkqy.amichi.mapper.MaterialRetentionLogMapper">
|
|
|
+ <resultMap type="com.zkqy.amichi.domain.MaterialRetentionLog" id="MaterialRetentionLogResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="materialCode" column="material_code" />
|
|
|
+ <result property="materialName" column="material_name" />
|
|
|
+ <result property="specification" column="specification" />
|
|
|
+ <result property="model" column="model" />
|
|
|
+ <result property="unit" column="unit" />
|
|
|
+ <result property="actualQuantityIssued" column="actual_quantity_issued" />
|
|
|
+ <result property="deliveryWarehouse" column="delivery_warehouse" />
|
|
|
+ <result property="ckNumber" column="ck_number" />
|
|
|
+ <result property="documentRemarks" column="document_remarks" />
|
|
|
+ <result property="documentType" column="document_type" />
|
|
|
+ <result property="inventoryOrganization" column="inventory_organization" />
|
|
|
+ <result property="receivingTissue" column="receiving_tissue" />
|
|
|
+ <result property="inventoryDirection" column="inventory_direction" />
|
|
|
+ <result property="dateOfDelivery" column="date_of_delivery" />
|
|
|
+ <result property="materialsRequisitionDepartment" column="materials_requisition_department" />
|
|
|
+ <result property="materialTaker" column="material_taker" />
|
|
|
+ <result property="businessType" column="business_type" />
|
|
|
+ <result property="ownerType" column="owner_type" />
|
|
|
+ <result property="owner" column="owner" />
|
|
|
+ <result property="documentStatus" column="document_status" />
|
|
|
+ <result property="detailedRemarks" column="detailed_remarks" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="productCode" column="product_code" />
|
|
|
+ <result property="productName" column="product_name" />
|
|
|
+ <result property="productModel" column="product_model" />
|
|
|
+ <result property="productSpecification" column="product_specification" />
|
|
|
+ <result property="materialType" column="material_type" />
|
|
|
+ <result property="process" column="process" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectMaterialRetentionLogVo">
|
|
|
+ select id, material_code, material_name, specification, model, unit,
|
|
|
+ CASE
|
|
|
+ WHEN CAST(actual_quantity_issued AS CHAR) LIKE '%.0000' THEN FLOOR(actual_quantity_issued)
|
|
|
+ ELSE actual_quantity_issued
|
|
|
+ END AS actual_quantity_issued,delivery_warehouse, ck_number, document_remarks,
|
|
|
+ document_type, inventory_organization, receiving_tissue, inventory_direction, date_of_delivery, materials_requisition_department,
|
|
|
+ material_taker, business_type, owner_type, owner, document_status, detailed_remarks, create_by_id, create_by, create_time,
|
|
|
+ update_by_id, update_by, update_time, del_flag,product_code,product_name,product_model,product_specification,material_type,process from fjqydb.material_retention_log
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectMaterialRetentionLogList" parameterType="com.zkqy.amichi.domain.MaterialRetentionLog" resultMap="MaterialRetentionLogResult">
|
|
|
+ <include refid="selectMaterialRetentionLogVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
|
|
+ <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
|
+ <if test="specification != null and specification != ''"> and specification = #{specification}</if>
|
|
|
+ <if test="model != null and model != ''"> and model = #{model}</if>
|
|
|
+ <if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
|
|
+ <if test="actualQuantityIssued != null and actualQuantityIssued != ''"> and actual_quantity_issued = #{actualQuantityIssued}</if>
|
|
|
+ <if test="deliveryWarehouse != null and deliveryWarehouse != ''"> and delivery_warehouse = #{deliveryWarehouse}</if>
|
|
|
+ <if test="ckNumber != null and ckNumber != ''"> and ck_number = #{ckNumber}</if>
|
|
|
+ <if test="documentRemarks != null and documentRemarks != ''"> and document_remarks = #{documentRemarks}</if>
|
|
|
+ <if test="documentType != null and documentType != ''"> and document_type = #{documentType}</if>
|
|
|
+ <if test="inventoryOrganization != null and inventoryOrganization != ''"> and inventory_organization = #{inventoryOrganization}</if>
|
|
|
+ <if test="receivingTissue != null and receivingTissue != ''"> and receiving_tissue = #{receivingTissue}</if>
|
|
|
+ <if test="inventoryDirection != null and inventoryDirection != ''"> and inventory_direction = #{inventoryDirection}</if>
|
|
|
+ <if test="dateOfDelivery != null and dateOfDelivery != ''"> and date_of_delivery = #{dateOfDelivery}</if>
|
|
|
+ <if test="materialsRequisitionDepartment != null and materialsRequisitionDepartment != ''"> and materials_requisition_department = #{materialsRequisitionDepartment}</if>
|
|
|
+ <if test="materialTaker != null and materialTaker != ''"> and material_taker = #{materialTaker}</if>
|
|
|
+ <if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
|
|
|
+ <if test="ownerType != null and ownerType != ''"> and owner_type = #{ownerType}</if>
|
|
|
+ <if test="owner != null and owner != ''"> and owner = #{owner}</if>
|
|
|
+ <if test="documentStatus != null and documentStatus != ''"> and document_status = #{documentStatus}</if>
|
|
|
+ <if test="detailedRemarks != null and detailedRemarks != ''"> and detailed_remarks = #{detailedRemarks}</if>
|
|
|
+ <if test="createById != null "> and create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null "> and update_by_id = #{updateById}</if>
|
|
|
+
|
|
|
+ <if test="productCode != null "> and product_code = #{productCode}</if>
|
|
|
+ <if test="productName != null "> and product_name = #{productName}</if>
|
|
|
+ <if test="productModel != null "> and product_model = #{productModel}</if>
|
|
|
+ <if test="productSpecification != null "> and product_specification = #{productSpecification}</if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMaterialRetentionLogById" parameterType="Long" resultMap="MaterialRetentionLogResult">
|
|
|
+ <include refid="selectMaterialRetentionLogVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertMaterialRetentionLog" parameterType="com.zkqy.amichi.domain.MaterialRetentionLog" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fjqydb.material_retention_log
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="materialCode != null and materialCode != ''">material_code,</if>
|
|
|
+ <if test="materialName != null and materialName != ''">material_name,</if>
|
|
|
+ <if test="specification != null">specification,</if>
|
|
|
+ <if test="model != null">model,</if>
|
|
|
+ <if test="unit != null">unit,</if>
|
|
|
+ <if test="actualQuantityIssued != null">actual_quantity_issued,</if>
|
|
|
+ <if test="deliveryWarehouse != null">delivery_warehouse,</if>
|
|
|
+ <if test="ckNumber != null">ck_number,</if>
|
|
|
+ <if test="documentRemarks != null">document_remarks,</if>
|
|
|
+ <if test="documentType != null">document_type,</if>
|
|
|
+ <if test="inventoryOrganization != null">inventory_organization,</if>
|
|
|
+ <if test="receivingTissue != null">receiving_tissue,</if>
|
|
|
+ <if test="inventoryDirection != null">inventory_direction,</if>
|
|
|
+ <if test="dateOfDelivery != null">date_of_delivery,</if>
|
|
|
+ <if test="materialsRequisitionDepartment != null">materials_requisition_department,</if>
|
|
|
+ <if test="materialTaker != null">material_taker,</if>
|
|
|
+ <if test="businessType != null">business_type,</if>
|
|
|
+ <if test="ownerType != null">owner_type,</if>
|
|
|
+ <if test="owner != null">owner,</if>
|
|
|
+ <if test="documentStatus != null">document_status,</if>
|
|
|
+ <if test="detailedRemarks != null">detailed_remarks,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="productCode != null ">product_code,</if>
|
|
|
+ <if test="productName != null ">product_name,</if>
|
|
|
+ <if test="prouuctModel != null ">prouuct_model,</if>
|
|
|
+ <if test="productSpecification != null ">product_specification</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
|
+ <if test="materialName != null and materialName != ''">#{materialName},</if>
|
|
|
+ <if test="specification != null">#{specification},</if>
|
|
|
+ <if test="model != null">#{model},</if>
|
|
|
+ <if test="unit != null">#{unit},</if>
|
|
|
+ <if test="actualQuantityIssued != null">#{actualQuantityIssued},</if>
|
|
|
+ <if test="deliveryWarehouse != null">#{deliveryWarehouse},</if>
|
|
|
+ <if test="ckNumber != null">#{ckNumber},</if>
|
|
|
+ <if test="documentRemarks != null">#{documentRemarks},</if>
|
|
|
+ <if test="documentType != null">#{documentType},</if>
|
|
|
+ <if test="inventoryOrganization != null">#{inventoryOrganization},</if>
|
|
|
+ <if test="receivingTissue != null">#{receivingTissue},</if>
|
|
|
+ <if test="inventoryDirection != null">#{inventoryDirection},</if>
|
|
|
+ <if test="dateOfDelivery != null">#{dateOfDelivery},</if>
|
|
|
+ <if test="materialsRequisitionDepartment != null">#{materialsRequisitionDepartment},</if>
|
|
|
+ <if test="materialTaker != null">#{materialTaker},</if>
|
|
|
+ <if test="businessType != null">#{businessType},</if>
|
|
|
+ <if test="ownerType != null">#{ownerType},</if>
|
|
|
+ <if test="owner != null">#{owner},</if>
|
|
|
+ <if test="documentStatus != null">#{documentStatus},</if>
|
|
|
+ <if test="detailedRemarks != null">#{detailedRemarks},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="productCode != null ">#{productCode},</if>
|
|
|
+ <if test="productName != null ">#{productName},</if>
|
|
|
+ <if test="prouuctModel != null ">#{prouuctModel},</if>
|
|
|
+ <if test="productSpecification != null ">#{productSpecification}</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <insert id="insertMaterialRetentionLogBatch" parameterType="com.zkqy.amichi.jd.domain.MaterialRetentionLogVo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ <foreach collection ="list" item="item" separator =";">
|
|
|
+ INSERT INTO fjqydb.material_retention_log
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="item.materialCode != null and item.materialCode != ''">material_code,</if>
|
|
|
+ <if test="item.materialName != null and item.materialName != ''">material_name,</if>
|
|
|
+ <if test="item.specification != null">specification,</if>
|
|
|
+ <if test="item.model != null">model,</if>
|
|
|
+ <if test="item.unit != null">unit,</if>
|
|
|
+ <if test="item.actualQuantityIssued != null">actual_quantity_issued,</if>
|
|
|
+ <if test="item.deliveryWarehouse != null">delivery_warehouse,</if>
|
|
|
+ <if test="item.ckNumber != null">ck_number,</if>
|
|
|
+ <if test="item.documentRemarks != null">document_remarks,</if>
|
|
|
+ <if test="item.documentType != null">document_type,</if>
|
|
|
+ <if test="item.inventoryOrganization != null">inventory_organization,</if>
|
|
|
+ <if test="item.receivingTissue != null">receiving_tissue,</if>
|
|
|
+ <if test="item.inventoryDirection != null">inventory_direction,</if>
|
|
|
+ <if test="item.dateOfDelivery != null">date_of_delivery,</if>
|
|
|
+ <if test="item.materialsRequisitionDepartment != null">materials_requisition_department,</if>
|
|
|
+ <if test="item.materialTaker != null">material_taker,</if>
|
|
|
+ <if test="item.businessType != null">business_type,</if>
|
|
|
+ <if test="item.ownerType != null">owner_type,</if>
|
|
|
+ <if test="item.owner != null">owner,</if>
|
|
|
+ <if test="item.documentStatus != null">document_status,</if>
|
|
|
+ <if test="item.detailedRemarks != null">detailed_remarks,</if>
|
|
|
+ <if test="item.createById != null">create_by_id,</if>
|
|
|
+ <if test="item.createBy!= null">create_by,</if>
|
|
|
+ <if test="item.createTime != null">create_time,</if>
|
|
|
+ <if test="item.updateById != null">update_by_id,</if>
|
|
|
+ <if test="item.updateBy != null">update_by,</if>
|
|
|
+ <if test="item.updateTime != null">update_time,</if>
|
|
|
+ <if test="item.delFlag != null">del_flag,</if>
|
|
|
+ <if test="item.productCode != null ">product_code,</if>
|
|
|
+ <if test="item.productName != null ">product_name,</if>
|
|
|
+ <if test="item.productModel != null ">product_model,</if>
|
|
|
+ <if test="item.productSpecification != null ">product_specification,</if>
|
|
|
+ <if test="item.materialType!=null">material_type,</if>
|
|
|
+ <if test="item.flowSequenceNumber!=null">flow_sequence_number,</if>
|
|
|
+ <if test="item.process!=null">process</if>
|
|
|
+ </trim>
|
|
|
+ VALUES
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="item.materialCode != null and item.materialCode != ''">#{item.materialCode},</if>
|
|
|
+ <if test="item.materialName != null and item.materialName != ''">#{item.materialName},</if>
|
|
|
+ <if test="item.specification != null">#{item.specification},</if>
|
|
|
+ <if test="item.model != null">#{item.model},</if>
|
|
|
+ <if test="item.unit != null">#{item.unit},</if>
|
|
|
+ <if test="item.actualQuantityIssued != null">#{item.actualQuantityIssued},</if>
|
|
|
+ <if test="item.deliveryWarehouse != null">#{item.deliveryWarehouse},</if>
|
|
|
+ <if test="item.ckNumber != null">#{item.ckNumber},</if>
|
|
|
+ <if test="item.documentRemarks != null">#{item.documentRemarks},</if>
|
|
|
+ <if test="item.documentType != null">#{item.documentType},</if>
|
|
|
+ <if test="item.inventoryOrganization != null">#{item.inventoryOrganization},</if>
|
|
|
+ <if test="item.receivingTissue != null">#{item.receivingTissue},</if>
|
|
|
+ <if test="item.inventoryDirection != null">#{item.inventoryDirection},</if>
|
|
|
+ <if test="item.dateOfDelivery != null">#{item.dateOfDelivery},</if>
|
|
|
+ <if test="item.materialsRequisitionDepartment != null">#{item.materialsRequisitionDepartment},</if>
|
|
|
+ <if test="item.materialTaker != null">#{item.materialTaker},</if>
|
|
|
+ <if test="item.businessType != null">#{item.businessType},</if>
|
|
|
+ <if test="item.ownerType != null">#{item.ownerType},</if>
|
|
|
+ <if test="item.owner != null">#{item.owner},</if>
|
|
|
+ <if test="item.documentStatus != null">#{item.documentStatus},</if>
|
|
|
+ <if test="item.detailedRemarks != null">#{item.detailedRemarks},</if>
|
|
|
+ <if test="item.createById != null">#{item.createById},</if>
|
|
|
+ <if test="item.createBy != null">#{item.createBy},</if>
|
|
|
+ <if test="item.createTime != null">#{item.createTime},</if>
|
|
|
+ <if test="item.updateById != null">#{item.updateById},</if>
|
|
|
+ <if test="item.updateBy != null">#{item.updateBy},</if>
|
|
|
+ <if test="item.updateTime != null">#{item.updateTime},</if>
|
|
|
+ <if test="item.delFlag != null">#{item.delFlag},</if>
|
|
|
+ <if test="item.productCode != null ">#{item.productCode},</if>
|
|
|
+ <if test="item.productName != null ">#{item.productName},</if>
|
|
|
+ <if test="item.productModel != null ">#{item.productModel},</if>
|
|
|
+ <if test="item.productSpecification != null ">#{item.productSpecification},</if>
|
|
|
+ <if test="item.materialType!=null">#{item.materialType},</if>
|
|
|
+ <if test="item.flowSequenceNumber!=null">#{item.flowSequenceNumber},</if>
|
|
|
+ <if test="item.process!=null">#{item.process}</if>
|
|
|
+ </trim>
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateMaterialRetentionLog" parameterType="com.zkqy.amichi.domain.MaterialRetentionLog">
|
|
|
+ update fjqydb.material_retention_log
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
|
|
+ <if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
|
|
+ <if test="specification != null">specification = #{specification},</if>
|
|
|
+ <if test="model != null">model = #{model},</if>
|
|
|
+ <if test="unit != null">unit = #{unit},</if>
|
|
|
+ <if test="actualQuantityIssued != null">actual_quantity_issued = #{actualQuantityIssued},</if>
|
|
|
+ <if test="deliveryWarehouse != null">delivery_warehouse = #{deliveryWarehouse},</if>
|
|
|
+ <if test="ckNumber != null">ck_number = #{ckNumber},</if>
|
|
|
+ <if test="documentRemarks != null">document_remarks = #{documentRemarks},</if>
|
|
|
+ <if test="documentType != null">document_type = #{documentType},</if>
|
|
|
+ <if test="inventoryOrganization != null">inventory_organization = #{inventoryOrganization},</if>
|
|
|
+ <if test="receivingTissue != null">receiving_tissue = #{receivingTissue},</if>
|
|
|
+ <if test="inventoryDirection != null">inventory_direction = #{inventoryDirection},</if>
|
|
|
+ <if test="dateOfDelivery != null">date_of_delivery = #{dateOfDelivery},</if>
|
|
|
+ <if test="materialsRequisitionDepartment != null">materials_requisition_department = #{materialsRequisitionDepartment},</if>
|
|
|
+ <if test="materialTaker != null">material_taker = #{materialTaker},</if>
|
|
|
+ <if test="businessType != null">business_type = #{businessType},</if>
|
|
|
+ <if test="ownerType != null">owner_type = #{ownerType},</if>
|
|
|
+ <if test="owner != null">owner = #{owner},</if>
|
|
|
+ <if test="documentStatus != null">document_status = #{documentStatus},</if>
|
|
|
+ <if test="detailedRemarks != null">detailed_remarks = #{detailedRemarks},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="productCode != null ">product_code = #{productCode}</if>
|
|
|
+ <if test="productName != null ">product_name = #{productName}</if>
|
|
|
+ <if test="productModel != null ">product_model = #{productModel}</if>
|
|
|
+ <if test="productSpecification != null ">product_specification = #{productSpecification}</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteMaterialRetentionLogById" parameterType="Long">
|
|
|
+ delete from fjqydb.material_retention_log where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteMaterialRetentionLogByIds" parameterType="String">
|
|
|
+ delete from fjqydb.material_retention_log where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|