|
@@ -326,7 +326,6 @@
|
|
|
<!-- 查询销售统计报表 -->
|
|
|
<!-- 查询销售统计报表 -->
|
|
|
<select id="getAllSaleReport" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
- select * from (
|
|
|
select
|
|
|
*
|
|
|
from (
|
|
@@ -354,7 +353,8 @@
|
|
|
RC2.CARRIER_NAME "carrierName",
|
|
|
TAR.RESULT_ARRIVAL_ADDRESS "arrivalAddress",
|
|
|
TRR.RESULT_ARRIVAL_ADDRESS "receiptAddress",
|
|
|
- CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
|
|
|
+ RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "materialCode",
|
|
|
+ RM.MATERIAL_NAME || TLR.INSERT_UPDATE_REMARK "likeRemark"
|
|
|
from TMSTRUCK_WEIGHT_RESULT TWR
|
|
|
left join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
@@ -397,7 +397,7 @@
|
|
|
on TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
|
|
|
left join TMStRUCK_RECEIPT_RESULT TRR
|
|
|
on TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
|
|
|
- WHERE OO.ORDER_TYPE = #{orderType}
|
|
|
+ WHERE OO.ORDER_TYPE = #{orderTypee}
|
|
|
AND ASO.SHIPPER_ID = #{shipperId}
|
|
|
<if test="carrierSsoId != null">
|
|
|
and RC2.CARRIER_SSO_ID = #{carrierSsoId}
|
|
@@ -412,104 +412,10 @@
|
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
</if>
|
|
|
- ) RRR
|
|
|
- <where>
|
|
|
- <if test="remark != null" >
|
|
|
- and RRR."materialName" LIKE #{remark} or RRR."materialRemark" LIKE #{remark}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
)
|
|
|
<where>
|
|
|
- <if test="orderNumber != null">
|
|
|
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
|
|
|
- "orderNumber" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="carrierName != null">
|
|
|
- <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
|
|
|
- "carrierName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="enGatepostName != null">
|
|
|
- <foreach collection="enGatepostName" item="item" open="(" separator="or" close=")">
|
|
|
- "enGatepostName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="outGatepostName != null">
|
|
|
- <foreach collection="outGatepostName" item="item" open="(" separator="or" close=")">
|
|
|
- "outGatepostName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="caseNumber != null">
|
|
|
- <foreach collection="caseNumber" item="item" open="(" separator="or" close=")">
|
|
|
- "caseNumber" 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="receiveName != null">
|
|
|
- and
|
|
|
- <foreach collection="receiveName" item="item" open="(" separator="or" close=")">
|
|
|
- "receiveName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="materialRemark != null">
|
|
|
- and
|
|
|
- <foreach collection="materialRemark" item="item" open="(" separator="or" close=")">
|
|
|
- "materialRemark" = #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sendName != null">
|
|
|
- and
|
|
|
- <foreach collection="sendName" item="item" open="(" separator="or" close=")">
|
|
|
- "sendName" 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 test="remark != null">
|
|
|
+ and "likeRemark" like #{remark}
|
|
|
</if>
|
|
|
<if test="materialName != null">
|
|
|
and
|
|
@@ -517,18 +423,6 @@
|
|
|
"materialName" 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">
|
|
@@ -562,6 +456,7 @@
|
|
|
RCON.CONSIGNEE_COMPANY_NAME "receiveName",
|
|
|
RS.SUPPLIER_NAME "sendName",
|
|
|
RM.MATERIAL_NAME "materialName",
|
|
|
+ RS.SUPPLIER_NAME||RM.MATERIAL_NAME||RC.CAPACITY_NUMBER "conLike",
|
|
|
CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
|
|
|
from OMSTRUCK_ORDER OO
|
|
|
join TMSTRUCK_TOTAL_RESULT TTR
|
|
@@ -611,10 +506,6 @@
|
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_TARE_WEIGHT_TIME
|
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_TARE_WEIGHT_TIME
|
|
|
</if>
|
|
|
- <if test="con!=null">
|
|
|
- where "receiveName" like #{con} or "sendName" like #{con} or "materialName" like #{con}
|
|
|
- or "capacityNumber" like #{con}
|
|
|
- </if>
|
|
|
<if test="userId!=null">
|
|
|
and ASO.INSERT_USERNAME=#{userId}
|
|
|
</if>
|
|
@@ -623,100 +514,8 @@
|
|
|
</if>
|
|
|
)
|
|
|
<where>
|
|
|
- <if test="receiveName != null">
|
|
|
- and
|
|
|
- <foreach collection="receiveName" item="item" open="(" separator="or" close=")">
|
|
|
- "receiveName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sendName != null">
|
|
|
- and
|
|
|
- <foreach collection="sendName" item="item" open="(" separator="or" close=")">
|
|
|
- "sendName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="materialName != null">
|
|
|
- and
|
|
|
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
- "materialName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <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=")">
|
|
|
- to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss') 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="resultEndTime != null">
|
|
|
- and
|
|
|
- <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">
|
|
|
- to_char("resultEndTime",'yyyy-mm-dd hh24:mi:ss') 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=")">
|
|
|
- to_char("resultGrossWeightTime",'yyyy-mm-dd hh24:mi:ss') 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>
|
|
|
- <if test="gatepostEntryName != null">
|
|
|
- and
|
|
|
- <foreach collection="gatepostEntryName" item="item" open="(" separator="or" close=")">
|
|
|
- "gatepostEntryName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="gatepostOutName != null">
|
|
|
- and
|
|
|
- <foreach collection="gatepostOutName" item="item" open="(" separator="or" close=")">
|
|
|
- "gatepostOutName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ <if test="con != null">
|
|
|
+ and "conLike" like #{con}
|
|
|
</if>
|
|
|
</where>
|
|
|
<include refid="orderBy"></include>
|
|
@@ -751,8 +550,8 @@
|
|
|
RCON.CONSIGNEE_COMPANY_NAME "receiveName",
|
|
|
RS.SUPPLIER_NAME "sendName",
|
|
|
RM.MATERIAL_NAME "materialName",
|
|
|
+ RCON.CONSIGNEE_COMPANY_NAME||RM.MATERIAL_NAME||RC.CAPACITY_NUMBER "conlike",
|
|
|
CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "materialCode"
|
|
|
-
|
|
|
from OMSTRUCK_ORDER OO
|
|
|
join TMSTRUCK_TOTAL_RESULT TTR
|
|
|
on TTR.ORDER_ID = OO.ORDER_ID
|
|
@@ -801,10 +600,6 @@
|
|
|
and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') <= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
|
|
|
</if>
|
|
|
- <if test="con!=null">
|
|
|
- where "receiveName" like #{con} or "sendName" like #{con} or "materialName" like #{con}
|
|
|
- or "capacityNumber" like #{con}
|
|
|
- </if>
|
|
|
<if test="userId!=null">
|
|
|
and ASO.INSERT_USERNAME=#{userId}
|
|
|
</if>
|
|
@@ -813,100 +608,8 @@
|
|
|
</if>
|
|
|
)
|
|
|
<where>
|
|
|
- <if test="receiveName != null">
|
|
|
- and
|
|
|
- <foreach collection="receiveName" item="item" open="(" separator="or" close=")">
|
|
|
- "receiveName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="sendName != null">
|
|
|
- and
|
|
|
- <foreach collection="sendName" item="item" open="(" separator="or" close=")">
|
|
|
- "sendName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="materialName != null">
|
|
|
- and
|
|
|
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
- "materialName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <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>
|
|
|
- <if test="gatepostEntryName != null">
|
|
|
- and
|
|
|
- <foreach collection="gatepostEntryName" item="item" open="(" separator="or" close=")">
|
|
|
- "gatepostEntryName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="gatepostOutName != null">
|
|
|
- and
|
|
|
- <foreach collection="gatepostOutName" item="item" open="(" separator="or" close=")">
|
|
|
- "gatepostOutName" like '%${item}%'
|
|
|
- </foreach>
|
|
|
+ <if test="con != null">
|
|
|
+ and "conlike" like #{con}
|
|
|
</if>
|
|
|
</where>
|
|
|
<include refid="orderBy"></include>
|