<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bluefire.top.mapper.FlowOrderInfoMapper">

    <resultMap id="BaseResultMap" type="com.bluefire.top.entity.FlowOrderInfo">
        <id column="order_id" property="orderId"/>
        <result column="flow_app_id" property="flowAppId"/>
        <result column="package_id" property="packageId"/>
        <result column="enterprise_id" property="enterpriseId"/>
        <result column="order_type" property="orderType"/>
        <result column="user" property="user"/>
        <result column="used_mobile" property="usedMobile"/>
        <result column="extorder_id" property="extorderId"/>
        <result column="rec_id" property="recId"/>
        <result column="apply_date" property="applyDate"/>
        <result column="active_date" property="activeDate"/>
        <result column="limited_date" property="limitedDate"/>
        <result column="status" property="tatus"/>
        <result column="note" property="note"/>
        <result column="mobile_operator" property="mobileOperator"/>
        <result column="mobile_home" property="mobileHomel"/>
        <result column="gw_seq_no" property="gwSeqNo"/>
        <result column="gw_status" property="gwStatus"/>
        <result column="last_modify_date" property="lastModifyDate"/>
        <result column="gw_error_code" property="gwErrorCode"/>
        <result column="flow_amount" property="flowAmount"/>
        <result column="adapter_name" property="adapterName"/>
        <result column="deal_flag" property="dealFlag"/>
        <result column="opr_code" property="oprCode"/>
        <result column="usage_limit" property="uageLimit"/>
        <result column="valid_months" property="validMonths"/>
        <result column="eff_rule" property="effRule"/>
        <result column="batch_count" property="batchCount"/>
        <result column="send_count" property="sendCount"/>
        <result column="area_code" property="areaCode"/>
        <result column="price" property="price"/>
        <result column="partner_balance_price" property="partnerBalancePrice"/>
        <result column="operator_balance_price" property="operatorBalancePrice"/>
        <result column="order_detail_id" property="orderDetailId"/>
        <result column="channel_id" property="channelId"/>
        <result column="check_time" property="checkTime"/>
        <result column="product_id" property="productId"/>
        <result column="batch_id" property="batchId"/>
        <result column="batch_id2" property="batchId2"/>
        <result column="attr1" property="attr1"/>
        <result column="attr2" property="attr2"/>
        <result column="attr3" property="attr3"/>
    </resultMap>

    <select id="queryFlowOrders" resultMap="BaseResultMap" parameterType="java.util.List">
        SELECT
        order_id,
        user,
        extorder_id,
        check_time
        FROM
        flow_order_info
        WHERE extorder_id
        IN
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
        ORDER BY check_time ASC
    </select>


    <select id="getSumFacePrice" resultType="java.lang.Integer">
        SELECT
        SUM(flow_amount)
        FROM
        flow_order_info
        WHERE extorder_id
        IN
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </select>


</mapper>
