You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

96 lines
5.1 KiB

<?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.xjfast.mapper.InventorystockMapper">
<resultMap id="BaseResultMap" type="com.xjfast.entity.Inventorystock">
<id column="Site" jdbcType="VARCHAR" property="site"/>
<id column="WarehouseID" jdbcType="VARCHAR" property="warehouseid"/>
<id column="PartNo" jdbcType="VARCHAR" property="partno"/>
<id column="BatchNo" jdbcType="VARCHAR" property="batchno"/>
<id column="LocationID" jdbcType="VARCHAR" property="locationid"/>
<result column="FirstInDate" jdbcType="TIMESTAMP" property="firstindate"/>
<result column="LatestOutDate" jdbcType="TIMESTAMP" property="latestoutdate"/>
<result column="LatestInDate" jdbcType="TIMESTAMP" property="latestindate"/>
<result column="ActiveDate" jdbcType="TIMESTAMP" property="activedate"/>
<result column="InQty" jdbcType="FLOAT" property="inqty"/>
<result column="OutQty" jdbcType="FLOAT" property="outqty"/>
<result column="QtyOnHand" jdbcType="FLOAT" property="qtyonhand"/>
<result column="QtyReserved" jdbcType="FLOAT" property="qtyreserved"/>
<result column="InStandardValue" jdbcType="FLOAT" property="instandardvalue"/>
<result column="InActualValue" jdbcType="FLOAT" property="inactualvalue"/>
<result column="OutStandardValue" jdbcType="FLOAT" property="outstandardvalue"/>
<result column="OutActualValue" jdbcType="FLOAT" property="outactualvalue"/>
<result column="PartnerID" jdbcType="VARCHAR" property="partnerid"/>
<result column="PartnerType" jdbcType="CHAR" property="partnertype"/>
<result column="LatestCountDate" jdbcType="TIMESTAMP" property="latestcountdate"/>
<result column="Freezeflag" jdbcType="CHAR" property="freezeflag"/>
<result column="QtyTmp" jdbcType="FLOAT" property="qtytmp"/>
<result column="ManufactureDate" jdbcType="TIMESTAMP" property="manufacturedate"/>
<result column="ExpiredDate" jdbcType="TIMESTAMP" property="expireddate"/>
<result column="QtytoIssue" jdbcType="FLOAT" property="qtytoissue"/>
<result column="DemandPartnerType" jdbcType="CHAR" property="demandpartnertype"/>
<result column="DemandPartnerID" jdbcType="VARCHAR" property="demandpartnerid"/>
<result column="DemandPartnerName" jdbcType="VARCHAR" property="demandpartnername"/>
</resultMap>
<sql id="Base_Column_List">
Site
, WarehouseID, PartNo, BatchNo, LocationID, FirstInDate, LatestOutDate, LatestInDate,
ActiveDate, InQty, OutQty, QtyOnHand, QtyReserved, InStandardValue, InActualValue,
OutStandardValue, OutActualValue, PartnerID, PartnerType, LatestCountDate, Freezeflag,
QtyTmp, ManufactureDate, ExpiredDate, QtytoIssue, DemandPartnerType, DemandPartnerID,
DemandPartnerName
</sql>
<select id="searchInventoryList" resultType="com.xjfast.entity.vo.InventoryStockVo"
parameterType="com.xjfast.entity.query.InventoryStockQuery">
SELECT
i.WarehouseID,i.PartNo,i.QtyOnHand,
p.PartDescription,
w.WareHouseName,
i.site,
w.WareHouseType,
w.WareHouseType_DB
FROM
WareHouse w
LEFT JOIN InventoryStock i ON ( w.WareHouseID = i.WareHouseID )
LEFT JOIN Part p ON ( p.PartNo = i.PartNo )
<where>
<if test="warehousetypeDb != null and warehousetypeDb != ''">
and w.WareHouseType_DB=#{warehousetypeDb}
</if>
<if test="site != null and site != ''">
i.site = #{site} and w.site=#{site} and p.site=#{site}
</if>
<if test="wareHouseName != null and wareHouseName != ''">
and w.WareHouseName like '%'+#{wareHouseName}+'%'
</if>
<if test="warehouseid != null and warehouseid != ''">
and i.warehouseid like '%'+#{warehouseid}+'%'
</if>
<if test="partNo != null and partNo != ''">
and i.PartNo like '%'+#{partNo}+'%'
</if>
<if test="partDescription != null and partDescription != ''">
and p.PartDescription like '%'+#{partDescription}+'%'
</if>
</where>
</select>
<select id="searchInventory" resultType="com.xjfast.entity.vo.InventoryStockVo"
parameterType="com.xjfast.entity.query.InventoryStockQuery">
SELECT i.WarehouseID,
i.PartNo,
i.QtyOnHand,
p.PartDescription,
w.WareHouseName,
ppi.average_consume_qty,
ppi.cover_days,
i.site
FROM InventoryStock i
LEFT JOIN Part p on (p.PartNo = i.PartNo)
LEFT JOIN WareHouse w on (w.WareHouseID = i.WareHouseID and w.WareHouseType_DB = #{warehousetypeDb})
LEFT JOIN part_plan_info ppi on (ppi.part_no = i.PartNo and ppi.ware_house_id = i.WarehouseID)
where i.site = #{site}
and i.PartNo = #{partNo}
and i.WarehouseID = #{wareHouseId}
</select>
</mapper>