SnapshotInventoryHeaderMapper.xml
4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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>