ShippingCombinationMapper.xml
3.27 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
<?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.shipment.shippingCombination.mapper.ShippingCombinationMapper">
<select id="getInventory" resultType="com.huaheng.pc.inventory.inventory.domain.Inventory">
SELECT i.id, i.warehouseId, i.warehouseCode, i.locationId, i.locationCode, i.containerCode,
i.sourceCode, i.sourceLine, i.companyId, i.companyCode, i.materialId, i.materialCode,
i.receiptId, i.receiptCode, i.receiptDetailId, i.batch, i.lot, i.project, i.manufactureDate,
i.expirationDate, i.status, i.qty, i.taskQty, i.costPrice, i.listPrice, i.netPrice, i.created,
i.createdBy, i.lastUpdated, i.lastUpdatedBy, i.userDef1, i.userDef2, i.userDef3, i.deleted,
m.name materialName, m.userDef1 materialOldCode ,i.zoneCode,i.unit
FROM inventory i
INNER JOIN material m ON i.materialCode = m.code
AND i.companyCode=#{companyCode}
AND i.warehouseCode=#{warehouseCode}
AND m.warehouseCode=#{warehouseCode}
AND i.qty > i.taskQty
AND i.materialCode=#{materialCode}
AND m.deleted = 0
INNER JOIN location l ON i.locationCode = l.code
AND l.warehouseCode=#{warehouseCode}
LEFT JOIN shipment_container_header s ON i.locationCode = s.locationCode
AND s.status=0
AND s.warehouseCode=#{warehouseCode}
<where>
<if test="project != null and project != ''">
AND i.project = #{project}
</if>
<if test="batch != null and batch != ''">
AND i.batch = #{batch}
</if>
<if test="lot != null and lot !=''">
AND i.lot = #{lot}
</if>
<if test="zoneCode != null and zoneCode !=''">
AND i.zoneCode = #{zoneCode}
</if>
<if test="inventoryStatus != null and inventoryStatus != '' ">
AND i.status = #{inventoryStatus}
</if>
<if test="userDef1 != null and userDef1 != '' ">
AND i.userDef1 = #{userDef1}
</if>
<if test="locationCode != null and locationCode != '' ">
AND i.locationCode = #{locationCode}
</if>
<if test="containerCode != null and containerCode != '' ">
AND i.containerCode = #{containerCode}
</if>
<if test="params != null and params.createdBegin != null and params.createdBegin != ''">
AND i.created >= #{params.createdBegin}
</if>
<if test="params != null and params.createdEnd != null and params.createdEnd != ''">
AND i.created <= #{params.createdEnd}
</if>
<!-- 接入钱柜 2021-01-08 -->
<!-- and i.zoneCode<>'QG' -->
AND (l.status='empty' OR (l.status='lock' AND s.id IS NOT NULL))
</where>
</select>
</mapper>