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.
220 lines
15 KiB
220 lines
15 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.ruoyi.system.mapper.SysRawMaterialMapper">
|
|
|
|
<resultMap type="SysRawMaterial" id="SysRawMaterialResult">
|
|
<result property="rawMaterialId" column="raw_material_id" />
|
|
<result property="rawMaterialCode" column="raw_material_code" />
|
|
<result property="materialCategory" column="material_category" />
|
|
<result property="rawMaterialColour" column="raw_material_colour" />
|
|
<result property="typeMachine" column="type_machine" />
|
|
<result property="rawMaterialName" column="raw_material_name" />
|
|
<result property="specificationModel" column="specification_model" />
|
|
<result property="inventoryUnit" column="inventory_unit" />
|
|
<result property="exportSales" column="export_sales" />
|
|
<result property="purchasingUnit" column="purchasing_unit" />
|
|
<result property="purchasePrice" column="purchase_price" />
|
|
<result property="limitCollectionAmount" column="limit_collection_amount" />
|
|
<result property="stockUnitWeight" column="stock_unit_weight" />
|
|
<result property="safetyStock" column="safety_stock" />
|
|
<result property="purchaseLeadTime" column="purchase_lead_time" />
|
|
<result property="specialUse" column="special_use" />
|
|
<result property="whetherStop" column="whether_stop" />
|
|
<result property="createrName" column="creater_name" />
|
|
<result property="limitWhether" column="limit_whether" />
|
|
<result property="dedicatedWhether" column="dedicated_whether" />
|
|
<result property="minimumBatchSize" column="minimum_batch_size" />
|
|
<result property="whetherSemiManufactures" column="whether_semi_manufactures" />
|
|
<result property="customsName" column="customs_name" />
|
|
<result property="supplierNumber" column="supplier_number" />
|
|
<result property="rawMaterialDiameter" column="raw_material_diameter" />
|
|
<result property="supplierCode" column="supplier_code" />
|
|
<result property="supplierName" column="supplier_name" />
|
|
<result property="warehouseLocation" column="warehouse_location" />
|
|
<result property="purchaseEquivalent" column="purchase_equivalent" />
|
|
<result property="maximumPurchaseQuantity" column="maximum_purchase_quantity" />
|
|
<result property="costPrice" column="cost_price" />
|
|
<result property="primarySupplier" column="primary_supplier" />
|
|
<result property="subSupplier" column="sub_supplier" />
|
|
<result property="maximumInventory" column="Maximum_inventory" />
|
|
<result property="detentionDays" column="detention_days" />
|
|
<result property="gpItemSelection" column="gp_Item_selection" />
|
|
<result property="createrTime" column="creater_time" />
|
|
<result property="defaultWarehouse" column="default_warehouse" />
|
|
<result property="hsNumber" column="hs_number" />
|
|
<result property="firstAddTime" column="first_add_time" />
|
|
<result property="updateInfoTime" column="update_info_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSysRawMaterialVo">
|
|
select raw_material_id, raw_material_code, material_category, raw_material_colour, type_machine, raw_material_name, specification_model, inventory_unit, export_sales, purchasing_unit, purchase_price, limit_collection_amount, stock_unit_weight, safety_stock, purchase_lead_time, special_use, whether_stop, creater_name, limit_whether, dedicated_whether, minimum_batch_size, whether_semi_manufactures, customs_name, supplier_number, raw_material_diameter, supplier_code, supplier_name, warehouse_location, purchase_equivalent, maximum_purchase_quantity, cost_price, primary_supplier, sub_supplier, Maximum_inventory, detention_days, gp_Item_selection, creater_time, default_warehouse, hs_number, first_add_time, update_info_time from sys_raw_material
|
|
</sql>
|
|
|
|
<select id="selectSysRawMaterialList" parameterType="SysRawMaterial" resultMap="SysRawMaterialResult">
|
|
<include refid="selectSysRawMaterialVo"/>
|
|
<where>
|
|
<if test="rawMaterialCode != null and rawMaterialCode != ''"> and raw_material_code = #{rawMaterialCode}</if>
|
|
<if test="rawMaterialName != null and rawMaterialName != ''"> and raw_material_name like concat('%', #{rawMaterialName}, '%')</if>
|
|
<if test="whetherStop != null and whetherStop != ''"> and whether_stop = #{whetherStop}</if>
|
|
<if test="supplierNumber != null and supplierNumber != ''"> and supplier_number = #{supplierNumber}</if>
|
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
<if test="primarySupplier != null and primarySupplier != ''"> and primary_supplier = #{primarySupplier}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysRawMaterialById" parameterType="Long" resultMap="SysRawMaterialResult">
|
|
<include refid="selectSysRawMaterialVo"/>
|
|
where raw_material_id = #{rawMaterialId}
|
|
</select>
|
|
|
|
<select id="selectRawMaterialByCode" parameterType="String" resultMap="SysRawMaterialResult">
|
|
<include refid="selectSysRawMaterialVo"/>
|
|
where raw_material_code = #{rawMaterialCode}
|
|
</select>
|
|
|
|
<insert id="insertSysRawMaterial" parameterType="SysRawMaterial" useGeneratedKeys="true" keyProperty="rawMaterialId">
|
|
insert into sys_raw_material
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="rawMaterialCode != null">raw_material_code,</if>
|
|
<if test="materialCategory != null">material_category,</if>
|
|
<if test="rawMaterialColour != null">raw_material_colour,</if>
|
|
<if test="typeMachine != null">type_machine,</if>
|
|
<if test="rawMaterialName != null">raw_material_name,</if>
|
|
<if test="specificationModel != null">specification_model,</if>
|
|
<if test="inventoryUnit != null">inventory_unit,</if>
|
|
<if test="exportSales != null">export_sales,</if>
|
|
<if test="purchasingUnit != null">purchasing_unit,</if>
|
|
<if test="purchasePrice != null">purchase_price,</if>
|
|
<if test="limitCollectionAmount != null">limit_collection_amount,</if>
|
|
<if test="stockUnitWeight != null">stock_unit_weight,</if>
|
|
<if test="safetyStock != null">safety_stock,</if>
|
|
<if test="purchaseLeadTime != null">purchase_lead_time,</if>
|
|
<if test="specialUse != null">special_use,</if>
|
|
<if test="whetherStop != null">whether_stop,</if>
|
|
<if test="createrName != null">creater_name,</if>
|
|
<if test="limitWhether != null">limit_whether,</if>
|
|
<if test="dedicatedWhether != null">dedicated_whether,</if>
|
|
<if test="minimumBatchSize != null">minimum_batch_size,</if>
|
|
<if test="whetherSemiManufactures != null">whether_semi_manufactures,</if>
|
|
<if test="customsName != null">customs_name,</if>
|
|
<if test="supplierNumber != null">supplier_number,</if>
|
|
<if test="rawMaterialDiameter != null">raw_material_diameter,</if>
|
|
<if test="supplierCode != null">supplier_code,</if>
|
|
<if test="supplierName != null">supplier_name,</if>
|
|
<if test="warehouseLocation != null">warehouse_location,</if>
|
|
<if test="purchaseEquivalent != null">purchase_equivalent,</if>
|
|
<if test="maximumPurchaseQuantity != null">maximum_purchase_quantity,</if>
|
|
<if test="costPrice != null">cost_price,</if>
|
|
<if test="primarySupplier != null">primary_supplier,</if>
|
|
<if test="subSupplier != null">sub_supplier,</if>
|
|
<if test="maximumInventory != null">Maximum_inventory,</if>
|
|
<if test="detentionDays != null">detention_days,</if>
|
|
<if test="gpItemSelection != null">gp_Item_selection,</if>
|
|
<if test="createrTime != null">creater_time,</if>
|
|
<if test="defaultWarehouse != null">default_warehouse,</if>
|
|
<if test="hsNumber != null">hs_number,</if>
|
|
first_add_time
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="rawMaterialCode != null">#{rawMaterialCode},</if>
|
|
<if test="materialCategory != null">#{materialCategory},</if>
|
|
<if test="rawMaterialColour != null">#{rawMaterialColour},</if>
|
|
<if test="typeMachine != null">#{typeMachine},</if>
|
|
<if test="rawMaterialName != null">#{rawMaterialName},</if>
|
|
<if test="specificationModel != null">#{specificationModel},</if>
|
|
<if test="inventoryUnit != null">#{inventoryUnit},</if>
|
|
<if test="exportSales != null">#{exportSales},</if>
|
|
<if test="purchasingUnit != null">#{purchasingUnit},</if>
|
|
<if test="purchasePrice != null">#{purchasePrice},</if>
|
|
<if test="limitCollectionAmount != null">#{limitCollectionAmount},</if>
|
|
<if test="stockUnitWeight != null">#{stockUnitWeight},</if>
|
|
<if test="safetyStock != null">#{safetyStock},</if>
|
|
<if test="purchaseLeadTime != null">#{purchaseLeadTime},</if>
|
|
<if test="specialUse != null">#{specialUse},</if>
|
|
<if test="whetherStop != null">#{whetherStop},</if>
|
|
<if test="createrName != null">#{createrName},</if>
|
|
<if test="limitWhether != null">#{limitWhether},</if>
|
|
<if test="dedicatedWhether != null">#{dedicatedWhether},</if>
|
|
<if test="minimumBatchSize != null">#{minimumBatchSize},</if>
|
|
<if test="whetherSemiManufactures != null">#{whetherSemiManufactures},</if>
|
|
<if test="customsName != null">#{customsName},</if>
|
|
<if test="supplierNumber != null">#{supplierNumber},</if>
|
|
<if test="rawMaterialDiameter != null">#{rawMaterialDiameter},</if>
|
|
<if test="supplierCode != null">#{supplierCode},</if>
|
|
<if test="supplierName != null">#{supplierName},</if>
|
|
<if test="warehouseLocation != null">#{warehouseLocation},</if>
|
|
<if test="purchaseEquivalent != null">#{purchaseEquivalent},</if>
|
|
<if test="maximumPurchaseQuantity != null">#{maximumPurchaseQuantity},</if>
|
|
<if test="costPrice != null">#{costPrice},</if>
|
|
<if test="primarySupplier != null">#{primarySupplier},</if>
|
|
<if test="subSupplier != null">#{subSupplier},</if>
|
|
<if test="maximumInventory != null">#{maximumInventory},</if>
|
|
<if test="detentionDays != null">#{detentionDays},</if>
|
|
<if test="gpItemSelection != null">#{gpItemSelection},</if>
|
|
<if test="createrTime != null">#{createrTime},</if>
|
|
<if test="defaultWarehouse != null">#{defaultWarehouse},</if>
|
|
<if test="hsNumber != null">#{hsNumber},</if>
|
|
now(),
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysRawMaterial" parameterType="SysRawMaterial">
|
|
update sys_raw_material
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="rawMaterialCode != null">raw_material_code = #{rawMaterialCode},</if>
|
|
<if test="materialCategory != null">material_category = #{materialCategory},</if>
|
|
<if test="rawMaterialColour != null">raw_material_colour = #{rawMaterialColour},</if>
|
|
<if test="typeMachine != null">type_machine = #{typeMachine},</if>
|
|
<if test="rawMaterialName != null">raw_material_name = #{rawMaterialName},</if>
|
|
<if test="specificationModel != null">specification_model = #{specificationModel},</if>
|
|
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
|
|
<if test="exportSales != null">export_sales = #{exportSales},</if>
|
|
<if test="purchasingUnit != null">purchasing_unit = #{purchasingUnit},</if>
|
|
<if test="purchasePrice != null">purchase_price = #{purchasePrice},</if>
|
|
<if test="limitCollectionAmount != null">limit_collection_amount = #{limitCollectionAmount},</if>
|
|
<if test="stockUnitWeight != null">stock_unit_weight = #{stockUnitWeight},</if>
|
|
<if test="safetyStock != null">safety_stock = #{safetyStock},</if>
|
|
<if test="purchaseLeadTime != null">purchase_lead_time = #{purchaseLeadTime},</if>
|
|
<if test="specialUse != null">special_use = #{specialUse},</if>
|
|
<if test="whetherStop != null">whether_stop = #{whetherStop},</if>
|
|
<if test="createrName != null">creater_name = #{createrName},</if>
|
|
<if test="limitWhether != null">limit_whether = #{limitWhether},</if>
|
|
<if test="dedicatedWhether != null">dedicated_whether = #{dedicatedWhether},</if>
|
|
<if test="minimumBatchSize != null">minimum_batch_size = #{minimumBatchSize},</if>
|
|
<if test="whetherSemiManufactures != null">whether_semi_manufactures = #{whetherSemiManufactures},</if>
|
|
<if test="customsName != null">customs_name = #{customsName},</if>
|
|
<if test="supplierNumber != null">supplier_number = #{supplierNumber},</if>
|
|
<if test="rawMaterialDiameter != null">raw_material_diameter = #{rawMaterialDiameter},</if>
|
|
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
|
|
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
|
<if test="warehouseLocation != null">warehouse_location = #{warehouseLocation},</if>
|
|
<if test="purchaseEquivalent != null">purchase_equivalent = #{purchaseEquivalent},</if>
|
|
<if test="maximumPurchaseQuantity != null">maximum_purchase_quantity = #{maximumPurchaseQuantity},</if>
|
|
<if test="costPrice != null">cost_price = #{costPrice},</if>
|
|
<if test="primarySupplier != null">primary_supplier = #{primarySupplier},</if>
|
|
<if test="subSupplier != null">sub_supplier = #{subSupplier},</if>
|
|
<if test="maximumInventory != null">Maximum_inventory = #{maximumInventory},</if>
|
|
<if test="detentionDays != null">detention_days = #{detentionDays},</if>
|
|
<if test="gpItemSelection != null">gp_Item_selection = #{gpItemSelection},</if>
|
|
<if test="createrTime != null">creater_time = #{createrTime},</if>
|
|
<if test="defaultWarehouse != null">default_warehouse = #{defaultWarehouse},</if>
|
|
<if test="hsNumber != null">hs_number = #{hsNumber},</if>
|
|
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
|
|
</trim>
|
|
where raw_material_id = #{rawMaterialId}
|
|
</update>
|
|
|
|
<delete id="deleteSysRawMaterialById" parameterType="Long">
|
|
delete from sys_raw_material where raw_material_id = #{rawMaterialId}
|
|
</delete>
|
|
|
|
<delete id="deleteSysRawMaterialByIds" parameterType="String">
|
|
delete from sys_raw_material where raw_material_id in
|
|
<foreach item="rawMaterialId" collection="array" open="(" separator="," close=")">
|
|
#{rawMaterialId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|