|
@@ -1061,4 +1061,70 @@
|
|
|
SET RESULT_STATUS = 1
|
|
|
WHERE RESULT_ID = #{resultId}
|
|
|
</update>
|
|
|
+
|
|
|
+ <select id="getWmsOutboundResultStatistics" resultType="java.util.Map">
|
|
|
+ select * from(
|
|
|
+ SELECT count(material_furnace_number) "coun",
|
|
|
+ sum (rms.MATERIAL_THEORETICAL_WEIGHT) "theoreticalWeight",
|
|
|
+ material_furnace_number "furnaceNumber",
|
|
|
+ rm.MATERIAL_NAME || rm.MATERIAL_SPECIFICATION || '(' ||
|
|
|
+ rm.MATERIAL_MODEL || ')' "materialName"
|
|
|
+ FROM WMSP_GRID_MATERIAL wgm
|
|
|
+ left join rms_material_steel rms
|
|
|
+ on rms.material_steel_id=wgm.MATERIAL_ID
|
|
|
+ left join RMS_MATERIAL rm
|
|
|
+ on rm.MATERIAL_ID = rms.MATERIAL_ID
|
|
|
+ left join RMS_PWAREHOUSE_GRID rpg
|
|
|
+ on rpg.GRID_ID = wgm.GRID_ID
|
|
|
+ WHERE wgm.DELETED = 1 and wgm.UPDATE_TIME is not null
|
|
|
+ and rpg.WAREHOUSE_ID = #{warehouseId}
|
|
|
+ <if test="oneDate != null and (con ==null || con == '') ">
|
|
|
+ and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') < = wgm.update_time
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= wgm.update_time
|
|
|
+ and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= wgm.update_time
|
|
|
+ </if>
|
|
|
+ <if test="con!=null">
|
|
|
+ and material_furnace_number like #{con}
|
|
|
+ </if>
|
|
|
+ group by material_furnace_number,rm.MATERIAL_NAME || rm.MATERIAL_SPECIFICATION || '(' ||
|
|
|
+ rm.MATERIAL_MODEL || ')'
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="coun != null">
|
|
|
+ and
|
|
|
+ <foreach collection="coun" item="item" open="(" separator="or" close=")">
|
|
|
+ "coun" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="theoreticalWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="theoreticalWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "theoreticalWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="furnaceNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="furnaceNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "furnaceNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="materialName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+ <sql id="orderBy">
|
|
|
+ <if test="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
</mapper>
|