|
@@ -102,8 +102,121 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
<include refid="orderBy"></include>
|
|
|
- <if test="orderField == null ">
|
|
|
+ <if test="orderField == null">
|
|
|
order by "insertTimee" desc
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+<!-- 查询销售统计报表 -->
|
|
|
+ <select id="getAllSaleReport" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from (
|
|
|
+ select OO.ORDER_NUMBER "orderNumber",
|
|
|
+ RC.CAPACITY_NUMBER "capacityNumber",
|
|
|
+ TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
|
|
|
+ TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
|
|
|
+ TWR.RESULT_TARE_WEIGHT "resultTareWeight",
|
|
|
+ TLR.RESULT_LOAD_END_TIME "resultLoadEndTime",
|
|
|
+ RW.WAREHOUSE_NAME "warehouseName",
|
|
|
+ TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
|
|
|
+ TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
|
|
|
+ TWR.RESULT_NET_WEIGHT "resultNetWeight",
|
|
|
+ TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime"
|
|
|
+ from OMSTRUCK_ORDER OO
|
|
|
+ join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
+ on TTR.ORDER_ID = OO.ORDER_ID
|
|
|
+ join TMSTRUCK_LOAD_RESULT TLR
|
|
|
+ on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ join RMS_WAREHOUSE RW
|
|
|
+ on RW.WAREHOUSE_ID = TLR.LOADING_ID
|
|
|
+ join TMSTRUCK_WEIGHT_RESULT TWR
|
|
|
+ on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ join TMSTRUCK_ENFACTORY_RESULT TER
|
|
|
+ on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
|
|
|
+ on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
+ join RMS_CAPACITY RC
|
|
|
+ on RC.CAPACITY_ID = OO.CAPACITY_ID
|
|
|
+ <if test="carrierSsoId != null">
|
|
|
+ join RMS_CARRIER RCA
|
|
|
+ on RCA.CARRIER_ID = RC.CARRIER_ID
|
|
|
+ </if>
|
|
|
+ where OO.ORDER_TYPE = 1
|
|
|
+ <if test="carrierSsoId != null">
|
|
|
+ and RCA.CARRIER_SSO_ID = #{carrierSsoId}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="orderNumber != null">
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "orderNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber != null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
|
|
|
+ "capacityNumber" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultEntryGateTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultEntryGateTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultTareWeightTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultTareWeightTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultTareWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultTareWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultLoadEndTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultLoadEndTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultLoadEndTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="warehouseName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
|
|
|
+ "warehouseName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultGrossWeightTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultGrossWeightTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultGrossWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultGrossWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultNetWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultNetWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultOutGateTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultOutGateTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultOutGateTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null">
|
|
|
+ order by "resultOutGateTime" desc, "resultEntryGateTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|