xiaoyong931011
2022-10-25 b8bf19375db90bf5bd409cacfe6cb066c5f2b34a
src/main/resources/mapper/dapp/IgtOnHookPlanOrderDao.xml
@@ -13,7 +13,6 @@
        update igt_on_hook_plan_order
        set
            ava_amount = ava_amount - #{amount},
            profit = profit + #{profit}
        where
            id = #{id}
          and ava_amount - #{amount} <![CDATA[ >= ]]> 0
@@ -29,13 +28,26 @@
            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>
    <select id="selectByCreateTime" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrder">
        SELECT
            a.*
        FROM igt_on_hook_plan_order a
        where and date_format(a.create_time, '%Y-%m-%d') = #{createTime}
    </select>
</mapper>