|
@@ -4,35 +4,17 @@
|
|
|
<select id="findSysMonthCycle" resultType="com.bz.smart_city.dto.pay.PayPayCheckbalanceItemDto">
|
|
|
select
|
|
|
#{cycle} cycle,
|
|
|
- ppac.agent_name as typeName,
|
|
|
- ppac.agent_code as typeCode,
|
|
|
+ psd.label as typeName,
|
|
|
+ psd.`value` as typeCode,
|
|
|
SUM(ppac.amount) sumAmount
|
|
|
from pay_pay_agenttransaction ppac
|
|
|
- where ppac.transtime>= #{stTime} and ppac.transtime <= #{endTime} and ppac.state not in(0,4)
|
|
|
+ left join pay_pay_agentbranch ppa on ppac.agentbranch_id = ppa.id and ppa.site_id=#{siteId} and ppa.customer_id=#{customerId}
|
|
|
+ left join pay_sys_dict psd on ppa.type = psd.`value` and psd.type = '机构类型' and psd.site_id=#{siteId} and psd.customer_id=#{customerId}
|
|
|
+ where ppac.transtime>= #{stTime} and ppac.transtime <![CDATA[<=]]> #{endTime} and ppac.state not in(0,4)
|
|
|
and ppac.site_id=#{siteId} and ppac.customer_id=#{customerId}
|
|
|
- group by ppac.agent_name,ppac.agent_code
|
|
|
+ group by psd.label,psd.`value`
|
|
|
</select>
|
|
|
|
|
|
- <select id="findSysMonthCycle2" resultType="com.bz.smart_city.dto.pay.PayPayCheckbalanceAgentDto">
|
|
|
- SELECT
|
|
|
- ppab.name as agentName,
|
|
|
- ppab.type agentTypeId,
|
|
|
- SUM(ppac.amount) sysData,
|
|
|
- #{cycle} cycle
|
|
|
- from pay_pay_agenttransaction ppac
|
|
|
- left JOIN pay_pay_agentbranch ppab on ppab.id = ppac.agentbranch_id
|
|
|
- where ppac.transtime>= #{stTime} and ppac.transtime <![CDATA[<]]> #{endTime}
|
|
|
- and ppac.site_id=#{siteId} and ppac.customer_id=#{customerId} and ppab.name=#{agentName}
|
|
|
- GROUP BY ppab.name,ppab.type
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="findTradeMonthCycle2" resultType="com.bz.smart_city.dto.pay.PayPayCheckbalanceAgentDto">
|
|
|
- select
|
|
|
- IFNULL(sum(trans_fee),0) tradeData
|
|
|
- from pay_pay_checkbalance
|
|
|
- where transtime>=#{stTime} and transtime <![CDATA[<]]> #{endTime}
|
|
|
- and site_id=#{siteId} and customer_id=#{customerId} and machid=#{machid}
|
|
|
- </select>
|
|
|
|
|
|
<select id="findTradeMonthCycle" resultType="com.bz.smart_city.dto.pay.PayPayCheckbalanceItemDto">
|
|
|
select
|
|
@@ -55,31 +37,33 @@
|
|
|
|
|
|
<select id="findClosingAccount" resultType="com.bz.smart_city.entity.pay.BaseClosingAccountInfo">
|
|
|
select
|
|
|
- pbc.`name`,
|
|
|
- pbc.`year`,
|
|
|
- pbc.`month`,
|
|
|
- pbc.starttime as startTime,
|
|
|
- pbc.endtime as endTime,
|
|
|
- pbc.state
|
|
|
+ pbc.`name`,
|
|
|
+ pbc.`year`,
|
|
|
+ pbc.`month`,
|
|
|
+ pbc.starttime as startTime,
|
|
|
+ pbc.endtime as endTime,
|
|
|
+ pbc.state
|
|
|
from pay_base_closingaccountinfo pbc
|
|
|
where pbc.year=#{year,jdbcType=INTEGER} and pbc.site_id=#{siteId} and pbc.customer_id=#{customerId}
|
|
|
and pbc.endtime is not null and pbc.starttime is not null
|
|
|
<if test="month != null and month != '' "> and pbc.month=#{month}</if>
|
|
|
- order by pbc.year,pbc.month desc
|
|
|
+ order by pbc.year,pbc.month desc
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="findSysDay2Cycle" resultType="com.bz.smart_city.dto.pay.PayPayCheckbalanceItemDto">
|
|
|
select
|
|
|
- ppac.agent_name as typeName,
|
|
|
- ppac.agent_code as typeCode,
|
|
|
+ psd.label as typeName,
|
|
|
+ psd.`value` as typeCode,
|
|
|
IFNULL(SUM(ppac.amount),0) sumAmount,
|
|
|
date(ppac.transtime) as ymd
|
|
|
from pay_pay_agenttransaction ppac
|
|
|
+ left join pay_pay_agentbranch ppa on ppac.agentbranch_id = ppa.id and ppa.site_id=#{siteId} and ppa.customer_id=#{customerId}
|
|
|
+ left join pay_sys_dict psd on ppa.type = psd.`value` and psd.type = '机构类型' and psd.site_id=#{siteId} and psd.customer_id=#{customerId}
|
|
|
where ppac.state not in(0,4) and ppac.transtime >= #{stTime} and ppac.transtime <![CDATA[<=]]> #{endTime}
|
|
|
and ppac.site_id=#{siteId} and ppac.customer_id=#{customerId}
|
|
|
- group by agent_name,agent_code,ymd ORDER BY ymd asc
|
|
|
+ group by psd.label,psd.`value`,ymd ORDER BY ymd asc
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -106,25 +90,25 @@
|
|
|
|
|
|
<select id="findTradeDetail" resultType="com.bz.smart_city.dto.pay.PayBaseAccountTransactionsDto">
|
|
|
select
|
|
|
- ptrans.id,
|
|
|
- ptrans.`name` as transactionInfo,
|
|
|
- ptrans.payseriesno,
|
|
|
- ptrans.transamount,
|
|
|
- ptrans.transtime,
|
|
|
- ptrans.transtype,
|
|
|
- ptrans.payway,
|
|
|
- psd1.label as transtypeName,
|
|
|
- psd2.label as paywayName,
|
|
|
- pagent.order_no orderNo,
|
|
|
- ptrans.canceltime,
|
|
|
- ptrans.iscanceled,
|
|
|
- ptrans.cancelperson,
|
|
|
- scu.`name` as cancelpersonName
|
|
|
+ ptrans.id,
|
|
|
+ ptrans.`name` as transactionInfo,
|
|
|
+ ptrans.payseriesno,
|
|
|
+ ptrans.transamount,
|
|
|
+ ptrans.transtime,
|
|
|
+ ptrans.transtype,
|
|
|
+ ptrans.payway,
|
|
|
+ psd1.label as transtypeName,
|
|
|
+ psd2.label as paywayName,
|
|
|
+ pagent.order_no orderNo,
|
|
|
+ ptrans.canceltime,
|
|
|
+ ptrans.iscanceled,
|
|
|
+ ptrans.cancelperson,
|
|
|
+ scu.`name` as cancelpersonName
|
|
|
from pay_pay_transactiondetails ptrans
|
|
|
LEFT JOIN pay_sys_dict psd1 on psd1.`value` = ptrans.transtype and psd1.type='交易类型' and psd1.site_id=#{siteId} and psd1.customer_id=#{customerId}
|
|
|
LEFT JOIN pay_sys_dict psd2 on psd2.`value` = ptrans.payway and psd2.type='支付方式' and psd2.site_id=#{siteId} and psd2.customer_id=#{customerId}
|
|
|
left join pay_pay_agenttransaction pagent on pagent.payseriesno = ptrans.payseriesno and pagent.site_id=#{siteId} and pagent.customer_id=#{customerId}
|
|
|
- left join sc_user scu on scu.id = ptrans.cancelperson
|
|
|
+ left join sc_user scu on scu.id = ptrans.cancelperson
|
|
|
where ptrans.site_id=#{siteId} and ptrans.customer_id=#{customerId}
|
|
|
and ptrans.create_date >= #{stTime} and ptrans.create_date <![CDATA[<]]> #{endTime}
|
|
|
<if test="name != null and name != '' ">
|