|
|
|
@ -32,6 +32,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
|
<result property="sapFactoryCode" column="sap_factory_code" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
|
|
|
|
|
<!--附属表-->
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="primaryCode" column="primary_code" />
|
|
|
|
|
<result property="ownEquipmentName" column="own_equipment_name" />
|
|
|
|
|
<result property="unitQuantity" column="unit_quantity" />
|
|
|
|
|
<result property="safeStock" column="safe_stock" />
|
|
|
|
|
<result property="unitPrice" column="unit_price" />
|
|
|
|
|
<result property="procurementMethod" column="procurement_method" />
|
|
|
|
|
<result property="procurementCycle" column="procurement_cycle" />
|
|
|
|
|
<result property="openingBalance" column="opening_balance" />
|
|
|
|
|
<result property="outputRecords" column="output_records" />
|
|
|
|
|
<result property="inputRecords" column="input_records" />
|
|
|
|
|
<result property="endInventory" column="end_inventory" />
|
|
|
|
|
<result property="endMoney" column="end_money" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
|
<result property="substituteParts" column="substitute_parts" />
|
|
|
|
|
<result property="ownEquipmentCode" column="own_equipment_code" />
|
|
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectSparePartsLedgerVo">
|
|
|
|
@ -67,53 +87,99 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectSparePartsLedgerList" parameterType="SparePartsLedger" resultMap="SparePartsLedgerResult">
|
|
|
|
|
<include refid="selectSparePartsLedgerVo"/>
|
|
|
|
|
select
|
|
|
|
|
womsn.storage_id,
|
|
|
|
|
womsn.storage_type,
|
|
|
|
|
womsn.material_code,
|
|
|
|
|
womsn.material_desc,
|
|
|
|
|
womsn.amount,
|
|
|
|
|
womsn.storage_amount,
|
|
|
|
|
womsn.sap_factory_code,
|
|
|
|
|
womsn.wl_name,
|
|
|
|
|
womsn.del_flag,
|
|
|
|
|
womsn.spare_use_life,
|
|
|
|
|
womsn.spare_name,
|
|
|
|
|
womsn.spare_mode,
|
|
|
|
|
womsn.spare_manufacturer,
|
|
|
|
|
womsn.spare_supplier,
|
|
|
|
|
womsn.spare_replacement_cycle,
|
|
|
|
|
womsn.spare_measurement_unit,
|
|
|
|
|
womsn.spare_conversion_unit,
|
|
|
|
|
womsn.spare_conversion_ratio,
|
|
|
|
|
womsn.spare_inventory_floor,
|
|
|
|
|
womsn.spare_inventory_upper,
|
|
|
|
|
womsn.spare_type,
|
|
|
|
|
womsn.create_by,
|
|
|
|
|
womsn.gmt_create,
|
|
|
|
|
womsn.last_modified_by,
|
|
|
|
|
womsn.gmt_modified,
|
|
|
|
|
womsn.active_flag,
|
|
|
|
|
womsn.factory_code,
|
|
|
|
|
womsna.id,
|
|
|
|
|
womsna.primary_code,
|
|
|
|
|
womsna.own_equipment_name,
|
|
|
|
|
womsna.unit_quantity,
|
|
|
|
|
womsna.safe_stock,
|
|
|
|
|
womsna.unit_price,
|
|
|
|
|
womsna.procurement_method,
|
|
|
|
|
womsna.procurement_cycle,
|
|
|
|
|
womsna.opening_balance,
|
|
|
|
|
womsna.output_records,
|
|
|
|
|
womsna.input_records,
|
|
|
|
|
womsna.end_inventory,
|
|
|
|
|
womsna.end_money,
|
|
|
|
|
womsna.substitute_parts,
|
|
|
|
|
womsna.own_equipment_code
|
|
|
|
|
from wms_ods_mate_storage_news womsn
|
|
|
|
|
left join wms_ods_mate_storage_news_attached womsna on womsn.material_code = womsna.primary_code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="storageId != null and storageId != ''"> and storage_id = #{storageId}</if>
|
|
|
|
|
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
|
|
|
|
|
<if test="regionCode != null and regionCode != ''"> and region_code = #{regionCode}</if>
|
|
|
|
|
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
|
|
|
|
|
<if test="storageType != null and storageType != ''"> and storage_type = #{storageType}</if>
|
|
|
|
|
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''"> and material_desc like concat('%', #{materialDesc}, '%')</if>
|
|
|
|
|
<if test="amount != null "> and amount = #{amount}</if>
|
|
|
|
|
<if test="storageAmount != null "> and storage_amount = #{storageAmount}</if>
|
|
|
|
|
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
|
|
|
|
|
<if test="lpn != null and lpn != ''"> and lpn = #{lpn}</if>
|
|
|
|
|
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
|
|
|
|
|
<if test="receiveDate != null "> and receive_date = #{receiveDate}</if>
|
|
|
|
|
<if test="productDate != null "> and product_date = #{productDate}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''"> and user_defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''"> and user_defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''"> and user_defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''"> and user_defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''"> and user_defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''"> and user_defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''"> and user_defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''"> and user_defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''"> and user_defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''"> and user_defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if>
|
|
|
|
|
<if test="lastModifiedBy != null and lastModifiedBy != ''"> and last_modified_by = #{lastModifiedBy}</if>
|
|
|
|
|
<if test="gmtModified != null "> and gmt_modified = #{gmtModified}</if>
|
|
|
|
|
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="sapFactoryCode != null and sapFactoryCode != ''"> and sap_factory_code = #{sapFactoryCode}</if>
|
|
|
|
|
<if test="wlName != null and wlName != ''"> and wl_name like concat('%', #{wlName}, '%')</if>
|
|
|
|
|
<if test="spareUseLife != null and spareUseLife != ''"> and spare_use_life = #{spareUseLife}</if>
|
|
|
|
|
<if test="spareName != null and spareName != ''"> and spare_name like concat('%', #{spareName}, '%')</if>
|
|
|
|
|
<if test="spareMode != null and spareMode != ''"> and spare_mode like concat('%', #{spareMode}, '%')</if>
|
|
|
|
|
<if test="spareManufacturer != null and spareManufacturer != ''"> and spare_manufacturer = #{spareManufacturer}</if>
|
|
|
|
|
<if test="spareSupplier != null and spareSupplier != ''"> and spare_supplier = #{spareSupplier}</if>
|
|
|
|
|
<if test="spareReplacementCycle != null and spareReplacementCycle != ''"> and spare_replacement_cycle = #{spareReplacementCycle}</if>
|
|
|
|
|
<if test="spareMeasurementUnit != null and spareMeasurementUnit != ''"> and spare_measurement_unit = #{spareMeasurementUnit}</if>
|
|
|
|
|
<if test="spareConversionUnit != null and spareConversionUnit != ''"> and spare_conversion_unit = #{spareConversionUnit}</if>
|
|
|
|
|
<if test="spareConversionRatio != null and spareConversionRatio != ''"> and spare_conversion_ratio = #{spareConversionRatio}</if>
|
|
|
|
|
<if test="spareInventoryFloor != null and spareInventoryFloor != ''"> and spare_inventory_floor = #{spareInventoryFloor}</if>
|
|
|
|
|
<if test="spareInventoryUpper != null and spareInventoryUpper != ''"> and spare_inventory_upper = #{spareInventoryUpper}</if>
|
|
|
|
|
<if test="spareType != null and spareType != ''"> and spare_type = #{spareType}</if>
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
<if test="storageId != null and storageId != ''"> and womsn.storage_id = #{storageId}</if>
|
|
|
|
|
<if test="whCode != null and whCode != ''"> and womsn.wh_code = #{whCode}</if>
|
|
|
|
|
<if test="regionCode != null and regionCode != ''"> and womsn.region_code = #{regionCode}</if>
|
|
|
|
|
<if test="waCode != null and waCode != ''"> and womsn.wa_code = #{waCode}</if>
|
|
|
|
|
<if test="storageType != null and storageType != ''"> and womsn.storage_type = #{storageType}</if>
|
|
|
|
|
<if test="wlCode != null and wlCode != ''"> and womsn.wl_code = #{wlCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and womsn.material_code like concat('%', #{materialCode}, '%')</if>
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''"> and womsn.material_desc like concat('%', #{materialDesc}, '%')</if>
|
|
|
|
|
<if test="amount != null "> and womsn.amount = #{amount}</if>
|
|
|
|
|
<if test="storageAmount != null "> and womsn.storage_amount = #{storageAmount}</if>
|
|
|
|
|
<if test="occupyAmount != null "> and womsn.occupy_amount = #{occupyAmount}</if>
|
|
|
|
|
<if test="lpn != null and lpn != ''"> and womsn.lpn = #{lpn}</if>
|
|
|
|
|
<if test="productBatch != null and productBatch != ''"> and womsn.product_batch = #{productBatch}</if>
|
|
|
|
|
<if test="receiveDate != null "> and womsn.receive_date = #{receiveDate}</if>
|
|
|
|
|
<if test="productDate != null "> and womsn.product_date = #{productDate}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''"> and womsn.user_defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''"> and womsn.user_defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''"> and womsn.user_defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''"> and womsn.user_defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''"> and womsn.user_defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''"> and womsn.user_defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''"> and womsn.user_defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''"> and womsn.user_defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''"> and womsn.user_defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''"> and womsn.user_defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="gmtCreate != null "> and womsn.gmt_create = #{gmtCreate}</if>
|
|
|
|
|
<if test="lastModifiedBy != null and lastModifiedBy != ''"> and womsn.last_modified_by = #{lastModifiedBy}</if>
|
|
|
|
|
<if test="gmtModified != null "> and womsn.gmt_modified = #{gmtModified}</if>
|
|
|
|
|
<if test="activeFlag != null and activeFlag != ''"> and womsn.active_flag = #{activeFlag}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and womsn.factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="sapFactoryCode != null and sapFactoryCode != ''"> and womsn.sap_factory_code = #{sapFactoryCode}</if>
|
|
|
|
|
<if test="wlName != null and wlName != ''"> and womsn.wl_name like concat('%', #{wlName}, '%')</if>
|
|
|
|
|
<if test="spareUseLife != null and spareUseLife != ''"> and womsn.spare_use_life = #{spareUseLife}</if>
|
|
|
|
|
<if test="spareName != null and spareName != ''"> and womsn.spare_name like concat('%', #{spareName}, '%')</if>
|
|
|
|
|
<if test="spareMode != null and spareMode != ''"> and womsn.spare_mode like concat('%', #{spareMode}, '%')</if>
|
|
|
|
|
<if test="spareManufacturer != null and spareManufacturer != ''"> and womsn.spare_manufacturer = #{spareManufacturer}</if>
|
|
|
|
|
<if test="spareSupplier != null and spareSupplier != ''"> and womsn.spare_supplier like concat('%', #{spareSupplier}, '%')</if>
|
|
|
|
|
<if test="spareReplacementCycle != null and spareReplacementCycle != ''"> and womsn.spare_replacement_cycle = #{spareReplacementCycle}</if>
|
|
|
|
|
<if test="spareMeasurementUnit != null and spareMeasurementUnit != ''"> and womsn.spare_measurement_unit = #{spareMeasurementUnit}</if>
|
|
|
|
|
<if test="spareConversionUnit != null and spareConversionUnit != ''"> and womsn.spare_conversion_unit = #{spareConversionUnit}</if>
|
|
|
|
|
<if test="spareConversionRatio != null and spareConversionRatio != ''"> and womsn.spare_conversion_ratio = #{spareConversionRatio}</if>
|
|
|
|
|
<if test="spareInventoryFloor != null and spareInventoryFloor != ''"> and womsn.spare_inventory_floor = #{spareInventoryFloor}</if>
|
|
|
|
|
<if test="spareInventoryUpper != null and spareInventoryUpper != ''"> and womsn.spare_inventory_upper = #{spareInventoryUpper}</if>
|
|
|
|
|
<if test="spareType != null and spareType != ''"> and womsn.spare_type = #{spareType}</if>
|
|
|
|
|
|
|
|
|
|
<if test="ownEquipmentName != null and ownEquipmentName != ''"> and womsna.own_equipment_name like concat('%', #{ownEquipmentName}, '%')</if>
|
|
|
|
|
and womsn.del_flag = '0'
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|