| | |
| | | update igt_on_hook_plan_order |
| | | set |
| | | ava_amount = ava_amount - #{amount}, |
| | | profit = profit + #{profit} |
| | | where |
| | | id = #{id} |
| | | and ava_amount - #{amount} <![CDATA[ >= ]]> 0 |
| | |
| | | limit 1 |
| | | </select> |
| | | |
| | | <update id="addAvaAmountAddProfitById"> |
| | | <update id="AddProfitById"> |
| | | update igt_on_hook_plan_order |
| | | set |
| | | ava_amount = ava_amount + #{amount}, |
| | | profit = profit + #{profit} |
| | | where |
| | | id = #{id} |
| | | </update> |
| | | |
| | | <select id="selectSumProfitByMemberId" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | ifnull(sum(a.profit),0) |
| | | FROM igt_on_hook_plan_order a |
| | | where a.member_id = #{memberId} |
| | | </select> |
| | | |
| | | </mapper> |