|
|
@@ -210,7 +210,10 @@ |
|
|
<select id="getTotalCreditAmount" parameterType="com.iformall.domain.po.WxCreditHistory" |
|
|
<select id="getTotalCreditAmount" parameterType="com.iformall.domain.po.WxCreditHistory" |
|
|
resultType="java.lang.Long"> |
|
|
resultType="java.lang.Long"> |
|
|
select ifnull(sum(credit.amount),0) amount from ( |
|
|
select ifnull(sum(credit.amount),0) amount from ( |
|
|
select min(credit.credit_amount) amount,credit.c_user_id from wx_credit_history credit |
|
|
|
|
|
|
|
|
select credit.credit_amount as amount,credit.c_user_id from wx_credit_history credit |
|
|
|
|
|
INNER join (select max(create_date) create_date,credit.c_user_id |
|
|
|
|
|
from wx_credit_history credit group by credit.c_user_id) credit_max_id |
|
|
|
|
|
on credit.create_date=credit_max_id.create_date |
|
|
INNER JOIN wx_c_user_basic_info basic ON basic.id = credit.c_user_id |
|
|
INNER JOIN wx_c_user_basic_info basic ON basic.id = credit.c_user_id |
|
|
LEFT JOIN wx_merchant merchant ON credit.merchant_id = merchant.id |
|
|
LEFT JOIN wx_merchant merchant ON credit.merchant_id = merchant.id |
|
|
<include refid="customWhereConditions"/> |
|
|
<include refid="customWhereConditions"/> |
|
|
|