自动化立体仓库 - WMS系统
#
zjj
2025-09-17 4474cf3c30e6ad06711d2021be15ff82c36bd75a
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?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.zy.asrs.mapper.POInStockMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.POInStock">
        <result column="FBrNo" property="FBrNo" />
        <result column="FInterID" property="FInterID" />
        <result column="FBillNo" property="FBillNo" />
        <result column="FCurrencyID" property="FCurrencyID" />
        <result column="FTranType" property="FTranType" />
        <result column="FSupplyID" property="FSupplyID" />
        <result column="FDeptID" property="FDeptID" />
        <result column="FEmpID" property="FEmpID" />
        <result column="FDate" property="FDate" />
        <result column="FStockID" property="FStockID" />
        <result column="FPosterID" property="FPosterID" />
        <result column="FCheckerID" property="FCheckerID" />
        <result column="FBillerID" property="FBillerID" />
        <result column="FFManagerID" property="FFManagerID" />
        <result column="FSManagerID" property="FSManagerID" />
        <result column="FCnnBillNo" property="FCnnBillNo" />
        <result column="FClosed" property="FClosed" />
        <result column="FNote" property="FNote" />
        <result column="FInvoiceClosed" property="FInvoiceClosed" />
        <result column="FBClosed" property="FBClosed" />
        <result column="FCreateDate" property="FCreateDate" />
        <result column="FCheckDate" property="FCheckDate" />
        <result column="FExchangeRate" property="FExchangeRate" />
        <result column="FStatus" property="FStatus" />
        <result column="FCancellation" property="FCancellation" />
        <result column="FUpStockWhenSave" property="FUpStockWhenSave" />
        <result column="FPOStyle" property="FPOStyle" />
        <result column="FMultiCheckLevel1" property="FMultiCheckLevel1" />
        <result column="FMultiCheckLevel2" property="FMultiCheckLevel2" />
        <result column="FMultiCheckLevel3" property="FMultiCheckLevel3" />
        <result column="FMultiCheckLevel4" property="FMultiCheckLevel4" />
        <result column="FMultiCheckLevel5" property="FMultiCheckLevel5" />
        <result column="FMultiCheckLevel6" property="FMultiCheckLevel6" />
        <result column="FMultiCheckDate1" property="FMultiCheckDate1" />
        <result column="FMultiCheckDate2" property="FMultiCheckDate2" />
        <result column="FMultiCheckDate3" property="FMultiCheckDate3" />
        <result column="FMultiCheckDate4" property="FMultiCheckDate4" />
        <result column="FMultiCheckDate5" property="FMultiCheckDate5" />
        <result column="FMultiCheckDate6" property="FMultiCheckDate6" />
        <result column="FCurCheckLevel" property="FCurCheckLevel" />
        <result column="FRelateBrID" property="FRelateBrID" />
        <result column="FExplanation" property="FExplanation" />
        <result column="FFetchAdd" property="FFetchAdd" />
        <result column="FSelectBillNo" property="FSelectBillNo" />
        <result column="FSelTranType" property="FSelTranType" />
        <result column="FChildren" property="FChildren" />
        <result column="FBrID" property="FBrID" />
        <result column="FTranStatus" property="FTranStatus" />
        <result column="FAreaPS" property="FAreaPS" />
        <result column="FReStatus" property="FReStatus" />
        <result column="FPOOrdBillNo" property="FPOOrdBillNo" />
        <result column="FManageType" property="FManageType" />
        <result column="FBizType" property="FBizType" />
        <result column="FWWType" property="FWWType" />
        <result column="FPrintCount" property="FPrintCount" />
        <result column="FHeadSelfP0338" property="FHeadSelfP0338" />
        <result column="FHeadSelfP0339" property="FHeadSelfP0339" />
        <result column="same_id" property="sameId" />
 
    </resultMap>
 
 
 
 
 
    <select id="getMaxCode" parameterType="java.lang.String" resultType="java.lang.String">
        select  max(fbillno)
        from POInStock
        where 1=1 and  fbillno is not null
          and fbillno like '' +  #{fbillno}+ '%'
 
    </select>
 
    <select id="getMaxId"  resultType="java.lang.Integer">
        select case when max(FInterID) is null then 0 else max(FInterID) end
        from (select FInterID from xtyasrs_dual.dbo.InStockbill union all select FInterID from  POInStock)t
    </select>
 
    <update id="updatePoQty" parameterType="com.zy.kingdee.entity.PoOrder">
        update POOrderEntry set fentryselfp0263 =(case when fentryselfp0263 is null then 0 else fentryselfp0263 end )+ #{fentryselfp0263, jdbcType=DECIMAL}
        where  FItemID= #{fitemid,jdbcType=INTEGER}  and fentryselfp0262=#{fentryselfp0262,jdbcType=VARCHAR}
    </update>
    <update id="updateWwQty" parameterType="com.zy.kingdee.entity.SubContract">
        update ICSubContractEntry set fdecimal =(case when fdecimal is null then 0 else fdecimal end )+ #{fdecimal, jdbcType=DECIMAL}
        where  FItemID= #{fitemid,jdbcType=INTEGER}  and FOrderNo=#{forderno,jdbcType=VARCHAR}
    </update>
 
 
    <delete id="deleteBySameId" parameterType="java.lang.String" >
        delete from POInStock
        where same_id =#{sameId,jdbcType=VARCHAR}
    </delete>
 
    <delete id="deleteDetailBySameId" parameterType="java.lang.String" >
        delete from POInStockEntry
        where FInterID in (select FInterID from  POInStock where same_id =#{sameId,jdbcType=VARCHAR})
    </delete>
 
 
 
    <delete id="deleteZjBySameId" parameterType="java.lang.String" >
        delete from xtyasrs_dual.dbo.InStockbill    where FBillNo  IN (
            select FBillNo from    POInStock
            where same_id =#{sameId,jdbcType=VARCHAR}
        )
    </delete>
 
    <delete id="deleteZjDetailBySameId" parameterType="java.lang.String" >
        delete from xtyasrs_dual.dbo.InStockbillEntry  where  finterid in (
            select finterid from  xtyasrs_dual.dbo.InStockbill where FBillNo in(
                select FBillNo from   POInStockEntry
                where FInterID in (select FInterID from  POInStock where same_id =#{sameId,jdbcType=VARCHAR})
            )
        )
    </delete>
    <update id="updateZjMain" parameterType="com.zy.asrs.entity.POInStock">
        update xtyasrs_dual.dbo.InStockbill set   fsupplyid =#{fsupplyid, jdbcType=INTEGER}
        where  finterid= #{finterid,jdbcType=INTEGER}
    </update>
    <update id="updateZjQty" parameterType="com.zy.asrs.entity.POInStockEntry">
        update xtyasrs_dual.dbo.InStockbillEntry set fqtypass =#{fqty, jdbcType=DECIMAL}, fqty =#{fqty, jdbcType=DECIMAL}, fauxqty =#{fqty, jdbcType=DECIMAL}, fauxqtypass =#{fqty, jdbcType=DECIMAL}
        where  FItemID= #{fitemid,jdbcType=INTEGER}  and  finterid in (
            select finterid from  xtyasrs_dual.dbo.InStockbill where FBillNo =#{fbillno,jdbcType=VARCHAR}
        )
    </update>
 
    <delete id="deleteZjDetail" parameterType="com.zy.asrs.entity.POInStockEntry" >
        delete from xtyasrs_dual.dbo.InStockbillEntry  where  finterid in (
            select finterid from  xtyasrs_dual.dbo.InStockbill where FBillNo =#{fbillno,jdbcType=VARCHAR}
        )
                                                         and FItemID= #{fitemid,jdbcType=INTEGER}
 
    </delete>
 
    <delete id="deleteZj" parameterType="com.zy.asrs.entity.POInStockEntry" >
        delete from xtyasrs_dual.dbo.InStockbill  where  finterid in (
            select finterid from  xtyasrs_dual.dbo.InStockbill where FBillNo =#{fbillno,jdbcType=VARCHAR}
        )
    </delete>
 
 
 
 
</mapper>