|
@@ -237,31 +237,33 @@
|
|
|
|
|
|
<select id="getAll" resultType="com.bz.smart_city.dto.pay.PayCustomerDto">
|
|
|
select
|
|
|
- customer.fixedamount as "fixedamount",
|
|
|
- customer.id as "id",
|
|
|
- account.accountnumber as "accountnumber",
|
|
|
- account.name as "accountname",
|
|
|
- account.telephone as "telephone",
|
|
|
- customer.metercode as "metercode",
|
|
|
- property.id as "waterPropertyId",
|
|
|
- property.name as "waterPropertyName",
|
|
|
- account.address as "address",
|
|
|
- customer.opendate as "opendate",
|
|
|
- customer.office_id as "officeId",
|
|
|
- account.email,
|
|
|
- customer.vatno,
|
|
|
- customer.businessstate as "businessstate",
|
|
|
- (select label from pay_sys_dict where type = '开户状态' and value = customer.businessstate and site_id = #{siteId} and customer_id =#{customerId}) as "businessName",
|
|
|
- customer.calculateway as "calculateway",
|
|
|
- (select label from pay_sys_dict where type = '结算方式' and value = customer.calculateway and site_id = #{siteId} and customer_id =#{customerId}) as "calculatewayName",
|
|
|
- account.idtype as "idtype",
|
|
|
- (select label from pay_sys_dict where type = '证件类型' and value = account.idtype and site_id = #{siteId} and customer_id =#{customerId}) as "idtypeName",
|
|
|
- account.idcardno as "idcardno",
|
|
|
- customer.housetype as "housetype",
|
|
|
- (select label from pay_sys_dict where type = '住房类型' and value = customer.housetype and site_id = #{siteId} and customer_id =#{customerId}) as "housetypeName",
|
|
|
- customer.customergroup as "customergroup",
|
|
|
- (select label from pay_sys_dict where type = '开户分组' and value = customer.customergroup and site_id = #{siteId} and customer_id =#{customerId}) as "customergroupName"
|
|
|
+ customer.fixedamount as "fixedamount",
|
|
|
+ customer.id as "id",
|
|
|
+ account.accountnumber as "accountnumber",
|
|
|
+ account.name as "accountname",
|
|
|
+ account.telephone as "telephone",
|
|
|
+ customer.metercode as "metercode",
|
|
|
+ device.water_meter_no as "metereleno",
|
|
|
+ property.id as "waterPropertyId",
|
|
|
+ property.name as "waterPropertyName",
|
|
|
+ account.address as "address",
|
|
|
+ customer.opendate as "opendate",
|
|
|
+ customer.office_id as "officeId",
|
|
|
+ account.email,
|
|
|
+ customer.vatno,
|
|
|
+ customer.businessstate as "businessstate",
|
|
|
+ (select label from pay_sys_dict where type = '开户状态' and value = customer.businessstate and site_id = #{siteId} and customer_id =#{customerId}) as "businessName",
|
|
|
+ customer.calculateway as "calculateway",
|
|
|
+ (select label from pay_sys_dict where type = '结算方式' and value = customer.calculateway and site_id = #{siteId} and customer_id =#{customerId}) as "calculatewayName",
|
|
|
+ account.idtype as "idtype",
|
|
|
+ (select label from pay_sys_dict where type = '证件类型' and value = account.idtype and site_id = #{siteId} and customer_id =#{customerId}) as "idtypeName",
|
|
|
+ account.idcardno as "idcardno",
|
|
|
+ customer.housetype as "housetype",
|
|
|
+ (select label from pay_sys_dict where type = '住房类型' and value = customer.housetype and site_id = #{siteId} and customer_id =#{customerId}) as "housetypeName",
|
|
|
+ customer.customergroup as "customergroup",
|
|
|
+ (select label from pay_sys_dict where type = '开户分组' and value = customer.customergroup and site_id = #{siteId} and customer_id =#{customerId}) as "customergroupName"
|
|
|
from pay_base_customerandmeterrela customer
|
|
|
+ left join sc_device device on customer.watermeter_id = device.id
|
|
|
left join pay_base_account account on account.id = customer.account_id
|
|
|
left join pay_base_waterproperty property on property.id = customer.waterproperty_id
|
|
|
<where>
|
|
@@ -279,6 +281,7 @@
|
|
|
or customer.metercode like concat('%',#{condition},'%')
|
|
|
or account.address like concat('%',#{condition},'%')
|
|
|
or account.telephone like concat('%',#{condition},'%')
|
|
|
+ or device.water_meter_no like concat('%',#{condition},'%')
|
|
|
)
|
|
|
</if>
|
|
|
<if test="waterPropertyId != null">
|
|
@@ -364,10 +367,10 @@
|
|
|
|
|
|
<select id="selectAccountInfo" resultType="com.bz.smart_city.entity.pay.archives.MeterListInfo">
|
|
|
select
|
|
|
- device.metercode as "metercode",
|
|
|
- sil.user_name as accountname,
|
|
|
- sil.user_phone as telephone,
|
|
|
- sil.id_card as idcardno
|
|
|
+ device.metercode as "metercode",
|
|
|
+ sil.user_name as accountname,
|
|
|
+ sil.user_phone as telephone,
|
|
|
+ sil.id_card as idcardno
|
|
|
from pay_base_account account
|
|
|
inner join sc_device device on account.id = device.account_id
|
|
|
inner join sc_install_list sil on sil.device_id = device.id
|
|
@@ -388,13 +391,14 @@
|
|
|
|
|
|
<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",
|
|
|
- device.metercode as "metercode",
|
|
|
- sil.user_name as accountname,
|
|
|
- sil.user_phone as telephone,
|
|
|
- sil.id_card as idcardno
|
|
|
+ account.accountnumber as "accountnumber",
|
|
|
+ account.calculateway as "calculateway",
|
|
|
+ account.waterproperty_id as "waterPropertyId",
|
|
|
+ device.metercode as "metercode",
|
|
|
+ sil.user_name as accountname,
|
|
|
+ sil.user_phone as telephone,
|
|
|
+ sil.id_card as idcardno,
|
|
|
+ device.water_meter_no as "metereleno"
|
|
|
from pay_base_account account
|
|
|
inner join sc_device device on account.id = device.account_id
|
|
|
inner join sc_install_list sil on sil.device_id = device.id
|
|
@@ -413,11 +417,40 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <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",
|
|
|
+ device.metercode as "metercode",
|
|
|
+ sil.user_name as accountname,
|
|
|
+ sil.user_phone as telephone,
|
|
|
+ sil.id_card as idcardno,
|
|
|
+ device.water_meter_no as "metereleno"
|
|
|
+ from pay_base_account account
|
|
|
+ inner join sc_device device on account.id = device.account_id
|
|
|
+ inner join sc_install_list sil on sil.device_id = device.id
|
|
|
+ <where>
|
|
|
+ device.id not in(select watermeter_id from pay_base_customerandmeterrela where businessstate = '1')
|
|
|
+ <if test="metereleno != null">
|
|
|
+ and device.water_meter_no like concat('%',#{metereleno},'%')
|
|
|
+ </if>
|
|
|
+ <!--<if test="siteId != null">
|
|
|
+ and account.site_id = #{siteId}
|
|
|
+ </if>-->
|
|
|
+ <if test="customerId != null">
|
|
|
+ and account.customer_id = #{customerId}
|
|
|
+ </if>
|
|
|
+ order by account.create_date desc
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectAccountWater" resultType="com.bz.smart_city.entity.pay.archives.CustomerListInfo">
|
|
|
select
|
|
|
- accountnumber as "accountnumber",
|
|
|
- calculateway as "calculateway" ,
|
|
|
- waterproperty_id as "waterPropertyId"
|
|
|
+ accountnumber as "accountnumber",
|
|
|
+ calculateway as "calculateway" ,
|
|
|
+ waterproperty_id as "waterPropertyId",
|
|
|
+ device.water_meter_no as "metereleno"
|
|
|
from pay_base_account account
|
|
|
inner join sc_device device on account.id = device.account_id
|
|
|
<where>
|