SnapshotInventoryDetailMapper.xml 6.14 KB
<?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.huaheng.pc.inventory.snapshotInventoryDetail.mapper.SnapshotInventoryDetailMapper">

    <resultMap type="com.huaheng.pc.inventory.snapshotInventoryDetail.domain.SnapshotInventoryDetail"
               id="snapshotInventoryDetailResult">
        <result property="id" column="id"/>
        <result property="inventoryHeaderId" column="inventoryHeaderId"/>
        <result property="warehouseCode" column="warehouseCode"/>
        <result property="zoneCode" column="zoneCode"/>
        <result property="companyCode" column="companyCode"/>
        <result property="locationCode" column="locationCode"/>
        <result property="containerCode" column="containerCode"/>
        <result property="materialName" column="materialName"/>
        <result property="materialCode" column="materialCode"/>
        <result property="materialSpec" column="materialSpec"/>
        <result property="materialUnit" column="materialUnit"/>
        <result property="qty" column="qty"/>
        <result property="taskQty" column="taskQty"/>
        <result property="receiptCode" column="receiptCode"/>
        <result property="receiptDetailId" column="receiptDetailId"/>
        <result property="inventorySts" column="inventorySts"/>
        <result property="supplierCode" column="supplierCode"/>
        <result property="referCode" column="referCode"/>
        <result property="referDetailId" column="referDetailId"/>
        <result property="batch" column="batch"/>
        <result property="lot" column="lot"/>
        <result property="projectNo" column="projectNo"/>
        <result property="qcCheck" column="qcCheck"/>
        <result property="weight" column="weight"/>
        <result property="manufactureDate" column="manufactureDate"/>
        <result property="expirationDate" column="expirationDate"/>
        <result property="agingDate" column="agingDate"/>
        <result property="attributeId" column="attributeId"/>
        <result property="attribute1" column="attribute1"/>
        <result property="attribute2" column="attribute2"/>
        <result property="attribute3" column="attribute3"/>
        <result property="lockCode" column="lockCode"/>
        <result property="lastCycleCountDate" column="lastCycleCountDate"/>
        <result property="created" column="created"/>
        <result property="createdBy" column="createdBy"/>
        <result property="lastUpdated" column="lastUpdated"/>
        <result property="lastUpdatedBy" column="lastUpdatedBy"/>
        <result property="userDef1" column="userDef1"/>
        <result property="userDef2" column="userDef2"/>
        <result property="userDef3" column="userDef3"/>
        <result property="processStamp" column="processStamp"/>
        <result property="level" column="level"/>
    </resultMap>
    <sql id="selectsnapshotInventoryDetailVo">
        select id,
               inventoryHeaderId,
               warehouseCode,
               zoneCode,
               companyCode,
               locationCode,
               containerCode,
               materialName,
               materialCode,
               materialSpec,
               materialUnit,
               qty,
               taskQty,
               receiptCode,
               receiptDetailId,
               inventorySts,
               supplierCode,
               referCode,
               referDetailId,
               batch,
               lot,
               projectNo,
               qcCheck,
               weight,
               manufactureDate,
               expirationDate,
               agingDate,
               attributeId,
               attribute1,
               attribute2,
               attribute3,
               lockCode,
               lastCycleCountDate,
               created,
               createdBy,
               lastUpdated,
               lastUpdatedBy,
               userDef1,
               userDef2,
               userDef3,
               processStamp,
               level
        from snapshot_inventory_detail
    </sql>
    <insert id="insertAll">
        INSERT INTO snapshot_inventory_detail(inventoryHeaderId, warehouseCode, zoneCode, companyCode, locationCode,
                                              containerCode, materialName, materialCode, materialSpec, materialUnit,
                                              qty, taskQty, receiptCode, receiptDetailId, inventorySts, supplierCode,
                                              referCode, referDetailId, batch, lot, projectNo, qcCheck, weight,
                                              manufactureDate, expirationDate, agingDate, attributeId, attribute1,
                                              attribute2, attribute3, lockCode, lastCycleCountDate, createdBy,
                                              lastUpdatedBy, userDef1, userDef2, userDef3, processStamp, level)
        SELECT inventoryHeaderId,
               warehouseCode,
               zoneCode,
               companyCode,
               locationCode,
               containerCode,
               materialName,
               materialCode,
               materialSpec,
               materialUnit,
               qty,
               taskQty,
               receiptCode,
               receiptDetailId,
               inventorySts,
               supplierCode,
               referCode,
               referDetailId,
               batch,
               lot,
               projectNo,
               qcCheck,
               weight,
               manufactureDate,
               expirationDate,
               agingDate,
               attributeId,
               attribute1,
               attribute2,
               attribute3,
               lockCode,
               lastCycleCountDate,
               createdBy,
               lastUpdatedBy,
               userDef1,
               userDef2,
               userDef3,
               processStamp,
               level
        FROM inventory_detail
    </insert>
    <delete id="deleteSnapshot">
        delete from snapshot_inventory_detail where id not in ( SELECT id FROM inventory_detail )
    </delete>

</mapper>