|
@@ -3,42 +3,102 @@
|
|
|
<mapper namespace="com.steerinfo.meterwork.meterworkdatacount.mapper.MeterWorkDataCountMapper">
|
|
<mapper namespace="com.steerinfo.meterwork.meterworkdatacount.mapper.MeterWorkDataCountMapper">
|
|
|
<select id="countFirstAndActual" parameterType="java.util.HashMap" resultType="hashmap">
|
|
<select id="countFirstAndActual" parameterType="java.util.HashMap" resultType="hashmap">
|
|
|
select
|
|
select
|
|
|
- (select count(*) from meter_work_car_actual_first t where t.value_flag !='0') as count_First_Valid,
|
|
|
|
|
- (select count(*) from meter_work_car_actual_first t where t.value_flag ='1') as count_First_Effective_Unclean,
|
|
|
|
|
- (select count(*) from meter_work_car_actual t where t.value_flag != '0') as count_Actual_Valid,
|
|
|
|
|
- (select count(*) from meter_work_car_actual t where t.value_flag != '0' and is_pre_scale = '0') as count_Actual_Effective_Unclean,
|
|
|
|
|
|
|
+ (select count(*) from meter_work_car_actual_first t where t.value_flag !='0'
|
|
|
|
|
+ <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>) as count_First_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_car_actual_first t where t.value_flag ='1'
|
|
|
|
|
+ <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>) as count_First_Effective_Unclean,
|
|
|
|
|
+ (select count(*) from meter_work_car_actual t where t.value_flag != '0'
|
|
|
|
|
+ <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>) as count_Actual_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_car_actual t where t.value_flag != '0' and is_pre_scale = '0'
|
|
|
|
|
+ <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>) as count_Actual_Effective_Unclean,
|
|
|
'汽车衡' as remark
|
|
'汽车衡' as remark
|
|
|
from dual
|
|
from dual
|
|
|
union
|
|
union
|
|
|
select
|
|
select
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019001') and t.value_flag !='0') as count_First_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019001') and t.value_flag ='1') as count_First_Effective_Unclean,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019001') and t.value_flag != '0') as count_Actual_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019001') and t.value_flag != '0' and is_pre_sacale = '0') as count_Actual_Effective_Unclean,
|
|
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019001') and t.value_flag !='0'
|
|
|
|
|
+ <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>) as count_First_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019001') and t.value_flag ='1'
|
|
|
|
|
+ <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>) as count_First_Effective_Unclean,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019001') and t.value_flag != '0'
|
|
|
|
|
+ <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>) as count_Actual_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019001') and t.value_flag != '0' and is_pre_sacale = '0'
|
|
|
|
|
+ <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>) as count_Actual_Effective_Unclean,
|
|
|
'静态衡' as remark
|
|
'静态衡' as remark
|
|
|
from dual
|
|
from dual
|
|
|
union
|
|
union
|
|
|
select
|
|
select
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019002') and t.value_flag !='0') as count_First_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019002') and t.value_flag ='1') as count_First_Effective_Unclean,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019002') and t.value_flag != '0') as count_Actual_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019002') and t.value_flag != '0' and is_pre_sacale = '0') as count_Actual_Effective_Unclean,
|
|
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019002') and t.value_flag !='0'
|
|
|
|
|
+ <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>) as count_First_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019002') and t.value_flag ='1'
|
|
|
|
|
+ <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>) as count_First_Effective_Unclean,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019002') and t.value_flag != '0'
|
|
|
|
|
+ <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>) as count_Actual_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019002') and t.value_flag != '0' and is_pre_sacale = '0'
|
|
|
|
|
+ <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>) as count_Actual_Effective_Unclean,
|
|
|
'动态衡' as remark
|
|
'动态衡' as remark
|
|
|
from dual
|
|
from dual
|
|
|
union
|
|
union
|
|
|
select
|
|
select
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019003', '001019004') and t.value_flag !='0') as count_First_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019003', '001019004') and t.value_flag ='1') as count_First_Effective_Unclean,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019003', '001019004') and t.value_flag != '0') as count_Actual_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019003', '001019004') and t.value_flag != '0' and is_pre_sacale = '0') as count_Actual_Effective_Unclean,
|
|
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019003', '001019004') and t.value_flag !='0'
|
|
|
|
|
+ <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>) as count_First_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019003', '001019004') and t.value_flag ='1'
|
|
|
|
|
+ <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>) as count_First_Effective_Unclean,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019003', '001019004') and t.value_flag != '0'
|
|
|
|
|
+ <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>) as count_Actual_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019003', '001019004') and t.value_flag != '0' and is_pre_sacale = '0'
|
|
|
|
|
+ <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>) as count_Actual_Effective_Unclean,
|
|
|
'铁水衡' as remark
|
|
'铁水衡' as remark
|
|
|
from dual
|
|
from dual
|
|
|
union
|
|
union
|
|
|
select
|
|
select
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019005') and t.value_flag !='0') as count_First_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019005') and t.value_flag ='1') as count_First_Effective_Unclean,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019005') and t.value_flag != '0') as count_Actual_Valid,
|
|
|
|
|
- (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019005') and t.value_flag != '0' and is_pre_sacale = '0') as count_Actual_Effective_Unclean,
|
|
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019005') and t.value_flag !='0'
|
|
|
|
|
+ <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>) as count_First_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_act_first t where t.railway_type_no in ('001019005') and t.value_flag ='1'
|
|
|
|
|
+ <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>) as count_First_Effective_Unclean,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019005') and t.value_flag != '0'
|
|
|
|
|
+ <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>) as count_Actual_Valid,
|
|
|
|
|
+ (select count(*) from meter_work_railway_actual t where t.railway_type_no in ('001019005') and t.value_flag != '0' and is_pre_sacale = '0'
|
|
|
|
|
+ <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>) as count_Actual_Effective_Unclean,
|
|
|
'吊钩秤' as remark
|
|
'吊钩秤' as remark
|
|
|
from dual
|
|
from dual
|
|
|
</select>
|
|
</select>
|