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.

142 lines
8.3 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.xjfast.mapper.PartMapper">
  4. <resultMap id="BaseResultMap" type="com.xjfast.entity.Part">
  5. <id column="Part_PartNo" jdbcType="VARCHAR" property="partno"/>
  6. <id column="Part_Site" jdbcType="VARCHAR" property="site"/>
  7. <result column="Part_PartDescription" jdbcType="VARCHAR" property="partdescription"/>
  8. <result column="Part_Spec" jdbcType="VARCHAR" property="spec"/>
  9. <result column="Part_PartType_DB" jdbcType="CHAR" property="parttypeDb"/>
  10. <result column="Part_PartType" jdbcType="VARCHAR" property="parttype"/>
  11. <result column="Part_FamilyID" jdbcType="VARCHAR" property="familyid"/>
  12. <result column="Part_GroupID" jdbcType="VARCHAR" property="groupid"/>
  13. <result column="Part_UMID" jdbcType="VARCHAR" property="umid"/>
  14. <result column="Part_Active" jdbcType="CHAR" property="active"/>
  15. <result column="Part_Remark" jdbcType="VARCHAR" property="remark"/>
  16. <result column="Part_Stock" jdbcType="FLOAT" property="stock"/>
  17. <result column="Part_StockInArrive" jdbcType="FLOAT" property="stockinarrive"/>
  18. <result column="Part_StockInQuality" jdbcType="FLOAT" property="stockinquality"/>
  19. <result column="Part_StockInConsignment" jdbcType="FLOAT" property="stockinconsignment"/>
  20. <result column="Part_StockInPicking" jdbcType="FLOAT" property="stockinpicking"/>
  21. <result column="Part_StockinActive" jdbcType="FLOAT" property="stockinactive"/>
  22. <result column="Part_QtyonPO" jdbcType="FLOAT" property="qtyonpo"/>
  23. <result column="Part_MinStock" jdbcType="FLOAT" property="minstock"/>
  24. <result column="Part_MaxStock" jdbcType="FLOAT" property="maxstock"/>
  25. <result column="Part_SafetyStockManage" jdbcType="CHAR" property="safetystockmanage"/>
  26. <result column="Part_SafetyStock" jdbcType="FLOAT" property="safetystock"/>
  27. <result column="Part_StandardOrderQty" jdbcType="FLOAT" property="standardorderqty"/>
  28. <result column="Part_SupplierID" jdbcType="VARCHAR" property="supplierid"/>
  29. <result column="Part_AccountFamilyID" jdbcType="VARCHAR" property="accountfamilyid"/>
  30. <result column="Part_LatestPrice" jdbcType="FLOAT" property="latestprice"/>
  31. <result column="Part_AveragePrice" jdbcType="FLOAT" property="averageprice"/>
  32. <result column="Part_ActualCost" jdbcType="FLOAT" property="actualcost"/>
  33. <result column="Part_StandardCost" jdbcType="FLOAT" property="standardcost"/>
  34. <result column="Part_StandardCost_BasePrice" jdbcType="FLOAT" property="standardcostBaseprice"/>
  35. <result column="Part_LatestSalesPrice" jdbcType="FLOAT" property="latestsalesprice"/>
  36. <result column="Part_AverageSalesPrice" jdbcType="FLOAT" property="averagesalesprice"/>
  37. <result column="Part_FinanceCheck" jdbcType="CHAR" property="financecheck"/>
  38. <result column="Part_MRPCode" jdbcType="CHAR" property="mrpcode"/>
  39. <result column="Part_ManuLeadtime" jdbcType="FLOAT" property="manuleadtime"/>
  40. <result column="Part_DefaultWarehouseID" jdbcType="VARCHAR" property="defaultwarehouseid"/>
  41. <result column="Part_CodeNo" jdbcType="VARCHAR" property="codeno"/>
  42. <result column="Part_SubCodeNo" jdbcType="CHAR" property="subcodeno"/>
  43. <result column="Part_StandardLotSize" jdbcType="FLOAT" property="standardlotsize"/>
  44. <result column="Part_ExpireDateControlFlag" jdbcType="CHAR" property="expiredatecontrolflag"/>
  45. <result column="Part_ToExpireDays" jdbcType="FLOAT" property="toexpiredays"/>
  46. <result column="Part_CreateDate" jdbcType="TIMESTAMP" property="createdate"/>
  47. <result column="Part_LastUpdateBy" jdbcType="VARCHAR" property="lastupdateby"/>
  48. <result column="Part_NeedApproveFlag" jdbcType="CHAR" property="needapproveflag"/>
  49. <result column="Part_ApprovedFlag" jdbcType="CHAR" property="approvedflag"/>
  50. <result column="Part_NetWeight" jdbcType="FLOAT" property="netweight"/>
  51. <result column="Part_OtherGroup1" jdbcType="VARCHAR" property="othergroup1"/>
  52. <result column="Part_OtherGroup2" jdbcType="VARCHAR" property="othergroup2"/>
  53. <result column="Part_OtherGroup3" jdbcType="VARCHAR" property="othergroup3"/>
  54. <result column="Part_OtherGroup4" jdbcType="VARCHAR" property="othergroup4"/>
  55. <result column="Part_DefaultDepartmentID" jdbcType="VARCHAR" property="defaultdepartmentid"/>
  56. <result column="Part_DefaultLocationID" jdbcType="VARCHAR" property="defaultlocationid"/>
  57. <result column="Part_ConfigurationFlag" jdbcType="CHAR" property="configurationflag"/>
  58. <result column="Part_ConfigurationTemplateID" jdbcType="VARCHAR" property="configurationtemplateid"/>
  59. <result column="Part_BOMLatestRevNo" jdbcType="VARCHAR" property="bomlatestrevno"/>
  60. <result column="Part_UMID_New" jdbcType="VARCHAR" property="umidNew"/>
  61. <result column="Part_PartNo_Base" jdbcType="VARCHAR" property="partnoBase"/>
  62. <result column="Part_UMID_ConvertFactor" jdbcType="FLOAT" property="umidConvertfactor"/>
  63. </resultMap>
  64. <sql id="part_column">
  65. PartNo
  66. ,Site,PartDescription,Spec,PartType_DB,PartType,FamilyID,GroupID,UMID,Active,Remark,Stock,StockInArrive,StockInQuality,StockInConsignment
  67. ,StockInPicking,MinStock,MaxStock,SafetyStockManage,SafetyStock,StandardOrderQty,SupplierID,AccountFamilyID,LatestPrice,AveragePrice
  68. ,ActualCost,StandardCost,StandardCost_BasePrice,LatestSalesPrice,AverageSalesPrice,FinanceCheck,MRPCode,ManuLeadtime,DefaultWarehouseID
  69. ,CodeNo,SubCodeNo,StandardLotSize,ExpireDateControlFlag,ToExpireDays,CreateDate,LastUpdateBy,NeedApproveFlag,ApprovedFlag,NetWeight
  70. ,OtherGroup1,OtherGroup2,OtherGroup3,OtherGroup4,DefaultDepartmentID,DefaultLocationID,ConfigurationFlag,ConfigurationTemplateID,BOMLatestRevNo
  71. ,UMID_New,PartNo_Base,UMID_ConvertFactor
  72. </sql>
  73. <select id="searchPartList" resultType="com.xjfast.entity.vo.PartVo"
  74. parameterType="com.xjfast.entity.query.PartQuery">
  75. SELECT
  76. p.*,
  77. pg.GroupName as groupName
  78. FROM
  79. Part p
  80. LEFT JOIN PartGroup pg on (p.GroupID = pg.GroupID and p.Site = pg.Site)
  81. <where>
  82. <if test="site != null and site != ''">
  83. and p.site = #{site}
  84. </if>
  85. <if test="parttypeDb != null and parttypeDb != ''">
  86. and p.PartType_DB = #{parttypeDb}
  87. </if>
  88. <if test="active != null and active != ''">
  89. and p.active = #{active}
  90. </if>
  91. <if test="partno != null and partno != ''">
  92. and p.partno like '%'+#{partno}+'%'
  93. </if>
  94. <if test="partdescription != null and partdescription != ''">
  95. and p.partdescription like '%'+#{partdescription}+'%'
  96. </if>
  97. </where>
  98. </select>
  99. <select id="searchWhousePartList" resultType="com.xjfast.entity.Part"
  100. parameterType="com.xjfast.entity.query.PartQuery">
  101. SELECT
  102. p.*
  103. FROM
  104. part p
  105. LEFT JOIN InventoryStock ist on ist.PartNo = p.PartNo
  106. LEFT JOIN WareHouse wh on wh.WareHouseID = ist.WarehouseID
  107. <where>
  108. <if test="warehouseid != null and warehouseid != ''">
  109. and wh.WareHouseID = #{warehouseid}
  110. </if>
  111. <if test="site != null and site != ''">
  112. and wh.Site = #{site}
  113. </if>
  114. </where>
  115. </select>
  116. <select id="searchPartWareHouseList" resultType="com.xjfast.entity.vo.PartVo"
  117. parameterType="com.xjfast.entity.query.PartQuery">
  118. SELECT
  119. p.*,
  120. wh.WareHouseName
  121. FROM
  122. part p
  123. LEFT JOIN WareHouse wh ON ( wh.WareHouseID = p.DefaultWarehouseID )
  124. <where>
  125. <if test="othergroup2 != null and othergroup2 != ''">
  126. p.OtherGroup2 = #{othergroup2}
  127. </if>
  128. <if test="warehousename != null and warehousename != ''">
  129. and wh.WareHouseName like '%'+#{warehousename}+'%'
  130. </if>
  131. <if test="othergroup2 != null and othergroup2 != ''">
  132. and p.PartDescription like '%'+#{partdescription}+'%'
  133. </if>
  134. </where>
  135. </select>
  136. </mapper>