|
@@ -3899,7 +3899,9 @@
|
|
|
<select id="selectOldAndNew" parameterType="java.util.HashMap" resultType="HashMap">
|
|
<select id="selectOldAndNew" parameterType="java.util.HashMap" resultType="HashMap">
|
|
|
SELECT *
|
|
SELECT *
|
|
|
FROM (
|
|
FROM (
|
|
|
- select ACTUAL_NO,CAR_NO,
|
|
|
|
|
|
|
+ select ACTUAL_NO,
|
|
|
|
|
+ prediction_no,
|
|
|
|
|
+ CAR_NO,
|
|
|
GROSS_WEIGHT,
|
|
GROSS_WEIGHT,
|
|
|
BASE_SPOT1_NAME,
|
|
BASE_SPOT1_NAME,
|
|
|
GROSS_TIME,
|
|
GROSS_TIME,
|
|
@@ -3907,18 +3909,26 @@
|
|
|
BASE_SPOT2_NAME,
|
|
BASE_SPOT2_NAME,
|
|
|
TARE_TIME,
|
|
TARE_TIME,
|
|
|
NET_WEIGHT,
|
|
NET_WEIGHT,
|
|
|
|
|
+ net_spot3_no,
|
|
|
NET_SPOT3_NAME,
|
|
NET_SPOT3_NAME,
|
|
|
NET_TIME,
|
|
NET_TIME,
|
|
|
|
|
+ forwarding_unit_no,
|
|
|
FORWARDING_UNIT_NAME,
|
|
FORWARDING_UNIT_NAME,
|
|
|
|
|
+ receiving_uint_no,
|
|
|
RECEIVING_UINT_NAME,
|
|
RECEIVING_UINT_NAME,
|
|
|
|
|
+ matter_no,
|
|
|
MATTER_NAME,
|
|
MATTER_NAME,
|
|
|
- '新系统' REMARK from METER_WORK_CAR_ACTUAL
|
|
|
|
|
|
|
+ sender_remark,
|
|
|
|
|
+ '新系统' as REMARK
|
|
|
|
|
+ from METER_WORK_CAR_ACTUAL
|
|
|
where IS_PRE_SCALE='1'
|
|
where IS_PRE_SCALE='1'
|
|
|
- and VALUE_FLAG='1'
|
|
|
|
|
|
|
+ and VALUE_FLAG in ('1', '2')
|
|
|
and UPLOAD_FLAG='2'
|
|
and UPLOAD_FLAG='2'
|
|
|
- and NET_TIME > to_date('2022-01-01','YYYY-MM-DD')
|
|
|
|
|
|
|
+ and NET_TIME > to_date('2022-07-21','YYYY-MM-DD')
|
|
|
union
|
|
union
|
|
|
- select FS_WEIGHTNO as ACTUAL_NO,REPLACE(FS_CARNO,'-','') as CAR_NO,
|
|
|
|
|
|
|
+ select FS_WEIGHTNO as ACTUAL_NO,
|
|
|
|
|
+ fs_noticeId as prediction_no,
|
|
|
|
|
+ REPLACE(FS_CARNO,'-','') as CAR_NO,
|
|
|
FS_GROSSWEIGHT * 1000 as GROSS_WEIGHT,
|
|
FS_GROSSWEIGHT * 1000 as GROSS_WEIGHT,
|
|
|
FS_GROSSPOINTNAME as BASE_SPOT1_NAME,
|
|
FS_GROSSPOINTNAME as BASE_SPOT1_NAME,
|
|
|
FS_GROSSWEIGHTTIME as GROSS_TIME,
|
|
FS_GROSSWEIGHTTIME as GROSS_TIME,
|
|
@@ -3926,21 +3936,210 @@
|
|
|
FS_TAREPOINTNAME as BASE_SPOT2_NAME,
|
|
FS_TAREPOINTNAME as BASE_SPOT2_NAME,
|
|
|
FS_TAREWEIGHTTIME as TARE_TIME,
|
|
FS_TAREWEIGHTTIME as TARE_TIME,
|
|
|
FS_NETWEIGHT * 1000 as NET_WEIGHT,
|
|
FS_NETWEIGHT * 1000 as NET_WEIGHT,
|
|
|
|
|
+ fs_netPointId as net_spot3_no,
|
|
|
FS_NETPOINTNAME as NET_SPOT3_NAME,
|
|
FS_NETPOINTNAME as NET_SPOT3_NAME,
|
|
|
FS_NETWEIGHTTIME as NET_TIME,
|
|
FS_NETWEIGHTTIME as NET_TIME,
|
|
|
|
|
+ fs_sender as FORWARDING_UNIT_No,
|
|
|
FS_SENDERNAME as FORWARDING_UNIT_NAME,
|
|
FS_SENDERNAME as FORWARDING_UNIT_NAME,
|
|
|
|
|
+ fs_receiver as RECEIVING_UINT_No,
|
|
|
FS_RECEIVERNAME as RECEIVING_UINT_NAME,
|
|
FS_RECEIVERNAME as RECEIVING_UINT_NAME,
|
|
|
|
|
+ fs_material as matter_no,
|
|
|
FS_MATERIALNAME as MATTER_NAME,
|
|
FS_MATERIALNAME as MATTER_NAME,
|
|
|
- '老系统' REMARK
|
|
|
|
|
|
|
+ fs_senderRemark sender_remark,
|
|
|
|
|
+ '老系统' as REMARK
|
|
|
from jgweight.view_car_net @MCMS
|
|
from jgweight.view_car_net @MCMS
|
|
|
- where FS_NETWEIGHTTIME > to_date('2022-01-01','YYYY-MM-DD') AND FS_DELETEDTAG='N'
|
|
|
|
|
- ) A
|
|
|
|
|
- where 1 = 1
|
|
|
|
|
|
|
+ where FS_NETWEIGHTTIME > to_date('2022-07-21','YYYY-MM-DD') AND FS_DELETEDTAG='N'
|
|
|
|
|
+ )
|
|
|
|
|
+ where 1 = 1
|
|
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
|
|
+ and remark LIKE '%${remark}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="predictionNo != null and predictionNo != ''">
|
|
|
|
|
+ and prediction_no LIKE '%${predictionNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="senderRemark != null and senderRemark != ''">
|
|
|
|
|
+ and sender_remark LIKE '%${senderRemark}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
|
|
|
|
|
+ and net_time >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time <= TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="carNo != null and carNo != ''">
|
|
|
|
|
+ and car_no like '%${carNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="netSpot3No != null and netSpot3No != ''">
|
|
|
|
|
+ and net_spot3_no like '%${netSpot3No}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="netSpot3Name != null and netSpot3Name != ''">
|
|
|
|
|
+ and net_spot3_name like '%${netSpot3Name}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
|
|
|
|
|
+ and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="forwardingUnitName != null and forwardingUnitName != ''">
|
|
|
|
|
+ and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="receivingUintNo != null and receivingUintNo != ''">
|
|
|
|
|
+ and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="receivingUintName != null and receivingUintName != ''">
|
|
|
|
|
+ and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="matterNo != null and matterNo != ''">
|
|
|
|
|
+ and matter_no LIKE '%${matterNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="matterName != null and matterName != ''">
|
|
|
|
|
+ and matter_name LIKE '%${matterName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="doQueryFirstOldAndNew" parameterType="java.util.HashMap" resultType="HashMap">
|
|
|
|
|
+ select *
|
|
|
|
|
+ from (
|
|
|
|
|
+ select actual_first_no,
|
|
|
|
|
+ prediction_no,
|
|
|
|
|
+ car_no,
|
|
|
|
|
+ meter_weight,
|
|
|
|
|
+ create_time,
|
|
|
|
|
+ base_spot_no,
|
|
|
|
|
+ base_spot_name,
|
|
|
|
|
+ forwarding_unit_no,
|
|
|
|
|
+ forwarding_unit_name,
|
|
|
|
|
+ receiving_uint_no,
|
|
|
|
|
+ receiving_uint_name,
|
|
|
|
|
+ matter_no,
|
|
|
|
|
+ matter_name,
|
|
|
|
|
+ sender_remark,
|
|
|
|
|
+ '新系统' remark
|
|
|
|
|
+ from meter_work_car_actual_first
|
|
|
|
|
+ where is_pre_scale = '1'
|
|
|
|
|
+ and value_flag in ('1', '2')
|
|
|
|
|
+ and create_time > to_date('2022-07-21','YYYY-MM-DD')
|
|
|
|
|
+ union
|
|
|
|
|
+ (
|
|
|
|
|
+ select weightNo actual_first_no,
|
|
|
|
|
+ noticeId prediction_no,
|
|
|
|
|
+ replace(carNo, '-', '') car_no,
|
|
|
|
|
+ weight*1000 meter_weight,
|
|
|
|
|
+ weightTime create_time,
|
|
|
|
|
+ fs_pointId base_spot_no,
|
|
|
|
|
+ pointName base_spot_name,
|
|
|
|
|
+ sender forwarding_unit_no,
|
|
|
|
|
+ senderName forwarding_unit_name,
|
|
|
|
|
+ receiver receiving_uint_no,
|
|
|
|
|
+ receiverName receiving_uint_name,
|
|
|
|
|
+ material matter_no,
|
|
|
|
|
+ materialName matter_name,
|
|
|
|
|
+ senderRemark sender_remark,
|
|
|
|
|
+ '老系统' remark
|
|
|
|
|
+ from jgweight.VIEW_CAR_FIRST @MCMS
|
|
|
|
|
+ where weightTime > to_date('2022-07-21','YYYY-MM-DD') AND FS_DELETEDTAG='N')
|
|
|
|
|
+ ) A
|
|
|
|
|
+ where 1 = 1
|
|
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
|
|
+ and remark LIKE '%${remark}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="predictionNo != null and predictionNo != ''">
|
|
|
|
|
+ and prediction_no LIKE '%${predictionNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
|
|
|
|
|
+ and create_time >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and create_time <= TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="senderRemark != null and senderRemark != ''">
|
|
|
|
|
+ and sender_remark LIKE '%${senderRemark}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="carNo != null and carNo != ''">
|
|
|
|
|
+ and car_no like '%${carNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="baseSpotNo != null and baseSpotNo != ''">
|
|
|
|
|
+ and base_spot_no like '%${baseSpotNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="baseSpotName != null and baseSpotName != ''">
|
|
|
|
|
+ and base_spot_name like '%${baseSpotName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
|
|
|
|
|
+ and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="forwardingUnitName != null and forwardingUnitName != ''">
|
|
|
|
|
+ and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="receivingUintNo != null and receivingUintNo != ''">
|
|
|
|
|
+ and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="receivingUintName != null and receivingUintName != ''">
|
|
|
|
|
+ and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="matterNo != null and matterNo != ''">
|
|
|
|
|
+ and matter_no LIKE '%${matterNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="matterName != null and matterName != ''">
|
|
|
|
|
+ and matter_name LIKE '%${matterName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="countOldAndNew" parameterType="java.util.HashMap" resultType="HashMap">
|
|
|
|
|
+ select * from
|
|
|
|
|
+ (
|
|
|
|
|
+ select matter_no,
|
|
|
|
|
+ matter_name,
|
|
|
|
|
+ count(1) countSum,
|
|
|
|
|
+ sum(net_weight) net_weight,
|
|
|
|
|
+ sum(gross_weight) gross_weight,
|
|
|
|
|
+ sum(tare_weight) tare_weight,
|
|
|
|
|
+ forwarding_unit_no,
|
|
|
|
|
+ forwarding_unit_name,
|
|
|
|
|
+ receiving_uint_no,
|
|
|
|
|
+ receiving_uint_name,
|
|
|
|
|
+ '新系统' remark
|
|
|
|
|
+ from meter_work_car_actual
|
|
|
|
|
+ where 1= 1
|
|
|
|
|
+ and IS_PRE_SCALE='1'
|
|
|
|
|
+ and VALUE_FLAG in ('1', '2')
|
|
|
|
|
+ and UPLOAD_FLAG='2'
|
|
|
<if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
|
|
<if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
|
|
|
- and net_time >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time <= TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="carNo != null and carNo != ''">
|
|
|
|
|
- and car_no like '%${carNo}%'
|
|
|
|
|
|
|
+ and net_time >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and net_time <= TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ group by matter_no, matter_name, forwarding_unit_no, forwarding_unit_name, receiving_uint_no, receiving_uint_name
|
|
|
|
|
+ union
|
|
|
|
|
+ (
|
|
|
|
|
+ select fs_material matter_no,
|
|
|
|
|
+ fs_materialName matter_name,
|
|
|
|
|
+ count(1) countSum,
|
|
|
|
|
+ sum(fs_netWeight*1000) net_weight,
|
|
|
|
|
+ sum(fs_grossWeight*1000) gross_weight,
|
|
|
|
|
+ sum(fs_tareWeight*1000) tare_weight,
|
|
|
|
|
+ fs_sender forwarding_unit_no,
|
|
|
|
|
+ fs_senderName forwarding_unit_name,
|
|
|
|
|
+ fs_receiver receiving_uint_no,
|
|
|
|
|
+ fs_receiverName receiving_uint_name,
|
|
|
|
|
+ '老系统' remark
|
|
|
|
|
+ from jgweight.view_car_net @MCMS
|
|
|
|
|
+ where 1 = 1
|
|
|
|
|
+ <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
|
|
|
|
|
+ and fs_netweightTime >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and fs_netweightTime <= TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ group by fs_material, fs_materialName, fs_sender , fs_senderName , fs_receiver , fs_receiverName
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ where 1=1
|
|
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
|
|
+ and remark LIKE '%${remark}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="forwardingUnitNo != null and forwardingUnitNo != ''">
|
|
|
|
|
+ and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="forwardingUnitName != null and forwardingUnitName != ''">
|
|
|
|
|
+ and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="receivingUintNo != null and receivingUintNo != ''">
|
|
|
|
|
+ and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="receivingUintName != null and receivingUintName != ''">
|
|
|
|
|
+ and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="matterNo != null and matterNo != ''">
|
|
|
|
|
+ and matter_no LIKE '%${matterNo}%'
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="matterName != null and matterName != ''">
|
|
|
|
|
+ and matter_name LIKE '%${matterName}%'
|
|
|
|
|
+ </if>
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|