<?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="org.jeecg.modules.spare.mapper.SparePartPurchaseStorageDetailMapper">
|
|
<select id="getSparePartPurchaseStorageDeatilList" parameterType="Map" resultType="Map">
|
SELECT
|
t1.id,
|
t1.spare_part_id AS sparePartId,
|
t2.num,
|
t2.name,
|
t2.model,
|
t2.specification,
|
t1.main_unit_id as mainUnitId,
|
t3.name as mainUnitName,
|
t1.auxiliary_unit_id as auxiliaryUnitId,
|
t4.name as auxiliaryUnitName,
|
t5.name as constructorName,
|
t1.constructor_id as constructorId,
|
t1.main_quantity as mainQuantity,
|
t1.auxiliary_quantity AS auxiliaryQuantity,
|
t1.batch_num as batchNum,
|
t1.manufacture_date as manufactureDate,
|
t2.conversion_ratio as conversionRatio,
|
t1.supplier_id as supplierId,
|
t1.warehouse_id as warehouseId,
|
t1.warehouse_area_id AS warehouseAreaId,
|
t9.name as warehouseAreaName,
|
t1.warehouse_location_id AS warehouseLocationId,
|
t10.num as warehouseLocationNum
|
FROM
|
mom_eam_spare_part_purchase_storage_detail t1
|
LEFT JOIN mom_eam_spare_part t2 on t1.spare_part_id = t2.id
|
LEFT JOIN mom_base_unit t3 ON t1.main_unit_id = t3.id
|
left join mom_base_unit t4 on t1.auxiliary_unit_id = t4.id
|
left join mom_base_constructor t5 on t1.constructor_id = t5.id
|
left join mom_base_warehouse t8 on t1.warehouse_id = t8.id
|
left join mom_base_warehouse_area t9 on t1.warehouse_area_id = t9.id
|
left join mom_base_warehouse_location t10 on t1.warehouse_location_id = t10.id
|
WHERE t1.del_flag = '0'
|
<if test="sparePartPurchaseStorageId != null and sparePartPurchaseStorageId != ''">
|
and t1.spare_part_purchase_storage_id = #{sparePartPurchaseStorageId}
|
</if>
|
ORDER BY t1.create_time desc
|
</select>
|
|
<select id="getSparePartPurchaseStorageDeatilsById" parameterType="Map" resultType="Map">
|
SELECT
|
t1.id,
|
t1.spare_part_id AS sparePartId,
|
t2.num,
|
t2.name,
|
t2.model,
|
t2.specification,
|
t1.main_unit_id as mainUnitId,
|
t3.name as mainUnitName,
|
t1.auxiliary_unit_id as auxiliaryUnitId,
|
t4.name as auxiliaryUnitName,
|
t5.name as constructorName,
|
t1.constructor_id as constructorId,
|
t1.main_quantity as mainQuantity,
|
t1.auxiliary_quantity AS auxiliaryQuantity,
|
t1.batch_num as batchNum,
|
t1.manufacture_date as manufactureDate,
|
t2.conversion_ratio as conversionRatio,
|
t6.status as purchaseStorageStatus,
|
t1.status,
|
t1.spare_part_purchase_storage_id as sparePartPurchaseStorageId,
|
t1.supplier_id as supplierId,
|
t7.name as supplierName,
|
t1.warehouse_id as warehouseId,
|
t8.name as warehouseName,
|
t1.warehouse_area_id AS warehouseAreaId,
|
t9.name as warehouseAreaName,
|
t1.warehouse_location_id AS warehouseLocationId,
|
t10.num as warehouseLocationNum
|
FROM
|
mom_eam_spare_part_purchase_storage_detail t1
|
LEFT JOIN mom_eam_spare_part t2 on t1.spare_part_id = t2.id
|
LEFT JOIN mom_base_unit t3 ON t1.main_unit_id = t3.id
|
left join mom_base_unit t4 on t1.auxiliary_unit_id = t4.id
|
left join mom_base_constructor t5 on t1.constructor_id = t5.id
|
left join mom_eam_spare_part_purchase_storage t6 on t1.spare_part_purchase_storage_id = t6.id
|
left join mom_base_supplier t7 on t1.supplier_id = t7.id
|
left join mom_base_warehouse t8 on t1.warehouse_id = t8.id
|
left join mom_base_warehouse_area t9 on t1.warehouse_area_id = t9.id
|
left join mom_base_warehouse_location t10 on t1.warehouse_location_id = t10.id
|
WHERE t1.del_flag = '0'
|
<if test="params.sparePartPurchaseStorageId != null and params.sparePartPurchaseStorageId != ''">
|
and t1.spare_part_purchase_storage_id = #{params.sparePartPurchaseStorageId}
|
</if>
|
ORDER BY t1.create_time desc
|
</select>
|
|
<select id="getWarehouseAreas" parameterType="Map" resultType="org.jeecg.modules.spare.vo.WarehouseAreaVo">
|
SELECT
|
id AS value,
|
NAME AS title,
|
NAME AS text
|
FROM
|
mom_base_warehouse_area
|
WHERE del_flag = '0'
|
<if test="warehouseId != null and warehouseId != ''">
|
and warehouse_id = #{warehouseId}
|
</if>
|
</select>
|
|
<select id="getWarehouseLocations" parameterType="Map" resultType="org.jeecg.modules.spare.vo.WarehouseLocationVo">
|
SELECT
|
id AS value,
|
num AS title,
|
num AS text
|
FROM
|
mom_base_warehouse_location
|
WHERE del_flag = '0'
|
<if test="warehouseId != null and warehouseId != ''">
|
and warehouse_id = #{warehouseId}
|
</if>
|
<if test="warehouseAreaId != null and warehouseAreaId != ''">
|
and warehouse_area_id = #{warehouseAreaId}
|
</if>
|
</select>
|
|
</mapper>
|