xiaoyong931011
2023-02-09 e92b00089d8d57899df380135d79864dade09837
src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
@@ -46,9 +46,8 @@
    <select id="selectTotalProfitByMemberIdAndStateAndIsgoal" resultType="java.math.BigDecimal">
        SELECT
            ifnull(sum(a.profit),0)
        FROM igt_on_hook_plan_order_item a
        FROM igt_on_hook_plan_order a
        where  a.member_id = #{memberId}
          and a.is_goal = #{isGoal}
          and a.state = #{state}
    </select>
@@ -89,7 +88,7 @@
        FROM igt_on_hook_plan_order_item a
        where a.order_id = #{orderId}
          and a.is_goal = #{isGoal}
          and a.create_time &lt; #{endTime}
          and a.id &lt; #{id}
        order by a.id desc
        limit 1
    </select>
@@ -104,5 +103,18 @@
            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>