<?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.hzs.report.order.mapper.CuMemberPerformanceSummaryMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hzs.common.domain.report.CuMemberPerformanceSummary">
    <result column="DEL_FLAG" property="delFlag" />
    <result column="PK_COUNTRY" property="pkCountry" />
    <result column="CREATION_TIME" property="creationTime" />
    <result column="MODIFIED_TIME" property="modifiedTime" />
    <result column="PK_CREATOR" property="pkCreator" />
    <result column="PK_MODIFIED" property="pkModified" />
        <result column="PK_ID" property="pkId" />
        <result column="SUMMARY_DATE" property="summaryDate" />
        <result column="RETAIL_REGISTER_AMOUNT" property="retailRegisterAmount" />
        <result column="RETAIL_REGISTER_PV" property="retailRegisterPv" />
        <result column="RETAIL_UPGRADE_AMOUNT" property="retailUpgradeAmount" />
        <result column="RETAIL_UPGRADE_PV" property="retailUpgradePv" />
        <result column="RETAIL_REPURCHASE_AMOUNT" property="retailRepurchaseAmount" />
        <result column="RETAIL_REPURCHASE_PV" property="retailRepurchasePv" />
        <result column="RETAIL_DISCOUNT_AMOUNT" property="retailDiscountAmount" />
        <result column="RETAIL_DISCOUNT_PV" property="retailDiscountPv" />
        <result column="TOTAL_AMOUNT" property="totalAmount" />
        <result column="TOTAL_PV" property="totalPv" />
        <result column="DIVIDEND_PV" property="dividendPv" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        DEL_FLAG,
        PK_COUNTRY,
        CREATION_TIME,
        MODIFIED_TIME,
        PK_CREATOR,
        PK_MODIFIED,
        PK_ID, SUMMARY_DATE, RETAIL_REGISTER_AMOUNT, RETAIL_REGISTER_PV, RETAIL_UPGRADE_AMOUNT, RETAIL_UPGRADE_PV, RETAIL_REPURCHASE_AMOUNT, RETAIL_REPURCHASE_PV, RETAIL_DISCOUNT_AMOUNT, RETAIL_DISCOUNT_PV, TOTAL_AMOUNT, TOTAL_PV, DIVIDEND_PV
    </sql>
    <select id="getOrderByDay" resultType="com.hzs.common.domain.sale.order.SaOrder">
        select * from sa_order
        where del_flag = 0
          and order_status = 1
        and pay_time between #{startDate} and #{endDate}
        and order_type in
        <foreach collection="orderTypeList" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>

</mapper>
