|
|
@@ -917,4 +917,55 @@
|
|
|
FETCH NEXT 1 ROWS ONLY
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getMaterial" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select t.prod_code_pk as "prodCodePk",
|
|
|
+ b.material_id as "materialId",
|
|
|
+ b.material_code as "prodCode",
|
|
|
+ b.material_name as "prodName",
|
|
|
+ b.material_model as "steelName",
|
|
|
+ t.create_emp as "createEmp",
|
|
|
+ t.create_time as "createTime",
|
|
|
+ b.material_specification as "specName",
|
|
|
+ nvl(substr(b.material_specification,
|
|
|
+ decode(instr(b.material_specification, '/'),
|
|
|
+ 0,
|
|
|
+ 100,
|
|
|
+ instr(b.material_specification, '/')) + 1),
|
|
|
+ 12) * b.material_theoretical_weight / 1000 as "weight"
|
|
|
+ from rms_material b
|
|
|
+ left join rms_material_map t
|
|
|
+ on t.prod_code_l = b.material_code
|
|
|
+ <where>
|
|
|
+ <if test="prodCode != null and prodCode != ''">
|
|
|
+ and t.prod_code = #{prodCode}
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null and materialId != ''">
|
|
|
+ and b.material_id = #{materialId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ union all
|
|
|
+ select '' as "prodCodePk",
|
|
|
+ b.material_id as "materialId",
|
|
|
+ b.material_code as "prodCode",
|
|
|
+ b.material_name as "prodName",
|
|
|
+ b.material_model as "steelName",
|
|
|
+ '' as "createEmp",
|
|
|
+ sysdate as "createTime",
|
|
|
+ b.material_specification as "specName",
|
|
|
+ nvl(substr(b.material_specification,
|
|
|
+ decode(instr(b.material_specification, '/'),
|
|
|
+ 0,
|
|
|
+ 100,
|
|
|
+ instr(b.material_specification, '/')) + 1),
|
|
|
+ 12) * b.material_theoretical_weight / 1000 as "weight"
|
|
|
+ from rms_material b
|
|
|
+ <where>
|
|
|
+ <if test="prodCode != null and prodCode != ''">
|
|
|
+ and t.prod_code = #{prodCode}
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null and materialId != ''">
|
|
|
+ and b.material_id = #{materialId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|