万材erp项目
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.
 
 
 
 

211 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.SysSubsidiaryMaterialMapper">
<resultMap type="SysSubsidiaryMaterial" id="SysSubsidiaryMaterialResult">
<result property="subsidiaryMaterialId" column="subsidiary_material_id" />
<result property="subsidiaryMaterialCode" column="subsidiary_material_code" />
<result property="hsNumber" column="hs_number" />
<result property="subsidiaryMaterialName" column="subsidiary_material_name" />
<result property="stockUnitWeight" column="stock_unit_weight" />
<result property="specificationModel" column="specification_model" />
<result property="inventoryUnit" column="inventory_unit" />
<result property="dedicatedWhether" column="dedicated_whether" />
<result property="customsName" column="customs_name" />
<result property="safetyStock" column="safety_stock" />
<result property="remarks" column="remarks" />
<result property="specialUse" column="special_use" />
<result property="whetherStop" column="whether_stop" />
<result property="supplierNumber" column="supplier_number" />
<result property="limitCollectionAmount" column="limit_collection_amount" />
<result property="subsidiaryMaterialCategory" column="subsidiary_material_category" />
<result property="defaultWarehouse" column="default_warehouse" />
<result property="warehouseLocation" column="warehouse_location" />
<result property="purchasePrice" column="purchase_price" />
<result property="purchaseLeadTime" column="purchase_lead_time" />
<result property="minimumBatchSize" column="minimum_batch_size" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="limitWhether" column="limit_whether" />
<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="exportSales" column="export_sales" />
<result property="createrName" column="creater_name" />
<result property="materialCategory" column="material_category" />
<result property="kesNumber" column="kes_number" />
<result property="typeMachine" column="type_machine" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
<result property="createrTime" column="creater_time" />
</resultMap>
<sql id="selectSysSubsidiaryMaterialVo">
select subsidiary_material_id, subsidiary_material_code, hs_number, subsidiary_material_name, stock_unit_weight, specification_model, inventory_unit, dedicated_whether, customs_name, safety_stock, remarks, special_use, whether_stop, supplier_number, limit_collection_amount, subsidiary_material_category, default_warehouse, warehouse_location, purchase_price, purchase_lead_time, minimum_batch_size, supplier_code, supplier_name, limit_whether, maximum_purchase_quantity, cost_price, primary_supplier, sub_supplier, maximum_inventory, detention_days, gp_Item_selection, export_sales, creater_name, material_category, kes_number, type_machine, first_add_time, update_info_time, creater_time from sys_subsidiary_material
</sql>
<select id="selectSysSubsidiaryMaterialList" parameterType="SysSubsidiaryMaterial" resultMap="SysSubsidiaryMaterialResult">
<include refid="selectSysSubsidiaryMaterialVo"/>
<where>
<if test="subsidiaryMaterialCode != null and subsidiaryMaterialCode != ''"> and subsidiary_material_code like concat('%', #{subsidiaryMaterialCode}, '%')</if>
<if test="subsidiaryMaterialName != null and subsidiaryMaterialName != ''"> and subsidiary_material_name like concat('%', #{subsidiaryMaterialName}, '%')</if>
<if test="whetherStop != null and whetherStop != ''"> and whether_stop like concat('%', #{whetherStop}, '%')</if>
<if test="supplierNumber != null and supplierNumber != ''"> and supplier_number = #{supplierNumber}</if>
<if test="primarySupplier != null and primarySupplier != ''"> and primary_supplier like concat('%', #{primarySupplier}, '%')</if>
</where>
</select>
<select id="selectSysSubsidiaryMaterialById" parameterType="Long" resultMap="SysSubsidiaryMaterialResult">
<include refid="selectSysSubsidiaryMaterialVo"/>
where subsidiary_material_id = #{subsidiaryMaterialId}
</select>
<select id="selectSysSubsidiaryMaterialByCode" parameterType="String" resultMap="SysSubsidiaryMaterialResult">
<include refid="selectSysSubsidiaryMaterialVo"/>
where subsidiary_material_code = #{subsidiaryMaterialCode}
</select>
<insert id="insertSysSubsidiaryMaterial" parameterType="SysSubsidiaryMaterial" useGeneratedKeys="true" keyProperty="subsidiaryMaterialId">
insert into sys_subsidiary_material
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subsidiaryMaterialCode != null">subsidiary_material_code,</if>
<if test="hsNumber != null">hs_number,</if>
<if test="subsidiaryMaterialName != null">subsidiary_material_name,</if>
<if test="stockUnitWeight != null">stock_unit_weight,</if>
<if test="specificationModel != null">specification_model,</if>
<if test="inventoryUnit != null">inventory_unit,</if>
<if test="dedicatedWhether != null">dedicated_whether,</if>
<if test="customsName != null">customs_name,</if>
<if test="safetyStock != null">safety_stock,</if>
<if test="remarks != null">remarks,</if>
<if test="specialUse != null">special_use,</if>
<if test="whetherStop != null">whether_stop,</if>
<if test="supplierNumber != null">supplier_number,</if>
<if test="limitCollectionAmount != null">limit_collection_amount,</if>
<if test="subsidiaryMaterialCategory != null">subsidiary_material_category,</if>
<if test="defaultWarehouse != null">default_warehouse,</if>
<if test="warehouseLocation != null">warehouse_location,</if>
<if test="purchasePrice != null">purchase_price,</if>
<if test="purchaseLeadTime != null">purchase_lead_time,</if>
<if test="minimumBatchSize != null">minimum_batch_size,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="limitWhether != null">limit_whether,</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="exportSales != null">export_sales,</if>
<if test="createrName != null">creater_name,</if>
<if test="materialCategory != null">material_category,</if>
<if test="kesNumber != null">kes_number,</if>
<if test="typeMachine != null">type_machine,</if>
<if test="createrTime != null">creater_time,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="subsidiaryMaterialCode != null">#{subsidiaryMaterialCode},</if>
<if test="hsNumber != null">#{hsNumber},</if>
<if test="subsidiaryMaterialName != null">#{subsidiaryMaterialName},</if>
<if test="stockUnitWeight != null">#{stockUnitWeight},</if>
<if test="specificationModel != null">#{specificationModel},</if>
<if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="dedicatedWhether != null">#{dedicatedWhether},</if>
<if test="customsName != null">#{customsName},</if>
<if test="safetyStock != null">#{safetyStock},</if>
<if test="remarks != null">#{remarks},</if>
<if test="specialUse != null">#{specialUse},</if>
<if test="whetherStop != null">#{whetherStop},</if>
<if test="supplierNumber != null">#{supplierNumber},</if>
<if test="limitCollectionAmount != null">#{limitCollectionAmount},</if>
<if test="subsidiaryMaterialCategory != null">#{subsidiaryMaterialCategory},</if>
<if test="defaultWarehouse != null">#{defaultWarehouse},</if>
<if test="warehouseLocation != null">#{warehouseLocation},</if>
<if test="purchasePrice != null">#{purchasePrice},</if>
<if test="purchaseLeadTime != null">#{purchaseLeadTime},</if>
<if test="minimumBatchSize != null">#{minimumBatchSize},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="limitWhether != null">#{limitWhether},</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="exportSales != null">#{exportSales},</if>
<if test="createrName != null">#{createrName},</if>
<if test="materialCategory != null">#{materialCategory},</if>
<if test="kesNumber != null">#{kesNumber},</if>
<if test="typeMachine != null">#{typeMachine},</if>
<if test="createrTime != null">#{createrTime},</if>
now(),
</trim>
</insert>
<update id="updateSysSubsidiaryMaterial" parameterType="SysSubsidiaryMaterial">
update sys_subsidiary_material
<trim prefix="SET" suffixOverrides=",">
<if test="subsidiaryMaterialCode != null">subsidiary_material_code = #{subsidiaryMaterialCode},</if>
<if test="hsNumber != null">hs_number = #{hsNumber},</if>
<if test="subsidiaryMaterialName != null">subsidiary_material_name = #{subsidiaryMaterialName},</if>
<if test="stockUnitWeight != null">stock_unit_weight = #{stockUnitWeight},</if>
<if test="specificationModel != null">specification_model = #{specificationModel},</if>
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
<if test="dedicatedWhether != null">dedicated_whether = #{dedicatedWhether},</if>
<if test="customsName != null">customs_name = #{customsName},</if>
<if test="safetyStock != null">safety_stock = #{safetyStock},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="specialUse != null">special_use = #{specialUse},</if>
<if test="whetherStop != null">whether_stop = #{whetherStop},</if>
<if test="supplierNumber != null">supplier_number = #{supplierNumber},</if>
<if test="limitCollectionAmount != null">limit_collection_amount = #{limitCollectionAmount},</if>
<if test="subsidiaryMaterialCategory != null">subsidiary_material_category = #{subsidiaryMaterialCategory},</if>
<if test="defaultWarehouse != null">default_warehouse = #{defaultWarehouse},</if>
<if test="warehouseLocation != null">warehouse_location = #{warehouseLocation},</if>
<if test="purchasePrice != null">purchase_price = #{purchasePrice},</if>
<if test="purchaseLeadTime != null">purchase_lead_time = #{purchaseLeadTime},</if>
<if test="minimumBatchSize != null">minimum_batch_size = #{minimumBatchSize},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="limitWhether != null">limit_whether = #{limitWhether},</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="exportSales != null">export_sales = #{exportSales},</if>
<if test="createrName != null">creater_name = #{createrName},</if>
<if test="materialCategory != null">material_category = #{materialCategory},</if>
<if test="kesNumber != null">kes_number = #{kesNumber},</if>
<if test="typeMachine != null">type_machine = #{typeMachine},</if>
<if test="createrTime != null">creater_time = #{createrTime},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where subsidiary_material_id = #{subsidiaryMaterialId}
</update>
<delete id="deleteSysSubsidiaryMaterialById" parameterType="Long">
delete from sys_subsidiary_material where subsidiary_material_id = #{subsidiaryMaterialId}
</delete>
<delete id="deleteSysSubsidiaryMaterialByIds" parameterType="String">
delete from sys_subsidiary_material where subsidiary_material_id in
<foreach item="subsidiaryMaterialId" collection="array" open="(" separator="," close=")">
#{subsidiaryMaterialId}
</foreach>
</delete>
</mapper>