Explorar o código

添加计量站点多选

luobang hai 1 semana
pai
achega
99a7000a51

+ 2 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.java

@@ -86,4 +86,6 @@ public interface MeterWorkCarActualMapper extends IBaseMapper<MeterWorkCarActual
 
     BigDecimal selectLastUpWeightByCarNo(String carNo);
 
+    BigDecimal getTotalNetWeight(HashMap<String, Object> params);
+
 }

+ 359 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/mapper/MeterWorkCarActualMapper.xml

@@ -4858,5 +4858,364 @@
       SELECT * FROM METER_WORK_CAR_ACTUAL WHERE CAR_NO = #{carNo} AND VALUE_FLAG != '0' AND prediction_Type = 1 ORDER BY NET_TIME DESC
       FETCH FIRST 1 ROW ONLY
     </select>
+  <select id="getTotalNetWeight" resultType="java.math.BigDecimal">
+    SELECT sum(NET_WEIGHT) FROM METER_WORK_CAR_ACTUAL
+    <where>
+      1=1
+      <if test="baseSpotNames != null and baseSpotNames.size() != 0">
+        and NET_SPOT3_NAME in
+        <foreach collection="baseSpotNames" item="id" open="(" close=")" separator=",">
+          #{id}
+        </foreach>
+      </if>
+      <if test="actualNo != null and actualNo != ''">
+        and ACTUAL_NO LIKE '%${actualNo}%'
+      </if>
+      <if test="predictionNo != null and predictionNo != ''">
+        and PREDICTION_NO LIKE '%${predictionNo}%'
+      </if>
+      <if test="noticeNo != null and noticeNo != ''">
+        and NOTICE_NO LIKE '%${noticeNo}%'
+      </if>
+      <if test="carNo != null and carNo != '' and isCongruent == null">
+        and CAR_NO LIKE '%${carNo}%'
+      </if>
+      <if test="carNo != null and carNo != '' and isCongruent != null">
+        and CAR_NO =  '${carNo}'
+      </if>
+      <if test="trailerNo != null and trailerNo != ''">
+        and TRAILER_NO LIKE '%${trailerNo}%'
+      </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="contractNo != null and contractNo != ''">
+        and CONTRACT_NO LIKE '%${contractNo}%'
+      </if>
+      <if test="batchNo != null and batchNo != ''">
+        and BATCH_NO LIKE '%${batchNo}%'
+      </if>
+      <if test="customerSupplierNo != null and customerSupplierNo != ''">
+        and CUSTOMER_SUPPLIER_NO LIKE '%${customerSupplierNo}%'
+      </if>
+      <if test="customerSupplierName != null and customerSupplierName != ''">
+        and CUSTOMER_SUPPLIER_NAME LIKE '%${customerSupplierName}%'
+      </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="materialNo != null and materialNo != ''">
+        and MATERIAL_NO LIKE '%${materialNo}%'
+      </if>
+      <if test="materialName != null and materialName != ''">
+        and MATERIAL_NAME LIKE '%${materialName}%'
+      </if>
+      <if test="specNo != null and specNo != ''">
+        and SPEC_NO LIKE '%${specNo}%'
+      </if>
+      <if test="specName != null and specName != ''">
+        and SPEC_NAME LIKE '%${specName}%'
+      </if>
+      <if test="loadPointNo != null and loadPointNo != ''">
+        and LOAD_POINT_NO LIKE '%${loadPointNo}%'
+      </if>
+      <if test="loadPointName != null and loadPointName != ''">
+        and LOAD_POINT_NAME LIKE '%${loadPointName}%'
+      </if>
+      <if test="sampleNo != null and sampleNo != ''">
+        and SAMPLE_NO LIKE '%${sampleNo}%'
+      </if>
+      <if test="sampleVoucher != null and sampleVoucher != ''">
+        and SAMPLE_VOUCHER LIKE '%${sampleVoucher}%'
+      </if>
+      <if test="carrierUnitNo != null and carrierUnitNo != ''">
+        and CARRIER_UNIT_NO LIKE '%${carrierUnitNo}%'
+      </if>
+      <if test="carrierUnitName != null and carrierUnitName != ''">
+        and CARRIER_UNIT_NAME LIKE '%${carrierUnitName}%'
+      </if>
+      <if test="meterTypeNo != null and meterTypeNo != ''">
+        and METER_TYPE_NO LIKE '%${meterTypeNo}%'
+      </if>
+      <if test="meterTypeName != null and meterTypeName != ''">
+        and METER_TYPE_NAME LIKE '%${meterTypeName}%'
+      </if>
+      <if test="meterProcessNo != null and meterProcessNo != ''">
+        and METER_PROCESS_NO LIKE '%${meterProcessNo}%'
+      </if>
+      <if test="meterProcessEditionNo != null and meterProcessEditionNo != ''">
+        and METER_PROCESS_EDITION_NO LIKE '%${meterProcessEditionNo}%'
+      </if>
+      <if test="actualFirst1No != null and actualFirst1No != ''">
+        and ACTUAL_FIRST1_NO LIKE '%${actualFirst1No}%'
+      </if>
+      <if test="grossWeight != null">
+        and GROSS_WEIGHT = #{grossWeight}
+      </if>
+      <if test="grossManNo != null and grossManNo != ''">
+        and GROSS_MAN_NO LIKE '%${grossManNo}%'
+      </if>
+      <if test="grossManName != null and grossManName != ''">
+        and GROSS_MAN_NAME LIKE '%${grossManName}%'
+      </if>
+      <if test="grossTime != null">
+        and TO_CHAR(GROSS_TIME,'yyyy-MM-dd') = #{grossTime}
+      </if>
+      <if test="baseSpot1No != null and baseSpot1No != ''">
+        and BASE_SPOT1_NO LIKE '%${baseSpot1No}%'
+      </if>
+      <if test="baseSpot1Name != null and baseSpot1Name != ''">
+        and BASE_SPOT1_NAME LIKE '%${baseSpot1Name}%'
+      </if>
+      <if test="grossClass != null and grossClass != ''">
+        and GROSS_CLASS LIKE '%${grossClass}%'
+      </if>
+      <if test="grossGroup != null and grossGroup != ''">
+        and GROSS_GROUP LIKE '%${grossGroup}%'
+      </if>
+      <if test="grossMode != null and grossMode != ''">
+        and GROSS_MODE LIKE '%${grossMode}%'
+      </if>
+      <if test="actualFirst2No != null and actualFirst2No != ''">
+        and ACTUAL_FIRST2_NO LIKE '%${actualFirst2No}%'
+      </if>
+      <if test="tareWeight != null">
+        and TARE_WEIGHT = #{tareWeight}
+      </if>
+      <if test="tareManNo != null and tareManNo != ''">
+        and TARE_MAN_NO LIKE '%${tareManNo}%'
+      </if>
+      <if test="tareManName != null and tareManName != ''">
+        and TARE_MAN_NAME LIKE '%${tareManName}%'
+      </if>
+      <if test="tareTime != null">
+        and TO_CHAR(TARE_TIME,'yyyy-MM-dd') = #{tareTime}
+      </if>
+      <if test="baseSpot2No != null and baseSpot2No != ''">
+        and BASE_SPOT2_NO LIKE '%${baseSpot2No}%'
+      </if>
+      <if test="baseSpot2Name != null and baseSpot2Name != ''">
+        and BASE_SPOT2_NAME LIKE '%${baseSpot2Name}%'
+      </if>
+      <if test="tareClass != null and tareClass != ''">
+        and TARE_CLASS LIKE '%${tareClass}%'
+      </if>
+      <if test="tareGroup != null and tareGroup != ''">
+        and TARE_GROUP LIKE '%${tareGroup}%'
+      </if>
+      <if test="tareMode != null and tareMode != ''">
+        and TARE_MODE LIKE '%${tareMode}%'
+      </if>
+      <if test="netWeight != null">
+        and NET_WEIGHT = #{netWeight}
+      </if>
+      <if test="meterNum != null">
+        and METER_NUM = #{meterNum}
+      </if>
+      <if test="netManNo != null and netManNo != ''">
+        and NET_MAN_NO LIKE '%${netManNo}%'
+      </if>
+      <if test="netManName != null and netManName != ''">
+        and NET_MAN_NAME LIKE '%${netManName}%'
+      </if>
+      <if test="netTime != null">
+        and TO_CHAR(NET_TIME,'yyyy-MM-dd') = #{netTime}
+      </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="netGroup != null and netGroup != ''">
+        and NET_GROUP LIKE '%${netGroup}%'
+      </if>
+      <if test="netMode != null and netMode != ''">
+        and NET_MODE LIKE '%${netMode}%'
+      </if>
+      <if test="valueFlag != null and valueFlag != ''">
+        and VALUE_FLAG = #{valueFlag}
+      </if>
+      <if test="uploadFlag != null and uploadFlag != ''">
+        and UPLOAD_FLAG LIKE '%${uploadFlag}%'
+      </if>
+      <if test="checkManNo != null and checkManNo != ''">
+        and CHECK_MAN_NO LIKE '%${checkManNo}%'
+      </if>
+      <if test="checkManName != null and checkManName != ''">
+        and CHECK_MAN_NAME LIKE '%${checkManName}%'
+      </if>
+      <if test="checkTime != null">
+        and TO_CHAR(CHECK_TIME,'yyyy-MM-dd') = #{checkTime}
+      </if>
+      <if test="uploadManNo != null and uploadManNo != ''">
+        and UPLOAD_MAN_NO LIKE '%${uploadManNo}%'
+      </if>
+      <if test="uploadManName != null and uploadManName != ''">
+        and UPLOAD_MAN_NAME LIKE '%${uploadManName}%'
+      </if>
+      <if test="uploadTime != null">
+        and TO_CHAR(UPLOAD_TIME,'yyyy-MM-dd') = #{uploadTime}
+      </if>
+      <if test="addWeight != null">
+        and ADD_WEIGHT = #{addWeight}
+      </if>
+      <if test="netClass != null and netClass != ''">
+        and NET_CLASS LIKE '%${netClass}%'
+      </if>
+      <if test="tbFlage != null and tbFlage != ''">
+        and TB_FLAGE LIKE '%${tbFlage}%'
+      </if>
+      <if test="railwayNo != null and railwayNo != ''">
+        and RAILWAY_NO LIKE '%${railwayNo}%'
+      </if>
+      <if test="updateManNo != null and updateManNo != ''">
+        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
+      </if>
+      <if test="updateManName != null and updateManName != ''">
+        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO LIKE '%${memo}%'
+      </if>
+      <if test="heatNo != null and heatNo != ''">
+        and HEAT_NO LIKE '%${heatNo}%'
+      </if>
+      <if test="shipmentGrossWeight != null">
+        and SHIPMENT_GROSS_WEIGHT = #{shipmentGrossWeight}
+      </if>
+      <if test="shipmentNetWeight != null">
+        and SHIPMENT_NET_WEIGHT = #{shipmentNetWeight}
+      </if>
+      <if test="shipmentNum != null">
+        and SHIPMENT_NUM = #{shipmentNum}
+      </if>
+      <if test="bindCardNo != null and bindCardNo != ''">
+        and BIND_CARD_NO LIKE '%${bindCardNo}%'
+      </if>
+      <if test="predictionType != null and predictionType != ''">
+        and PREDICTION_TYPE LIKE '%${predictionType}%'
+      </if>
+      <if test="predictionCombination != null and predictionCombination != ''">
+        and PREDICTION_COMBINATION LIKE '%${predictionCombination}%'
+      </if>
+      <if test="meterPierName != null and meterPierName != ''">
+        and METER_PIER_NAME LIKE '%${meterPierName}%'
+      </if>
+      <if test="meterPierNo != null and meterPierNo != ''">
+        and METER_PIER_NO LIKE '%${meterPierNo}%'
+      </if>
+      <if test="shipNo != null and shipNo != ''">
+        and SHIP_NO LIKE '%${shipNo}%'
+      </if>
+      <if test="note != null and note != ''">
+        and NOTE LIKE '%${note}%'
+      </if>
+      <if test="voucherIdentity != null and voucherIdentity != ''">
+        and VOUCHER_IDENTITY LIKE '%${voucherIdentity}%'
+      </if>
+      <if test="voucherItem != null and voucherItem != ''">
+        and VOUCHER_ITEM LIKE '%${voucherItem}%'
+      </if>
+      <if test="businessGroup != null and businessGroup != ''">
+        and BUSINESS_GROUP LIKE '%${businessGroup}%'
+      </if>
+      <if test="tempConveyance != null and tempConveyance != ''">
+        and TEMP_CONVEYANCE LIKE '%${tempConveyance}%'
+      </if>
+      <if test="conveyanceType != null and conveyanceType != ''">
+        and CONVEYANCE_TYPE LIKE '%${conveyanceType}%'
+      </if>
+      <if test="resourceSystem != null and resourceSystem != ''">
+        and RESOURCE_SYSTEM LIKE '%${resourceSystem}%'
+      </if>
+      <if test="groupPackageAmount != null">
+        and GROUP_PACKAGE_AMOUNT = #{groupPackageAmount}
+      </if>
+      <if test="groupPackageUnit != null and groupPackageUnit != ''">
+        and GROUP_PACKAGE_UNIT LIKE '%${groupPackageUnit}%'
+      </if>
+      <if test="packageAmount != null">
+        and PACKAGE_AMOUNT = #{packageAmount}
+      </if>
+      <if test="packageUnit != null and packageUnit != ''">
+        and PACKAGE_UNIT LIKE '%${packageUnit}%'
+      </if>
+      <if test="theoryAmount != null">
+        and THEORY_AMOUNT = #{theoryAmount}
+      </if>
+      <if test="measureBatch != null and measureBatch != ''">
+        and MEASURE_BATCH LIKE '%${measureBatch}%'
+      </if>
+      <if test="measureBatchCount != null">
+        and MEASURE_BATCH_COUNT = #{measureBatchCount}
+      </if>
+      <if test="senderType != null and senderType != ''">
+        and SENDER_TYPE LIKE '%${senderType}%'
+      </if>
+      <if test="senderRemark != null and senderRemark != ''">
+        and SENDER_REMARK LIKE '%${senderRemark}%'
+      </if>
+      <if test="receiverType != null and receiverType != ''">
+        and RECEIVER_TYPE LIKE '%${receiverType}%'
+      </if>
+      <if test="receiverRemark != null and receiverRemark != ''">
+        and RECEIVER_REMARK LIKE '%${receiverRemark}%'
+      </if>
+      <if test="amountUnit != null and amountUnit != ''">
+        and AMOUNT_UNIT LIKE '%${amountUnit}%'
+      </if>
+      <if test="measureObjectType != null and measureObjectType != ''">
+        and MEASURE_OBJECT_TYPE LIKE '%${measureObjectType}%'
+      </if>
+      <if test="measureTaskNum != null and measureTaskNum != ''">
+        and MEASURE_TASK_NUM LIKE '%${measureTaskNum}%'
+      </if>
+      <if test="billType != null and billType != ''">
+        and BILL_TYPE LIKE '%${billType}%'
+      </if>
+      <if test="createManName != null and createManName != ''">
+        and CREATE_MAN_NAME LIKE '%${createManName}%'
+      </if>
+      <if test="dataSource != null and dataSource != ''">
+        and DATA_SOURCE LIKE '%${dataSource}%'
+      </if>
+      <if test="isPreScale != null and isPreScale != ''">
+        and IS_PRE_SCALE = #{isPreScale}
+      </if>
+    </where>
+    <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="netSpot3NoStr != null and netSpot3NoStr != ''">
+      and net_spot3_no in
+      <foreach collection="spotNoStr" item="item" open="(" separator="," close=")">
+        #{item}
+      </foreach>
+    </if>
+    <if test="flag != null and flag != ''">
+      and value_flag != '0'
+    </if>
+    <if test="groupId != null and groupId != ''">
+      and NET_SPOT3_NO in (SELECT METER_BASE_GROUP_SPOT.SPOT_ID FROM METER_BASE_GROUP_SPOT WHERE METER_BASE_GROUP_SPOT.GROUP_ID = #{groupId})
+    </if>
+
+    order by net_time desc
+     </select>
 
 </mapper>

+ 11 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/model/MeterWorkCarActual.java

@@ -9,6 +9,9 @@ import java.util.Date;
 
 @ApiModel(value="计量汽车衡结净表")
 public class MeterWorkCarActual implements IBasePO<String> {
+
+    private BigDecimal totalNetWeight;
+
     /**
      * 结净编号(YYYYMMDD+4位流水)(ACTUAL_NO,VARCHAR,50)
      */
@@ -1936,4 +1939,12 @@ public class MeterWorkCarActual implements IBasePO<String> {
         sb.append("]");
         return sb.toString();
     }
+
+    public BigDecimal getTotalNetWeight() {
+        return totalNetWeight;
+    }
+
+    public void setTotalNetWeight(BigDecimal totalNetWeight) {
+        this.totalNetWeight = totalNetWeight;
+    }
 }

+ 4 - 0
src/main/java/com/steerinfo/meterwork/meterworkcaractual/service/impl/MeterWorkCarActualServiceImpl.java

@@ -1416,6 +1416,10 @@ public class MeterWorkCarActualServiceImpl extends BaseServiceImpl<MeterWorkCarA
             params.put("spotNoStr", spotNoStr);
         }
         List<MeterWorkCarActual> rows = meterWorkCarActualMapper.likeByDesc(params);
+        BigDecimal totalNetWeight = meterWorkCarActualMapper.getTotalNetWeight(params);
+        if(rows.size() > 0 && rows.get(0) != null) {
+            rows.get(0).setTotalNetWeight(totalNetWeight);
+        }
         PageList pageInfo = new PageList(rows);
         return pageInfo;
     }

+ 12 - 0
src/main/java/com/steerinfo/meterwork/meterworkrailwayactual/mapper/MeterWorkRailwayActualMapper.xml

@@ -4593,6 +4593,12 @@
           #{id}
         </foreach>
       </if>
+      <if test="netSpot3NoList != null and netSpot3NoList.size() != 0">
+        and net_spot3_no in
+        <foreach collection="netSpot3NoList" item="item" open="(" separator="," close=")">
+          #{item}
+        </foreach>
+      </if>
     </where>
     and value_flag != '0'
     order by net_time desc
@@ -5324,6 +5330,12 @@
           #{id}
         </foreach>
       </if>
+      <if test="baseSpotNos != null and baseSpotNos.size() != 0">
+        and NET_SPOT3_NO in
+        <foreach collection="baseSpotNos" item="id" open="(" close=")" separator=",">
+          #{id}
+        </foreach>
+      </if>
       and railway_type_no in ('001019003', '001019005')
     </where>
   </sql>

+ 6 - 0
src/main/java/com/steerinfo/meterwork/meterworkrailwayreceived/mapper/MeterWorkRailwayReceivedMapper.xml

@@ -2448,6 +2448,12 @@
           #{id}
         </foreach>
       </if>
+      <if test="baseSpotNos != null and baseSpotNos.size() != 0">
+        and BASE_SPOT_NO in
+        <foreach collection="baseSpotNos" item="id" open="(" close=")" separator=",">
+          #{id}
+        </foreach>
+      </if>
     </where>
     order by CREATE_TIME desc
   </select>