admin
2020-11-09 2147d023563a7c9d05d97547c00d6b0162c0644c
fanli/src/main/resource/mapping/order/CommonOrderMapper.xml
@@ -426,6 +426,29 @@
            v2.`hb_type` = 21 OR v2.`hb_type` = 22)
        </if>
    </sql>
    <sql id="SELECT_PARAM_HONGBAO_TYPE_LIST">
        <if test="typeList!=null">
            <foreach collection="typeList" item="type" separator=" or " open=" and (" close=")">
                <if test="type != null and type == 1">
                    <!-- 自购订单 -->
                    (v2.hb_type =1 or v2.hb_type =2)
                </if>
                <if test="type != null and type == 2">
                    <!-- 分享订单 -->
                    v2.`hb_type` = 20
                </if>
                <if test="type != null and type == 3">
                    <!-- 邀请订单 -->
                    (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR
                    v2.`hb_type` = 21 OR v2.`hb_type` = 22)
                </if>
            </foreach>
        </if>
    </sql>
    <sql id="SELECT_PARAM_HONGBAO_STATE">
        <if test="state != null and state == 1">
            <!-- 未到账 -->
@@ -875,7 +898,7 @@
        hb.`hb_get_time` AS accountTime, hb.`hb_pre_get_time` AS
        preAccountTime, co.* FROM yeshi_ec_hongbao_order ho LEFT JOIN (SELECT
        * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
        <include refid="SELECT_PARAM_HONGBAO_TYPE"/>
        <include refid="SELECT_PARAM_HONGBAO_TYPE_LIST"/>
        <!-- 红包类型 -->
        <include refid="SELECT_HONGBAO_STATE"/>
        <!-- 红包状态 -->
@@ -932,7 +955,7 @@
        hb.`hb_get_time` AS accountTime, hb.`hb_pre_get_time` AS
        preAccountTime, co.* FROM yeshi_ec_hongbao_order ho LEFT JOIN (SELECT
        * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
        <include refid="SELECT_PARAM_HONGBAO_TYPE"/>
        <include refid="SELECT_PARAM_HONGBAO_TYPE_LIST"/>
        <!-- 红包类型 -->
        <include refid="SELECT_HONGBAO_STATE"/>
        <!-- 红包状态 -->
@@ -960,7 +983,7 @@
    <select id="countQuery" resultType="java.lang.Long">
        SELECT count(ho.ho_id) FROM yeshi_ec_hongbao_order ho LEFT JOIN
        (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
        <include refid="SELECT_PARAM_HONGBAO_TYPE"/>
        <include refid="SELECT_PARAM_HONGBAO_TYPE_LIST"/>
        <!-- 红包类型 -->
        <include refid="SELECT_HONGBAO_STATE"/>
        <!-- 红包状态 -->
@@ -1007,7 +1030,7 @@
    <select id="countQueryWithNoChild" resultType="java.lang.Long">
        SELECT count(ho.ho_id) FROM yeshi_ec_hongbao_order ho LEFT JOIN
        (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1
        <include refid="SELECT_PARAM_HONGBAO_TYPE"/>
        <include refid="SELECT_PARAM_HONGBAO_TYPE_LIST"/>
        <!-- 红包类型 -->
        <include refid="SELECT_HONGBAO_STATE"/>
        <!-- 红包状态 -->