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.
143 lines
8.3 KiB
143 lines
8.3 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.PartMapper">
|
|
<resultMap id="BaseResultMap" type="com.xjfast.entity.Part">
|
|
<id column="Part_PartNo" jdbcType="VARCHAR" property="partno"/>
|
|
<id column="Part_Site" jdbcType="VARCHAR" property="site"/>
|
|
<result column="Part_PartDescription" jdbcType="VARCHAR" property="partdescription"/>
|
|
<result column="Part_Spec" jdbcType="VARCHAR" property="spec"/>
|
|
<result column="Part_PartType_DB" jdbcType="CHAR" property="parttypeDb"/>
|
|
<result column="Part_PartType" jdbcType="VARCHAR" property="parttype"/>
|
|
<result column="Part_FamilyID" jdbcType="VARCHAR" property="familyid"/>
|
|
<result column="Part_GroupID" jdbcType="VARCHAR" property="groupid"/>
|
|
<result column="Part_UMID" jdbcType="VARCHAR" property="umid"/>
|
|
<result column="Part_Active" jdbcType="CHAR" property="active"/>
|
|
<result column="Part_Remark" jdbcType="VARCHAR" property="remark"/>
|
|
<result column="Part_Stock" jdbcType="FLOAT" property="stock"/>
|
|
<result column="Part_StockInArrive" jdbcType="FLOAT" property="stockinarrive"/>
|
|
<result column="Part_StockInQuality" jdbcType="FLOAT" property="stockinquality"/>
|
|
<result column="Part_StockInConsignment" jdbcType="FLOAT" property="stockinconsignment"/>
|
|
<result column="Part_StockInPicking" jdbcType="FLOAT" property="stockinpicking"/>
|
|
<result column="Part_StockinActive" jdbcType="FLOAT" property="stockinactive"/>
|
|
<result column="Part_QtyonPO" jdbcType="FLOAT" property="qtyonpo"/>
|
|
<result column="Part_MinStock" jdbcType="FLOAT" property="minstock"/>
|
|
<result column="Part_MaxStock" jdbcType="FLOAT" property="maxstock"/>
|
|
<result column="Part_SafetyStockManage" jdbcType="CHAR" property="safetystockmanage"/>
|
|
<result column="Part_SafetyStock" jdbcType="FLOAT" property="safetystock"/>
|
|
<result column="Part_StandardOrderQty" jdbcType="FLOAT" property="standardorderqty"/>
|
|
<result column="Part_SupplierID" jdbcType="VARCHAR" property="supplierid"/>
|
|
<result column="Part_AccountFamilyID" jdbcType="VARCHAR" property="accountfamilyid"/>
|
|
<result column="Part_LatestPrice" jdbcType="FLOAT" property="latestprice"/>
|
|
<result column="Part_AveragePrice" jdbcType="FLOAT" property="averageprice"/>
|
|
<result column="Part_ActualCost" jdbcType="FLOAT" property="actualcost"/>
|
|
<result column="Part_StandardCost" jdbcType="FLOAT" property="standardcost"/>
|
|
<result column="Part_StandardCost_BasePrice" jdbcType="FLOAT" property="standardcostBaseprice"/>
|
|
<result column="Part_LatestSalesPrice" jdbcType="FLOAT" property="latestsalesprice"/>
|
|
<result column="Part_AverageSalesPrice" jdbcType="FLOAT" property="averagesalesprice"/>
|
|
<result column="Part_FinanceCheck" jdbcType="CHAR" property="financecheck"/>
|
|
<result column="Part_MRPCode" jdbcType="CHAR" property="mrpcode"/>
|
|
<result column="Part_ManuLeadtime" jdbcType="FLOAT" property="manuleadtime"/>
|
|
<result column="Part_DefaultWarehouseID" jdbcType="VARCHAR" property="defaultwarehouseid"/>
|
|
<result column="Part_CodeNo" jdbcType="VARCHAR" property="codeno"/>
|
|
<result column="Part_SubCodeNo" jdbcType="CHAR" property="subcodeno"/>
|
|
<result column="Part_StandardLotSize" jdbcType="FLOAT" property="standardlotsize"/>
|
|
<result column="Part_ExpireDateControlFlag" jdbcType="CHAR" property="expiredatecontrolflag"/>
|
|
<result column="Part_ToExpireDays" jdbcType="FLOAT" property="toexpiredays"/>
|
|
<result column="Part_CreateDate" jdbcType="TIMESTAMP" property="createdate"/>
|
|
<result column="Part_LastUpdateBy" jdbcType="VARCHAR" property="lastupdateby"/>
|
|
<result column="Part_NeedApproveFlag" jdbcType="CHAR" property="needapproveflag"/>
|
|
<result column="Part_ApprovedFlag" jdbcType="CHAR" property="approvedflag"/>
|
|
<result column="Part_NetWeight" jdbcType="FLOAT" property="netweight"/>
|
|
<result column="Part_OtherGroup1" jdbcType="VARCHAR" property="othergroup1"/>
|
|
<result column="Part_OtherGroup2" jdbcType="VARCHAR" property="othergroup2"/>
|
|
<result column="Part_OtherGroup3" jdbcType="VARCHAR" property="othergroup3"/>
|
|
<result column="Part_OtherGroup4" jdbcType="VARCHAR" property="othergroup4"/>
|
|
<result column="Part_DefaultDepartmentID" jdbcType="VARCHAR" property="defaultdepartmentid"/>
|
|
<result column="Part_DefaultLocationID" jdbcType="VARCHAR" property="defaultlocationid"/>
|
|
<result column="Part_ConfigurationFlag" jdbcType="CHAR" property="configurationflag"/>
|
|
<result column="Part_ConfigurationTemplateID" jdbcType="VARCHAR" property="configurationtemplateid"/>
|
|
<result column="Part_BOMLatestRevNo" jdbcType="VARCHAR" property="bomlatestrevno"/>
|
|
<result column="Part_UMID_New" jdbcType="VARCHAR" property="umidNew"/>
|
|
<result column="Part_PartNo_Base" jdbcType="VARCHAR" property="partnoBase"/>
|
|
<result column="Part_UMID_ConvertFactor" jdbcType="FLOAT" property="umidConvertfactor"/>
|
|
</resultMap>
|
|
<sql id="part_column">
|
|
PartNo
|
|
,Site,PartDescription,Spec,PartType_DB,PartType,FamilyID,GroupID,UMID,Active,Remark,Stock,StockInArrive,StockInQuality,StockInConsignment
|
|
,StockInPicking,MinStock,MaxStock,SafetyStockManage,SafetyStock,StandardOrderQty,SupplierID,AccountFamilyID,LatestPrice,AveragePrice
|
|
,ActualCost,StandardCost,StandardCost_BasePrice,LatestSalesPrice,AverageSalesPrice,FinanceCheck,MRPCode,ManuLeadtime,DefaultWarehouseID
|
|
,CodeNo,SubCodeNo,StandardLotSize,ExpireDateControlFlag,ToExpireDays,CreateDate,LastUpdateBy,NeedApproveFlag,ApprovedFlag,NetWeight
|
|
,OtherGroup1,OtherGroup2,OtherGroup3,OtherGroup4,DefaultDepartmentID,DefaultLocationID,ConfigurationFlag,ConfigurationTemplateID,BOMLatestRevNo
|
|
,UMID_New,PartNo_Base,UMID_ConvertFactor
|
|
</sql>
|
|
|
|
<select id="searchPartList" resultType="com.xjfast.entity.vo.PartVo"
|
|
parameterType="com.xjfast.entity.query.PartQuery">
|
|
SELECT
|
|
p.*,
|
|
pg.GroupName as groupName
|
|
FROM
|
|
Part p
|
|
LEFT JOIN PartGroup pg on (p.GroupID = pg.GroupID and p.Site = pg.Site)
|
|
<where>
|
|
<if test="site != null and site != ''">
|
|
and p.site = #{site}
|
|
</if>
|
|
<if test="parttypeDb != null and parttypeDb != ''">
|
|
and p.PartType_DB = #{parttypeDb}
|
|
</if>
|
|
<if test="active != null and active != ''">
|
|
and p.active = #{active}
|
|
</if>
|
|
<if test="partno != null and partno != ''">
|
|
and p.partno like '%'+#{partno}+'%'
|
|
</if>
|
|
<if test="partdescription != null and partdescription != ''">
|
|
and p.partdescription like '%'+#{partdescription}+'%'
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="searchWhousePartList" resultType="com.xjfast.entity.Part"
|
|
parameterType="com.xjfast.entity.query.PartQuery">
|
|
SELECT
|
|
p.*
|
|
FROM
|
|
part p
|
|
LEFT JOIN InventoryStock ist on ist.PartNo = p.PartNo
|
|
LEFT JOIN WareHouse wh on wh.WareHouseID = ist.WarehouseID
|
|
|
|
<where>
|
|
<if test="warehouseid != null and warehouseid != ''">
|
|
and wh.WareHouseID = #{warehouseid}
|
|
</if>
|
|
<if test="site != null and site != ''">
|
|
and wh.Site = #{site}
|
|
</if>
|
|
|
|
</where>
|
|
|
|
|
|
</select>
|
|
<select id="searchPartWareHouseList" resultType="com.xjfast.entity.vo.PartVo"
|
|
parameterType="com.xjfast.entity.query.PartQuery">
|
|
SELECT
|
|
p.*,
|
|
wh.WareHouseName
|
|
FROM
|
|
part p
|
|
LEFT JOIN WareHouse wh ON ( wh.WareHouseID = p.DefaultWarehouseID )
|
|
<where>
|
|
<if test="othergroup2 != null and othergroup2 != ''">
|
|
p.OtherGroup2 = #{othergroup2}
|
|
</if>
|
|
<if test="warehousename != null and warehousename != ''">
|
|
and wh.WareHouseName like '%'+#{warehousename}+'%'
|
|
</if>
|
|
<if test="othergroup2 != null and othergroup2 != ''">
|
|
and p.PartDescription like '%'+#{partdescription}+'%'
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</mapper>
|