InventoryHeaderMapper.xml
3.34 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
<?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.inventoryHeader.mapper.InventoryHeaderMapper">
<resultMap id="BaseResultMap" type="com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader">
<!--@mbg.generated-->
<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>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, warehouseCode, locationCode, containerCode, containerStatus, companyCode, materialSkuQty,
totalWeight, totalQty, totalLines, projectNos, batchs, lots, locking, lockRemark,
enable, created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2,
userDef3
</sql>
<select id="getUncompleteReceiptContainer" resultType="java.lang.Integer">
SELECT count(id) from receipt_container_header WHERE toLocation = #{locationCode} and `status`<20 and warehouseCode = #{warehouseCode}
</select>
<select id="getUncompleteShipmentContainer" resultType="java.lang.Integer">
SELECT count(id) from shipment_container_header t join location b ON t.warehouseCode = b.warehouseCode and t.containerCode = b.containerCode
WHERE b.`code` = #{locationCode} AND t.`status`<20 and t.warehouseCode = #{warehouseCode}
</select>
<select id="cycleCountInventoryHeader" resultType="java.lang.Integer">
SELECT DISTINCT h.id FROM inventory_header h
INNER JOIN inventory_detail d ON h.id= d.inventoryHeaderId
INNER JOIN location l ON d.locationCode = l.code
AND l.status = 'empty'
</select>
</mapper>