| @@ -211,6 +211,8 @@ | |||||
| 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 max(credit.credit_amount) amount,credit.c_user_id from wx_credit_history credit | select max(credit.credit_amount) amount,credit.c_user_id from wx_credit_history credit | ||||
| 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 | |||||
| <include refid="customWhereConditions"/> | <include refid="customWhereConditions"/> | ||||
| group by credit.c_user_id | group by credit.c_user_id | ||||
| ) credit | ) credit | ||||
| @@ -219,6 +221,8 @@ | |||||
| <select id="getIncrementCreditAmount" parameterType="com.iformall.domain.po.WxCreditHistory" | <select id="getIncrementCreditAmount" parameterType="com.iformall.domain.po.WxCreditHistory" | ||||
| resultType="java.lang.Long"> | resultType="java.lang.Long"> | ||||
| select ifnull(sum(credit.credit_num),0) amount from wx_credit_history credit | select ifnull(sum(credit.credit_num),0) amount from wx_credit_history credit | ||||
| 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 | |||||
| <include refid="customWhereConditions"/> | <include refid="customWhereConditions"/> | ||||
| and credit.credit_num>0 | and credit.credit_num>0 | ||||
| </select> | </select> | ||||
| @@ -226,6 +230,8 @@ | |||||
| <select id="getDecrementCreditAmount" parameterType="com.iformall.domain.po.WxCreditHistory" | <select id="getDecrementCreditAmount" parameterType="com.iformall.domain.po.WxCreditHistory" | ||||
| resultType="java.lang.Long"> | resultType="java.lang.Long"> | ||||
| select ABS(ifnull(sum(credit.credit_num),0)) amount from wx_credit_history credit | select ABS(ifnull(sum(credit.credit_num),0)) amount from wx_credit_history credit | ||||
| 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 | |||||
| <include refid="customWhereConditions"/> | <include refid="customWhereConditions"/> | ||||
| and credit.credit_num < 0 | and credit.credit_num < 0 | ||||
| </select> | </select> | ||||
| @@ -233,6 +239,8 @@ | |||||
| <select id="getPeopleCount" parameterType="com.iformall.domain.po.WxCreditHistory" resultType="java.lang.Long"> | <select id="getPeopleCount" parameterType="com.iformall.domain.po.WxCreditHistory" resultType="java.lang.Long"> | ||||
| select ifnull(sum(credit.people),0) people from ( | select ifnull(sum(credit.people),0) people from ( | ||||
| select count(*) people from wx_credit_history credit | select count(*) people from wx_credit_history credit | ||||
| 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 | |||||
| <include refid="customWhereConditions"/> | <include refid="customWhereConditions"/> | ||||
| group by credit.c_user_id | group by credit.c_user_id | ||||
| ) credit | ) credit | ||||