xiaoyong931011
2022-11-02 a3243dabdec4b7c730002e98e9300a37f8f9930e
src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
@@ -72,7 +72,6 @@
                and a.create_time > #{startTime}
            </if>
        </where>
        order by create_time desc
    </select>
    <select id="selectByIsgoalAndOrderId" resultType="java.lang.Long">
@@ -90,10 +89,33 @@
        FROM igt_on_hook_plan_order_item a
        where a.order_id = #{orderId}
          and a.is_goal = #{isGoal}
          and a.create_time &lt; #{endTime}
        order by create_time desc
          and a.id &lt; #{id}
        order by a.id desc
        limit 1
    </select>
    <select id="selectOneByIgtIdAndMemberId" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrderItem">
        SELECT
            a.*
        FROM igt_on_hook_plan_order_item a
        where a.order_id = #{orderId}
          and a.member_id = #{memberId}
        order by a.id desc
            limit 1
    </select>
    <select id="selectTotalAmountByIDAndOrderId" resultType="java.math.BigDecimal">
        SELECT
        ifnull(sum(a.amount),0)
        FROM igt_on_hook_plan_order_item a
        <where>
            a.order_id = #{orderId}
            and a.id &lt; #{end}
            <if test="start != null">
                and a.id > #{start}
            </if>
        </where>
    </select>
</mapper>