<?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>
|