<?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.snapshotInventoryHeader.mapper.SnapshotInventoryHeaderMapper"> <resultMap type="com.huaheng.pc.inventory.snapshotInventoryHeader.domain.SnapshotInventoryHeader" id="snapshotInventoryHeaderResult"> <id column="id" jdbcType="INTEGER" property="id" /> <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> <result column="locationCode" jdbcType="VARCHAR" property="locationCode" /> <result column="containerCode" jdbcType="VARCHAR" property="containerCode" /> <result column="containerStatus" jdbcType="VARCHAR" property="containerStatus" /> <result column="companyCode" jdbcType="VARCHAR" property="companyCode" /> <result column="materialSkuQty" jdbcType="VARCHAR" property="materialSkuQty" /> <result column="totalWeight" jdbcType="VARCHAR" property="totalWeight" /> <result column="totalQty" jdbcType="INTEGER" property="totalQty" /> <result column="totalLines" jdbcType="INTEGER" property="totalLines" /> <result column="projectNos" jdbcType="VARCHAR" property="projectNos" /> <result column="batchs" jdbcType="VARCHAR" property="batchs" /> <result column="lots" jdbcType="VARCHAR" property="lots" /> <result column="locking" jdbcType="INTEGER" property="locking" /> <result column="lockRemark" jdbcType="VARCHAR" property="lockRemark" /> <result column="enable" jdbcType="INTEGER" property="enable" /> <result column="created" jdbcType="TIMESTAMP" property="created" /> <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" /> <result column="version" jdbcType="INTEGER" property="version" /> <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> </resultMap> <insert id="insertAll"> INSERT INTO snapshot_inventory_header(warehouseCode, zoneCode, locationCode, containerCode, containerStatus, companyCode, materialSkuQty, totalWeight, totalQty, totalLines, projectNos, batchs, lots, locking, lockRemark, enable, createdBy, lastUpdatedBy, version, userDef1, userDef2, userDef3, created,lastUpdated) select warehouseCode, zoneCode, locationCode, containerCode, containerStatus, companyCode, materialSkuQty, totalWeight, totalQty, totalLines, projectNos, batchs, lots, locking, lockRemark, enable, createdBy, lastUpdatedBy, version, userDef1, userDef2, userDef3, #{date}, #{date} from inventory_header </insert> <delete id="deleteSnapshot"> delete from snapshot_inventory_header where id not in (SELECT id FROM inventory_header) </delete> <select id="getAll" resultType="com.huaheng.pc.inventory.snapshotInventoryHeader.domain.SnapshotInventoryHeader"> select * from snapshot_inventory_header </select> <select id="getOne" resultType="com.huaheng.pc.inventory.snapshotInventoryHeader.domain.SnapshotInventoryHeader"> SELECT created FROM snapshot_inventory_header ORDER BY created desc limit 1 </select> </mapper>