|
@@ -23,19 +23,19 @@
|
|
|
|
|
|
<select id="findList" resultType="com.bz.smart_city.entity.pay.archives.PayBaseCustomerandmeterrela">
|
|
|
select
|
|
|
- customer.id as "id",
|
|
|
- customer.watermeter_id as "watermeterId",
|
|
|
- account.id as "accountId",
|
|
|
- account.accountnumber as "accountnumber",
|
|
|
- customer.office_id as "officeId",
|
|
|
- account.name as "name",
|
|
|
- account.telephone as "telephone",
|
|
|
- customer.metercode as "metercode",
|
|
|
- pro.name as "propertyName",
|
|
|
- account.address as "address",
|
|
|
- customer.opendate as "opendate",
|
|
|
- customer.businessstate as "businessstate",
|
|
|
- customer.calculateway as "calculateway"
|
|
|
+ customer.id as "id",
|
|
|
+ customer.watermeter_id as "watermeterId",
|
|
|
+ account.id as "accountId",
|
|
|
+ account.accountnumber as "accountnumber",
|
|
|
+ customer.office_id as "officeId",
|
|
|
+ account.name as "name",
|
|
|
+ account.telephone as "telephone",
|
|
|
+ customer.metercode as "metercode",
|
|
|
+ pro.name as "propertyName",
|
|
|
+ account.address as "address",
|
|
|
+ customer.opendate as "opendate",
|
|
|
+ customer.businessstate as "businessstate",
|
|
|
+ customer.calculateway as "calculateway"
|
|
|
from pay_base_customerandmeterrela customer
|
|
|
left join pay_base_account account on customer.account_id = account.id
|
|
|
left join pay_base_waterproperty pro on pro.id = customer.waterproperty_id
|
|
@@ -58,7 +58,7 @@
|
|
|
|
|
|
<select id="getAccountId" resultType="com.bz.smart_city.entity.pay.PayBaseAccount">
|
|
|
select
|
|
|
- id as "id"
|
|
|
+ id as "id"
|
|
|
from pay_base_account
|
|
|
<where>
|
|
|
<if test="siteId != null">
|
|
@@ -112,69 +112,69 @@
|
|
|
<insert id="insertList">
|
|
|
INSERT INTO pay_base_customerandmeterrela
|
|
|
(
|
|
|
- id,
|
|
|
- account_id,
|
|
|
- watermeter_id,
|
|
|
- accountname,
|
|
|
- accountnumber,
|
|
|
- metercode,
|
|
|
- businessstate,
|
|
|
- office_id,
|
|
|
- housetype,
|
|
|
- calculateway,
|
|
|
- customercategory,
|
|
|
- customergroup,
|
|
|
- fixedamount,
|
|
|
- vatno,
|
|
|
- bankaccount,
|
|
|
- invoicetitle,
|
|
|
- address,
|
|
|
- opendate,
|
|
|
- waterproperty_id,
|
|
|
- watertype,
|
|
|
- canceldate,
|
|
|
- create_by,
|
|
|
- create_date,
|
|
|
- update_by,
|
|
|
- update_date,
|
|
|
- remarks,
|
|
|
- del_flag,
|
|
|
- site_id,
|
|
|
- customer_id
|
|
|
+ id,
|
|
|
+ account_id,
|
|
|
+ watermeter_id,
|
|
|
+ accountname,
|
|
|
+ accountnumber,
|
|
|
+ metercode,
|
|
|
+ businessstate,
|
|
|
+ office_id,
|
|
|
+ housetype,
|
|
|
+ calculateway,
|
|
|
+ customercategory,
|
|
|
+ customergroup,
|
|
|
+ fixedamount,
|
|
|
+ vatno,
|
|
|
+ bankaccount,
|
|
|
+ invoicetitle,
|
|
|
+ address,
|
|
|
+ opendate,
|
|
|
+ waterproperty_id,
|
|
|
+ watertype,
|
|
|
+ canceldate,
|
|
|
+ create_by,
|
|
|
+ create_date,
|
|
|
+ update_by,
|
|
|
+ update_date,
|
|
|
+ remarks,
|
|
|
+ del_flag,
|
|
|
+ site_id,
|
|
|
+ customer_id
|
|
|
)
|
|
|
values
|
|
|
<foreach collection="customers" item="customer" index="index" separator=",">
|
|
|
- (
|
|
|
- #{customer.id,jdbcType=BIGINT},
|
|
|
- #{customer.accountId,jdbcType=BIGINT},
|
|
|
- #{customer.watermeterId,jdbcType=BIGINT},
|
|
|
- #{customer.accountname,jdbcType=VARCHAR},
|
|
|
- #{customer.accountnumber,jdbcType=VARCHAR},
|
|
|
- #{customer.metercode,jdbcType=VARCHAR},
|
|
|
- #{customer.businessstate,jdbcType=INTEGER},
|
|
|
- #{customer.officeId,jdbcType=BIGINT},
|
|
|
- #{customer.housetype,jdbcType=INTEGER},
|
|
|
- #{customer.calculateway,jdbcType=INTEGER},
|
|
|
- #{customer.customercategory,jdbcType=INTEGER},
|
|
|
- #{customer.customergroup,jdbcType=INTEGER},
|
|
|
- #{customer.fixedamount,jdbcType=VARCHAR},
|
|
|
- #{customer.vatno,jdbcType=VARCHAR},
|
|
|
- #{customer.bankaccount,jdbcType=VARCHAR},
|
|
|
- #{customer.invoicetitle,jdbcType=VARCHAR},
|
|
|
- #{customer.address,jdbcType=VARCHAR},
|
|
|
- #{customer.opendate,jdbcType=TIMESTAMP},
|
|
|
- #{customer.waterPropertyId,jdbcType=BIGINT},
|
|
|
- #{customer.watertype,jdbcType=INTEGER},
|
|
|
- #{customer.canceldate,jdbcType=TIMESTAMP},
|
|
|
- #{customer.createBy,jdbcType=VARCHAR},
|
|
|
- #{customer.createDate,jdbcType=TIMESTAMP},
|
|
|
- #{customer.updateBy,jdbcType=VARCHAR},
|
|
|
- #{customer.updateDate,jdbcType=TIMESTAMP},
|
|
|
- #{customer.remarks,jdbcType=VARCHAR},
|
|
|
- #{customer.delFlag,jdbcType=VARCHAR},
|
|
|
- #{customer.siteId,jdbcType=BIGINT},
|
|
|
- #{customer.customerId,jdbcType=BIGINT}
|
|
|
- )
|
|
|
+ (
|
|
|
+ #{customer.id,jdbcType=BIGINT},
|
|
|
+ #{customer.accountId,jdbcType=BIGINT},
|
|
|
+ #{customer.watermeterId,jdbcType=BIGINT},
|
|
|
+ #{customer.accountname,jdbcType=VARCHAR},
|
|
|
+ #{customer.accountnumber,jdbcType=VARCHAR},
|
|
|
+ #{customer.metercode,jdbcType=VARCHAR},
|
|
|
+ #{customer.businessstate,jdbcType=INTEGER},
|
|
|
+ #{customer.officeId,jdbcType=BIGINT},
|
|
|
+ #{customer.housetype,jdbcType=INTEGER},
|
|
|
+ #{customer.calculateway,jdbcType=INTEGER},
|
|
|
+ #{customer.customercategory,jdbcType=INTEGER},
|
|
|
+ #{customer.customergroup,jdbcType=INTEGER},
|
|
|
+ #{customer.fixedamount,jdbcType=VARCHAR},
|
|
|
+ #{customer.vatno,jdbcType=VARCHAR},
|
|
|
+ #{customer.bankaccount,jdbcType=VARCHAR},
|
|
|
+ #{customer.invoicetitle,jdbcType=VARCHAR},
|
|
|
+ #{customer.address,jdbcType=VARCHAR},
|
|
|
+ #{customer.opendate,jdbcType=TIMESTAMP},
|
|
|
+ #{customer.waterPropertyId,jdbcType=BIGINT},
|
|
|
+ #{customer.watertype,jdbcType=INTEGER},
|
|
|
+ #{customer.canceldate,jdbcType=TIMESTAMP},
|
|
|
+ #{customer.createBy,jdbcType=VARCHAR},
|
|
|
+ #{customer.createDate,jdbcType=TIMESTAMP},
|
|
|
+ #{customer.updateBy,jdbcType=VARCHAR},
|
|
|
+ #{customer.updateDate,jdbcType=TIMESTAMP},
|
|
|
+ #{customer.remarks,jdbcType=VARCHAR},
|
|
|
+ #{customer.delFlag,jdbcType=VARCHAR},
|
|
|
+ #{customer.siteId,jdbcType=BIGINT},
|
|
|
+ #{customer.customerId,jdbcType=BIGINT}
|
|
|
+ )
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -214,7 +214,7 @@
|
|
|
|
|
|
<select id="findByAccount" resultType="com.bz.smart_city.entity.pay.PayPayRechargeaccount">
|
|
|
select
|
|
|
- rech.*
|
|
|
+ rech.*
|
|
|
from pay_pay_rechargeaccount rech
|
|
|
<where>
|
|
|
<if test="accountId != null">
|
|
@@ -237,28 +237,28 @@
|
|
|
|
|
|
<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",
|
|
|
- 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",
|
|
|
+ property.id as "waterPropertyId",
|
|
|
+ property.name as "waterPropertyName",
|
|
|
+ account.address as "address",
|
|
|
+ customer.opendate as "opendate",
|
|
|
+ customer.office_id as "officeId",
|
|
|
+ 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 pay_base_account account on account.id = customer.account_id
|
|
|
left join pay_base_waterproperty property on property.id = customer.waterproperty_id
|
|
@@ -272,11 +272,11 @@
|
|
|
<if test="condition != null">
|
|
|
and
|
|
|
(
|
|
|
- account.accountnumber like concat('%',#{condition},'%')
|
|
|
- or account.name like concat('%',#{condition},'%')
|
|
|
- or customer.metercode like concat('%',#{condition},'%')
|
|
|
- or account.address like concat('%',#{condition},'%')
|
|
|
- or account.telephone like concat('%',#{condition},'%')
|
|
|
+ account.accountnumber like concat('%',#{condition},'%')
|
|
|
+ or account.name like concat('%',#{condition},'%')
|
|
|
+ or customer.metercode like concat('%',#{condition},'%')
|
|
|
+ or account.address like concat('%',#{condition},'%')
|
|
|
+ or account.telephone like concat('%',#{condition},'%')
|
|
|
)
|
|
|
</if>
|
|
|
<if test="waterPropertyId != null">
|
|
@@ -301,15 +301,15 @@
|
|
|
|
|
|
<select id="getList" resultType="com.bz.smart_city.entity.pay.archives.PayBaseCustomerandmeterrela">
|
|
|
select
|
|
|
- account.accountnumber as "accountnumber",
|
|
|
- account.name as "accountname",
|
|
|
- account.telephone as "telephone",
|
|
|
- customer.metercode as "metercode",
|
|
|
- property.name as "propertyName",
|
|
|
- device.loc_desc as "address",
|
|
|
- customer.opendate as "opendate",
|
|
|
- customer.businessstate as "businessstate",
|
|
|
- customer.calculateway as "calculateway"
|
|
|
+ account.accountnumber as "accountnumber",
|
|
|
+ account.name as "accountname",
|
|
|
+ account.telephone as "telephone",
|
|
|
+ customer.metercode as "metercode",
|
|
|
+ property.name as "propertyName",
|
|
|
+ device.loc_desc as "address",
|
|
|
+ customer.opendate as "opendate",
|
|
|
+ customer.businessstate as "businessstate",
|
|
|
+ customer.calculateway as "calculateway"
|
|
|
from pay_base_customerandmeterrela customer
|
|
|
left join pay_base_account account on account.id = customer.account_id
|
|
|
left join pay_base_waterproperty property on property.id = customer.waterproperty_id
|
|
@@ -324,11 +324,11 @@
|
|
|
<if test="condition != null">
|
|
|
and
|
|
|
(
|
|
|
- account.accountnumber like concat('%',#{condition},'%')
|
|
|
- or account.name like concat('%',#{condition},'%')
|
|
|
- or customer.metercode like concat('%',#{condition},'%')
|
|
|
- or account.address like concat('%',#{condition},'%')
|
|
|
- or account.telephone like concat('%',#{condition},'%')
|
|
|
+ account.accountnumber like concat('%',#{condition},'%')
|
|
|
+ or account.name like concat('%',#{condition},'%')
|
|
|
+ or customer.metercode like concat('%',#{condition},'%')
|
|
|
+ or account.address like concat('%',#{condition},'%')
|
|
|
+ or account.telephone like concat('%',#{condition},'%')
|
|
|
)
|
|
|
</if>
|
|
|
<if test="waterPropertyId != null">
|
|
@@ -347,7 +347,7 @@
|
|
|
|
|
|
<select id="queryNoOpenAccount" resultType="com.bz.smart_city.entity.pay.archives.DeviceListInfo">
|
|
|
select
|
|
|
- account.accountnumber as "accountnumber"
|
|
|
+ account.accountnumber as "accountnumber"
|
|
|
from pay_base_account account
|
|
|
<where>
|
|
|
<if test="siteId != null">
|
|
@@ -362,7 +362,7 @@
|
|
|
|
|
|
<select id="selectAccountInfo" resultType="com.bz.smart_city.entity.pay.archives.MeterListInfo">
|
|
|
select
|
|
|
- device.metercode as "metercode"
|
|
|
+ device.metercode as "metercode"
|
|
|
from pay_base_account account
|
|
|
inner join sc_device device on account.id = device.account_id
|
|
|
<where>
|
|
@@ -370,9 +370,9 @@
|
|
|
<if test="accountnumber != null">
|
|
|
and account.accountnumber =#{accountnumber}
|
|
|
</if>
|
|
|
- <!-- <if test="siteId != null">
|
|
|
- and account.site_id = #{siteId}
|
|
|
- </if>-->
|
|
|
+ <!-- <if test="siteId != null">
|
|
|
+ and account.site_id = #{siteId}
|
|
|
+ </if>-->
|
|
|
<if test="customerId != null">
|
|
|
and account.customer_id = #{customerId}
|
|
|
</if>
|
|
@@ -382,10 +382,10 @@
|
|
|
|
|
|
<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"
|
|
|
+ account.accountnumber as "accountnumber",
|
|
|
+ account.calculateway as "calculateway",
|
|
|
+ account.waterproperty_id as "waterPropertyId",
|
|
|
+ device.metercode as "metercode"
|
|
|
from pay_base_account account
|
|
|
inner join sc_device device on account.id = device.account_id
|
|
|
<where>
|
|
@@ -405,9 +405,9 @@
|
|
|
|
|
|
<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"
|
|
|
from pay_base_account account
|
|
|
inner join sc_device device on account.id = device.account_id
|
|
|
<where>
|
|
@@ -427,7 +427,7 @@
|
|
|
|
|
|
<select id="queryMetercode" resultType="com.bz.smart_city.entity.pay.archives.MeterListInfo">
|
|
|
select
|
|
|
- metercode from sc_device deivce
|
|
|
+ metercode from sc_device deivce
|
|
|
<where>
|
|
|
deivce.metercode not in (select metercode from pay_base_customerandmeterrela) and deivce.metercode is not null
|
|
|
<!--<if test="siteId != null">
|
|
@@ -498,7 +498,7 @@
|
|
|
from pay_base_customerandmeterrela a
|
|
|
|
|
|
<where>
|
|
|
- a.id =#{id}
|
|
|
+ a.id =#{id}
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -544,36 +544,36 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryCancelInfo" resultType="com.bz.smart_city.entity.pay.archives.PayBaseCustomerandmeterrela">
|
|
|
- select
|
|
|
- a.id,
|
|
|
- a.account_id AS "accountId",
|
|
|
- a.watermeter_id AS "watermeterId",
|
|
|
- a.accountname,
|
|
|
- a.accountnumber,
|
|
|
- a.metercode,
|
|
|
- a.businessstate,
|
|
|
- a.office_id AS "officeId",
|
|
|
- a.housetype,
|
|
|
- a.calculateway,
|
|
|
- a.customercategory,
|
|
|
- a.customergroup,
|
|
|
- a.fixedamount,
|
|
|
- a.vatno,
|
|
|
- a.bankaccount,
|
|
|
- a.invoicetitle,
|
|
|
- a.address,
|
|
|
- a.opendate,
|
|
|
- a.waterproperty_id AS "waterpropertyId",
|
|
|
- a.watertype,
|
|
|
- a.canceldate,
|
|
|
- a.create_by AS "createBy",
|
|
|
- a.create_date AS "createDate",
|
|
|
- a.update_by AS "updateBy",
|
|
|
- a.update_date AS "updateDate",
|
|
|
- a.remarks AS "remarks",
|
|
|
- a.del_flag AS "delFlag",
|
|
|
- a.site_id as "siteId",
|
|
|
- a.customer_id as "customerId"
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ a.account_id AS "accountId",
|
|
|
+ a.watermeter_id AS "watermeterId",
|
|
|
+ a.accountname,
|
|
|
+ a.accountnumber,
|
|
|
+ a.metercode,
|
|
|
+ a.businessstate,
|
|
|
+ a.office_id AS "officeId",
|
|
|
+ a.housetype,
|
|
|
+ a.calculateway,
|
|
|
+ a.customercategory,
|
|
|
+ a.customergroup,
|
|
|
+ a.fixedamount,
|
|
|
+ a.vatno,
|
|
|
+ a.bankaccount,
|
|
|
+ a.invoicetitle,
|
|
|
+ a.address,
|
|
|
+ a.opendate,
|
|
|
+ a.waterproperty_id AS "waterpropertyId",
|
|
|
+ a.watertype,
|
|
|
+ a.canceldate,
|
|
|
+ a.create_by AS "createBy",
|
|
|
+ a.create_date AS "createDate",
|
|
|
+ a.update_by AS "updateBy",
|
|
|
+ a.update_date AS "updateDate",
|
|
|
+ a.remarks AS "remarks",
|
|
|
+ a.del_flag AS "delFlag",
|
|
|
+ a.site_id as "siteId",
|
|
|
+ a.customer_id as "customerId"
|
|
|
from pay_base_customerandmeterrela a
|
|
|
<where>
|
|
|
<if test="siteId != null">
|
|
@@ -594,4 +594,8 @@
|
|
|
<select id="queryMeterState" resultType="java.lang.Integer">
|
|
|
select is_accepted as "isAccepted" from sc_install_list where account_id =#{accountId} and customer_id =#{customerId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getParentOfficeId" resultType="com.bz.smart_city.entity.Organization">
|
|
|
+ select id from sc_organization where site_id =#{siteId} and parent_id =#{id} and name =#{name}
|
|
|
+ </select>
|
|
|
</mapper>
|