Commit e5e2d6f9 by Java-聂换换

余额

parent 2172f786
......@@ -126,19 +126,21 @@
<select id="getBenefitSum" resultType="com.thinkgem.jeesite.modules.pay.entity.BenefitEntity">
SELECT
SUM(amount) AS amount
FROM youka_benefit
WHERE user_code = #{userCode}
AND del_flag = 0
AND benefit_type = #{benefitType}
SUM(b.amount) AS amount
FROM youka_benefit b
LEFT JOIN youka_orders o ON o.`code` = b.order_code
WHERE b.user_code = #{userCode}
AND b.del_flag = 0
AND b.benefit_type = #{benefitType}
AND o.pay_status = 2
<if test="benefitStatus != null and benefitStatus != ''">
AND benefit_status = #{benefitStatus}
AND b.benefit_status = #{benefitStatus}
</if>
<if test="startTime != null and startTime != ''">
AND create_date >= #{startTime}
AND b.create_date >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND create_date &lt;= #{endTime}
AND b.create_date &lt;= #{endTime}
</if>
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment