|
|
|
@ -16,7 +16,7 @@ |
|
|
|
|
<result column="material_class_code" property="materialClassCode"/> |
|
|
|
|
<result column="model" property="model"/> |
|
|
|
|
<result column="manufacturer_name" property="manufacturerName"/> |
|
|
|
|
<result column="sipplier_name" property="sipplierName"/> |
|
|
|
|
<result column="supplier_name" property="supplierName"/> |
|
|
|
|
<result column="warehouse" property="warehouse"/> |
|
|
|
|
<result column="inventory_count" property="inventoryCount"/> |
|
|
|
|
<result column="material_description" property="materialDescription"/> |
|
|
|
@ -37,31 +37,42 @@ |
|
|
|
|
select material_no from s_material where is_deleted = 0 |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="getDetailList" resultMap="materialResultMap"> |
|
|
|
|
<select id="getDetailList" resultType="org.energy.modules.spares.vo.MaterialVO"> |
|
|
|
|
select material_name, model |
|
|
|
|
-- ,b.warehouse_name |
|
|
|
|
,b.name as warehouse_name |
|
|
|
|
,inventory_count |
|
|
|
|
from s_material |
|
|
|
|
-- inner join ( |
|
|
|
|
-- select warehouse_name |
|
|
|
|
-- ,warehouse |
|
|
|
|
-- from warehouse |
|
|
|
|
-- where warehouse in (select warehouse from s_material where material_no = ${materialNo} and is_deleted = 0) |
|
|
|
|
-- ) as b |
|
|
|
|
-- on b.warehouse = s_material.warehouse |
|
|
|
|
where material_no = ${materialNo} and is_deleted = 0 |
|
|
|
|
inner join ( |
|
|
|
|
select code |
|
|
|
|
,name |
|
|
|
|
from spt_warehouse |
|
|
|
|
where code in (select warehouse from s_material where material_no = #{materialNo} and is_deleted = 0) |
|
|
|
|
) as b |
|
|
|
|
on b.code = s_material.warehouse |
|
|
|
|
where material_no = #{materialNo} and is_deleted = 0 |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="exportData" resultType="org.energy.modules.spares.excel.MaterialExcel"> |
|
|
|
|
SELECT material_no |
|
|
|
|
,CASE |
|
|
|
|
WHEN station = '1' THEN '景和光伏' |
|
|
|
|
WHEN station = '2' THEN '北沙一光伏' |
|
|
|
|
WHEN station = '3' THEN '北沙二光伏' |
|
|
|
|
WHEN station = '4' THEN '达坂城风电一场' |
|
|
|
|
ELSE '' |
|
|
|
|
END AS station_ext |
|
|
|
|
,material_name, model, inventory_count, material_description |
|
|
|
|
FROM s_material ${ew.customSqlSegment} |
|
|
|
|
SELECT material_no, dic1.dict_value AS stationExt, material_name |
|
|
|
|
, model, inventory_count, material_description |
|
|
|
|
FROM s_material a |
|
|
|
|
LEFT JOIN sys_dict dic1 ON dic1.code = 'station' AND dic1.dict_key = a.station AND dic1.is_deleted = '0' |
|
|
|
|
WHERE a.is_deleted = 0 |
|
|
|
|
<if test="entity.materialNo != null and entity.materialNo != ''"> |
|
|
|
|
AND a.material_no LIKE #{entity.materialNo} |
|
|
|
|
</if> |
|
|
|
|
<if test="entity.station != null and entity.station != ''"> |
|
|
|
|
AND a.station = #{entity.station} |
|
|
|
|
</if> |
|
|
|
|
<if test="entity.materialName != null and entity.materialName != ''"> |
|
|
|
|
AND a.material_name LIKE #{entity.materialName} |
|
|
|
|
</if> |
|
|
|
|
<if test="entity.model != null and entity.model != ''"> |
|
|
|
|
AND a.model LIKE #{entity.model} |
|
|
|
|
</if> |
|
|
|
|
<if test="entity.inventoryCount != null and entity.inventoryCount != ''"> |
|
|
|
|
AND a.inventory_count LIKE #{entity.inventoryCount} |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
|