Преглед на файлове

1根据水表档案号,水表电子号获取开户信息添加阀控规则

Xiaojh преди 4 години
родител
ревизия
1cad54ea04

+ 19 - 0
smart-city-platform/src/main/java/com/bz/smart_city/entity/pay/archives/PayAccountInfo.java

@@ -3,6 +3,7 @@ package com.bz.smart_city.entity.pay.archives;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.apache.commons.lang3.StringUtils;
 
 import java.math.BigInteger;
 
@@ -32,4 +33,22 @@ public class PayAccountInfo {
     @ApiModelProperty(value = "水表安装地址", position =9 )
     public String installAddress;
 
+    @ApiModelProperty(value = "阀控规则数组Id字符串",position = 10)
+    public String valveRuleId;
+    @ApiModelProperty(value = "阀控规则数组Id",position = 11)
+    public String[] valveRuleIds;
+
+    public String[] getValveRuleIds() {
+        if(StringUtils.isNotBlank(this.getValveRuleId())){
+            valveRuleIds = this.getValveRuleId().split(",");
+        }
+        return valveRuleIds;
+    }
+    public void setValveRuleIds(String[] valveRuleIds) {
+        if(this.getValveRuleId() != null){
+            valveRuleIds = this.getValveRuleId().split(",");
+        }
+        this.valveRuleIds = valveRuleIds;
+    }
+
 }

+ 22 - 18
smart-city-platform/src/main/resources/mapper/PayBaseCustomerandmeterrelaMapper.xml

@@ -424,16 +424,18 @@
 
     <select id="selectAccountMeterInfo" resultType="com.bz.smart_city.entity.pay.archives.PayAccountInfo">
         select
-        account.accountnumber as "accountnumber",
-        account.calculateway as "calculateway",
-        account.waterproperty_id as "waterPropertyId",
-        account.address as installAddress,
-        device.metercode as "metercode",
-        account.name as accountname,
-        account.telephone as telephone,
-        account.idcardno as idcardno,
-        device.water_meter_no as "metereleno"
+            account.accountnumber AS "accountnumber",
+            ifnull(account.calculateway,c.calculateway) AS "calculateway",
+            ifnull(account.waterproperty_id,c.waterproperty_id) AS "waterPropertyId",
+            account.address AS installAddress,
+            device.metercode AS "metercode",
+            account.NAME AS accountname,
+            account.telephone AS telephone,
+            account.idcardno AS idcardno,
+            device.water_meter_no AS "metereleno",
+            c.valve_rule_id as "valveRuleId"
         from pay_base_account account
+        left join pay_base_customerandmeterrela c on account.id = c.account_id and c.customer_id =#{customerId}
         inner join sc_device device on account.id = device.account_id and device.customer_id =#{customerId}
         <where>
             device.metercode not in(select metercode from pay_base_customerandmeterrela where businessstate = '1')
@@ -453,16 +455,18 @@
 
     <select id="selectMeterElenoMeterInfo" resultType="com.bz.smart_city.entity.pay.archives.PayAccountInfo">
         select
-        account.accountnumber as "accountnumber",
-        account.calculateway as "calculateway",
-        account.waterproperty_id as "waterPropertyId",
-        account.address as installAddress,
-        device.metercode as "metercode",
-        account.name as accountname,
-        account.telephone as telephone,
-        account.idcardno as idcardno,
-        device.water_meter_no as "metereleno"
+            account.accountnumber as "accountnumber",
+            ifnull(account.calculateway,c.calculateway) AS "calculateway",
+            ifnull(account.waterproperty_id,c.waterproperty_id) AS "waterPropertyId",
+            account.address as installAddress,
+            device.metercode as "metercode",
+            account.name as accountname,
+            account.telephone as telephone,
+            account.idcardno as idcardno,
+            device.water_meter_no as "metereleno",
+            c.valve_rule_id as "valveRuleId"
         from pay_base_account account
+        left join pay_base_customerandmeterrela c on account.id = c.account_id and c.customer_id =#{customerId}
         inner join sc_device device on account.id = device.account_id and device.customer_id =#{customerId}
         <where>
             device.id not in(select watermeter_id from pay_base_customerandmeterrela where businessstate = '1')