dengyj пре 3 година
родитељ
комит
1e928514ab

+ 25 - 0
src/main/java/com/steerinfo/meterwork/meterworkoldandnew/controller/MeterWorkOldAndNew.java

@@ -563,4 +563,29 @@ public class MeterWorkOldAndNew extends BaseRESTfulController {
         }
         return rm;
     }
+
+    @ApiOperation(value="统计所有秤点结净老系统和新系统(包含汽车衡、轨道衡、吊钩秤、铁水衡、皮带秤)", notes="返回List<HashMap>对象")
+    @PostMapping(value = "/countAllOldAndNew")
+    public RESTfulResult countAllOldAndNew(@RequestBody HashMap params) {
+        RESTfulResult rm = success();
+        try {
+            //PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()), Integer.parseInt(params.get("pageSize").toString()));
+            // 新系统结净数据
+            List<HashMap> newList = meterWorkOldAndNewService.getCountAllNew(params);
+            // 老系统结净数据
+            List<HashMap> oldList = meterWorkOldAndNewService.getCountAllOld(params);
+            // 新老系统数据联合查询
+            List<HashMap> totalList = Stream.of(newList, oldList)
+                    .flatMap(x -> x.stream())
+                    .collect(Collectors.toList());
+            PageList pageInfo = this.helpPage(params, totalList);
+            rm.setCode("200");
+            rm.setMessage("操作成功!!");
+            rm.setData(pageInfo);
+        }catch (Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常:>>>" + e.getMessage());
+        }
+        return rm;
+    }
 }

+ 4 - 2
src/main/java/com/steerinfo/meterwork/meterworkoldandnew/mapper/MeterWorkOldAndNewMapper.java

@@ -48,6 +48,8 @@ public interface MeterWorkOldAndNewMapper {
     List<HashMap> countRailwayHookOld(Map<String, Object> params);
 
     //所有秤点联合查询
-    List<String> getAllNew(Map<String, Object> params);
-    List<String> getAllOld(Map<String, Object> params);
+    List<HashMap> getAllNew(Map<String, Object> params);
+    List<HashMap> getAllOld(Map<String, Object> params);
+    List<HashMap> getCountAllNew(Map<String, Object> params);
+    List<HashMap> getCountAllOld(Map<String, Object> params);
 }

+ 342 - 0
src/main/java/com/steerinfo/meterwork/meterworkoldandnew/mapper/MeterWorkOldAndNewMapper.xml

@@ -1594,4 +1594,346 @@ where FS_ISVALID = '1' and FS_DELETEDTAG = 'N' and (FS_BALANCETYPE='静态' or F
             and matter_name LIKE '%${matterName}%'
         </if>
     </select>
+
+    <select id="getAllNew" parameterType="java.util.HashMap" resultType="HashMap">
+        select car_type_no,
+               remark,
+               car_no,
+               matter_no,
+               matter_name,
+               sender_remark,
+               prediction_no,
+               gross_weight,
+               tare_weight,
+               net_weight,
+               forwarding_unit_name,
+               receiving_uint_name,
+               net_time,
+               net_spot3_no,
+               net_spot3_name,
+               gross_time,
+               base_spot1_name,
+               tare_time,
+               base_spot2_name
+        from
+        (
+        select '001002001' car_type_no,
+        '汽车衡' car_type_name,
+        '新系统' remark,
+        car_no car_no,
+        matter_no,
+        matter_name,
+        sender_remark,
+        prediction_no,
+        gross_weight,
+        tare_weight,
+        net_weight,
+        forwarding_unit_no,
+        forwarding_unit_name,
+        receiving_uint_no,
+        receiving_uint_name,
+        net_time,
+        net_spot3_no,
+        net_spot3_name,
+        gross_time,
+        base_spot1_no,
+        base_spot1_name,
+        tare_time,
+        base_spot2_no,
+        base_spot2_name,
+        value_flag,
+        upload_flag
+        from meter_work_car_actual
+        union
+        select railway_type_no car_type_no,
+        railway_type_name car_type_name,
+        '新系统' remark,
+        railway_no car_no,
+        matter_no,
+        matter_name,
+        sender_remark,
+        prediction_no,
+        gross_weight,
+        tare_weight,
+        net_weight,
+        forwarding_unit_no,
+        forwarding_unit_name,
+        receiving_uint_no,
+        receiving_uint_name,
+        net_time,
+        net_spot3_no,
+        net_spot3_name,
+        gross_time,
+        base_spot1_no,
+        base_spot1_name,
+        tare_time,
+        base_spot2_no,
+        base_spot2_name,
+        value_flag,
+        upload_flag
+        from meter_work_railway_actual
+        )
+        where VALUE_FLAG in ('1', '2')
+        and UPLOAD_FLAG='2'
+        <if test="carTypeNo != null and carTypeNo">
+            and car_type_no like '%${carTypeNo}%'
+        </if>
+        <if test="carTypeName != null and carTypeName">
+            and car_type_Name like '%${carTypeName}%'
+        </if>
+        <if test="remark != null and remark != ''">
+            and '新系统' 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  &lt;=  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>
+        <if test="minWgt != null and minWgt != ''">
+            and NET_WEIGHT/1000 >= '${minWgt}'
+        </if>
+        <if test="maxWgt != null and maxWgt != ''">
+            and NET_WEIGHT/1000 &lt;= '${maxWgt}'
+        </if>
+        order by net_time desc
+    </select>
+
+    <select id="getAllOld" parameterType="java.util.HashMap" resultType="HashMap">
+        select fs_conveyancegroup car_type_no,
+        '老系统' remark,
+        replace(ch, '-', '') car_no,
+        wlbm matter_no,
+        wlmc matter_name,
+        hy sender_remark,
+        wt prediction_No,
+        mz*1000 gross_weight,
+        pz*1000 tare_weight,
+        jz*1000 net_weight,
+        fhdw forwarding_unit_name,
+        shdw receiving_uint_name,
+        jzsj net_time,
+        zdbh net_spot3_no,
+        jzzd net_spot3_name,
+        mzsj gross_time,
+        mzzd base_spot1_name,
+        pzsj tare_time,
+        pzzd base_spot2_name
+        from jgweight.VIEW_DATAQUERY
+        where 1 = 1
+        <if test="remark != null and remark != ''">
+            and '老系统' LIKE '%${remark}%'
+        </if>
+        <if test="carTypeNo != null and carTypeNo != ''">
+            and fs_conveyancegroup LIKE '%${carTypeNo}%'
+        </if>
+        <if test="predictionNo != null and predictionNo != ''">
+            and wt LIKE '%${predictionNo}%'
+        </if>
+        <if test="netSpot3No != null and netSpot3No != ''">
+            and zdbh like '%${netSpot3No}%'
+        </if>
+        <if test="netSpot3Name != null and netSpot3Name != ''">
+            and jzzd like '%${netSpot3Name}%'
+        </if>
+        <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+            and jzsj >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and jzsj  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+        </if>
+        <if test="forwardingUnitName != null and forwardingUnitName != ''">
+            and fhdw LIKE '%${forwardingUnitName}%'
+        </if>
+        <if test="receivingUintName != null and receivingUintName != ''">
+            and shdw LIKE '%${receivingUintName}%'
+        </if>
+        <if test="carNo != null and carNo != ''">
+            and replace(ch, '-', '') like '%${carNo}%'
+        </if>
+        <if test="matterNo != null and matterNo != ''">
+            and wlbm LIKE '%${matterNo}%'
+        </if>
+        <if test="matterName != null and matterName != ''">
+            and wlmc LIKE '%${matterName}%'
+        </if>
+        <if test="senderRemark != null and senderRemark != ''">
+            and hy LIKE '%${senderRemark}%'
+        </if>
+        <if test="minWgt != null and minWgt != ''">
+            and jz >= '${minWgt}'
+        </if>
+        <if test="maxWgt != null and maxWgt != ''">
+            and jz &lt;= '${maxWgt}'
+        </if>
+        order by jzsj desc
+    </select>
+
+    <select id="getCountAllNew" parameterType="java.util.HashMap" resultType="HashMap">
+        select * from
+        (
+        select '新系统' remark,
+        matter_no,
+        matter_name,
+        sender_remark,
+        count(1) countSum,
+        sum(gross_weight) gross_weight,
+        sum(tare_weight) tare_weight,
+        sum(net_weight) net_weight,
+        forwarding_unit_name,
+        receiving_uint_name
+        from meter_work_car_actual
+        where VALUE_FLAG in ('1', '2')
+        and UPLOAD_FLAG='2'
+        <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  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+        </if>
+        <if test="forwardingUnitName != null and forwardingUnitName != ''">
+            and forwarding_unit_name LIKE '%${forwardingUnitName}%'
+        </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>
+        <if test="senderRemark != null and senderRemark != ''">
+            and sender_remark LIKE '%${senderRemark}%'
+        </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="carNo != null and carNo != ''">
+            and car_no like '%${carNo}%'
+        </if>
+        <if test="remark != null and remark != ''">
+            and '新系统' like '%${remark}%'
+        </if>
+        group by matter_no,matter_name,sender_remark,forwarding_unit_name,receiving_uint_name
+        union
+        select '新系统' remark,
+        matter_no,
+        matter_name,
+        sender_remark,
+        count(1) countSum,
+        sum(gross_weight) grossWeight,
+        sum(tare_weight) tareWeight,
+        sum(net_weight) netWeight,
+        forwarding_unit_name,
+        receiving_uint_name
+        from meter_work_railway_actual
+        where VALUE_FLAG in ('1', '2')
+        and UPLOAD_FLAG='2'
+        <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  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+        </if>
+        <if test="forwardingUnitName != null and forwardingUnitName != ''">
+            and forwarding_unit_name LIKE '%${forwardingUnitName}%'
+        </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>
+        <if test="senderRemark != null and senderRemark != ''">
+            and sender_remark LIKE '%${senderRemark}%'
+        </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="carNo != null and carNo != ''">
+            and RAILWAY_NO like '%${carNo}%'
+        </if>
+        <if test="remark != null and remark != ''">
+            and '新系统' like '%${remark}%'
+        </if>
+        group by matter_no,matter_name,sender_remark, forwarding_unit_name, receiving_uint_name
+        )
+    </select>
+
+    <select id="getCountAllOld" parameterType="java.util.HashMap" resultType="HashMap">
+        select '老系统' remark,
+        wlbm matter_no,
+        wlmc matter_name,
+        hy sender_remark,
+        count(1) countSum,
+        sum(mz*1000) gross_weight,
+        sum(pz*1000) tare_weight,
+        sum(jz*1000) net_weight,
+        fhdw forwarding_unit_name,
+        shdw receiving_uint_name
+        from jgweight.VIEW_DATAQUERY
+        where 1=1
+        <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
+            and jzsj  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and jzsj  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
+        </if>
+        <if test="forwardingUnitName != null and forwardingUnitName != ''">
+            and fhdw LIKE '%${forwardingUnitName}%'
+        </if>
+        <if test="receivingUintName != null and receivingUintName != ''">
+            and shdw LIKE '%${receivingUintName}%'
+        </if>
+        <if test="matterNo != null and matterNo != ''">
+            and wlbm LIKE '%${matterNo}%'
+        </if>
+        <if test="matterName != null and matterName != ''">
+            and wlmc LIKE '%${matterName}%'
+        </if>
+        <if test="senderRemark != null and senderRemark != ''">
+            and hy LIKE '%${senderRemark}%'
+        </if>
+        <if test="netSpot3No != null and netSpot3No != ''">
+            and zdbh like '%${netSpot3No}%'
+        </if>
+        <if test="netSpot3Name != null and netSpot3Name != ''">
+            and jzzd like '%${netSpot3Name}%'
+        </if>
+        <if test="carNo != null and carNo != ''">
+            and ch like '%${carNo}%'
+        </if>
+        <if test="remark != null and remark != ''">
+            and '老系统' like '%${remark}%'
+        </if>
+        group by wlbm, wlmc, hy, fhdw, shdw
+    </select>
 </mapper>

+ 2 - 0
src/main/java/com/steerinfo/meterwork/meterworkoldandnew/service/IMeterWorkOldAndNewService.java

@@ -45,4 +45,6 @@ public interface IMeterWorkOldAndNewService {
     //所有秤点联合查询Service
     List<HashMap> getAllNew(HashMap params);
     List<HashMap> getAllOld(HashMap params);
+    List<HashMap> getCountAllNew(HashMap params);
+    List<HashMap> getCountAllOld(HashMap params);
 }

+ 12 - 0
src/main/java/com/steerinfo/meterwork/meterworkoldandnew/service/impl/MeterWorkOldAndNewService.java

@@ -155,7 +155,19 @@ public class MeterWorkOldAndNewService implements IMeterWorkOldAndNewService {
     }
 
     @Override
+    @TargetDataSource(dataSourceKey = DataSourceKey.DB_SLAVE1)
     public List<HashMap> getAllOld(HashMap params) {
         return meterWorkOldAndNewMapper.getAllOld(params);
     }
+
+    @Override
+    public List<HashMap> getCountAllNew(HashMap params) {
+        return meterWorkOldAndNewMapper.getCountAllNew(params);
+    }
+
+    @Override
+    @TargetDataSource(dataSourceKey = DataSourceKey.DB_SLAVE1)
+    public List<HashMap> getCountAllOld(HashMap params) {
+        return meterWorkOldAndNewMapper.getCountAllOld(params);
+    }
 }

+ 1 - 1
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/mapper/MeterWorkRailwayActFirstMapper.xml

@@ -3869,7 +3869,7 @@
           <if test="lcNo != null and lcNo != ''">
             and  A.lc_No like '%${lcNo}%'
           </if>
-    order by conveyance_Type asc, gross_time desc
+    order by gross_time desc
   </select>
 
   <select id="getFirstLcNo" parameterType="java.lang.String" resultType="String">