xiaoyong931011
2022-11-23 bfbb03c514b9e60485ea13d5679e6af2e8aeb354
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>
@@ -67,12 +66,11 @@
        FROM igt_on_hook_plan_order_item a
        <where>
            a.order_id = #{orderId}
            and a.create_time &lt;= #{endTime}
            and a.create_time &lt; #{endTime}
            <if test="startTime != null">
                and a.create_time > #{startTime}
            </if>
        </where>
        order by create_time desc
    </select>
    <select id="selectByIsgoalAndOrderId" resultType="java.lang.Long">
@@ -90,10 +88,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 asc
          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>