xiaoyong931011
2022-11-23 bfbb03c514b9e60485ea13d5679e6af2e8aeb354
src/main/resources/mapper/dapp/IgtOnHookPlanOrderDao.xml
@@ -12,7 +12,7 @@
    <update id="updateAvaAmountById">
        update igt_on_hook_plan_order
        set
            ava_amount = ava_amount - #{amount},
            ava_amount = ava_amount - #{amount}
        where
            id = #{id}
          and ava_amount - #{amount} <![CDATA[ >= ]]> 0
@@ -21,7 +21,7 @@
    <update id="addAvaAmountById">
        update igt_on_hook_plan_order
        set
            ava_amount = ava_amount + #{amount},
            ava_amount = ava_amount + #{amount}
        where
            id = #{id}
    </update>
@@ -67,8 +67,11 @@
        left join dapp_member m on m.id = s.member_id
        <where>
            <if test="record != null" >
                <if test="record.username!=null and record.username!=''">
                    and m.username = #{record.username}
                </if>
                <if test="record.description!=null and record.description!=''">
                    (s.member_id in (select id from dapp_member where FIND_IN_SET(#{record.description}, referer_ids)))
                    and (s.member_id in (select id from dapp_member where FIND_IN_SET(#{record.description}, referer_ids)))
                </if>
                <if test="record.state!=null and record.state!=''">
                    and s.state= #{record.state}
@@ -81,4 +84,40 @@
        order by s.create_time desc
    </select>
    <select id="selectIdsByState" resultType="java.lang.Long">
        SELECT
            a.id
        FROM igt_on_hook_plan_order a
        where a.state = #{state}
    </select>
    <update id="updateByIds" parameterType="list">
            update igt_on_hook_plan_order
            set
                state = 2
            where 1=1
        <foreach collection="list" item="id">
              or id = #{id}
        </foreach>
    </update>
    <select id="findFlowListInPage" resultType="cc.mrbird.febs.dapp.entity.DappAccountMoneyChangeEntity">
        SELECT
        a.*,
               b.username username
        FROM
        dapp_account_money_change a
        left join dapp_member b on a.member_id = b.id
        where a.order_id = #{orderId}
        order by a.create_time asc
    </select>
    <update id="updatePlanOrder">
        update igt_on_hook_plan_order
        set
            state = 3
        where
            state = 1
    </update>
</mapper>