|
@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
cl.check_status,
|
|
|
dl.pay_status,
|
|
|
dl.divide_type,
|
|
|
- oo.buy_time as order_time,
|
|
|
+ oo.accomplish_time as order_time,
|
|
|
oo.remark,
|
|
|
oo.divide_company_money,
|
|
|
oo.divide_seller_money,
|
|
@@ -59,10 +59,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND oo.accomplish_time <![CDATA[ <= ]]> #{accomplishEndTime}
|
|
|
</if>
|
|
|
<if test="checkStatus != null and checkStatus == 0">
|
|
|
- AND ocl.check_status <![CDATA[ <= ]]> 0
|
|
|
+ AND cl.check_status <![CDATA[ <= ]]> 0
|
|
|
</if>
|
|
|
<if test="checkStatus != null and checkStatus == 1">
|
|
|
- AND ocl.check_status <![CDATA[ >= ]]> 1
|
|
|
+ AND cl.check_status <![CDATA[ >= ]]> 1
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getFinishCount" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
|
|
|
+ SELECT
|
|
|
+ SUM(oo.order_price) as order_price,
|
|
|
+ SUM(oo.divide_company_money) as divide_company_money,
|
|
|
+ SUM(oo.divide_seller_money) as divide_seller_money,
|
|
|
+ SUM(oo.pretax_brokerage) as pretax_brokerage
|
|
|
+ FROM
|
|
|
+ top_divide_order tdo
|
|
|
+ LEFT JOIN top_divide_log dl ON tdo.divide_log_id = dl.id
|
|
|
+ LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
|
|
|
+ LEFT JOIN v_top_order oo ON tdo.order_sn = oo.order_sn
|
|
|
+ LEFT JOIN
|
|
|
+ top_old_order_check_log cl ON (dl.divide_type+1) = cl.check_from AND cl.check_sign = 1 AND tdo.order_sn = cl.order_sn
|
|
|
+ LEFT JOIN top_sys_role r ON cl.role_id = r.role_id
|
|
|
+ WHERE
|
|
|
+ tdo.order_type = 1
|
|
|
+ AND tdo.divide_log_id = #{divideLogId}
|
|
|
+ <if test="startPrice != null and startPrice != ''">
|
|
|
+ AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ >= ]]> #{startPrice}
|
|
|
+ </if>
|
|
|
+ <if test="endPrice != null and endPrice != ''">
|
|
|
+ AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ <= ]]> #{endPrice}
|
|
|
+ </if>
|
|
|
+ <if test="orderSn != null and orderSn != ''">
|
|
|
+ AND oo.order_sn = #{orderSn}
|
|
|
+ </if>
|
|
|
+ <if test="accomplishStartTime != null ">
|
|
|
+ AND oo.accomplish_time <![CDATA[ >= ]]> #{accomplishStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="accomplishEndTime != null ">
|
|
|
+ AND oo.accomplish_time <![CDATA[ <= ]]> #{accomplishEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus != null and checkStatus == 0">
|
|
|
+ AND cl.check_status <![CDATA[ <= ]]> 0
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus != null and checkStatus == 1">
|
|
|
+ AND cl.check_status <![CDATA[ >= ]]> 1
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -108,6 +148,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getRefundCount" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo">
|
|
|
+ SELECT
|
|
|
+ SUM(tor.divide_money) as divide_money
|
|
|
+ FROM
|
|
|
+ top_divide_order tdo
|
|
|
+ LEFT JOIN top_divide_log dl ON tdo.divide_log_id = dl.id
|
|
|
+ LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
|
|
|
+ LEFT JOIN v_top_order oo ON tdo.order_sn = oo.order_sn
|
|
|
+ LEFT JOIN top_old_order_refund tor ON tdo.order_sn = tor.order_sn
|
|
|
+ WHERE
|
|
|
+ tdo.order_type = 2
|
|
|
+ AND tdo.divide_log_id = #{divideLogId}
|
|
|
+ <if test="startPrice != null and startPrice != ''">
|
|
|
+ AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ >= ]]> #{startPrice}
|
|
|
+ </if>
|
|
|
+ <if test="endPrice != null and endPrice != ''">
|
|
|
+ AND (oo.order_price - oo.pretax_brokerage) <![CDATA[ <= ]]> #{endPrice}
|
|
|
+ </if>
|
|
|
+ <if test="orderSn != null and orderSn != ''">
|
|
|
+ AND oo.order_sn = #{orderSn}
|
|
|
+ </if>
|
|
|
+ <if test="accomplishStartTime != null ">
|
|
|
+ AND tor.refund_time <![CDATA[ >= ]]> #{accomplishStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="accomplishEndTime != null ">
|
|
|
+ AND tor.refund_time <![CDATA[ <= ]]> #{accomplishEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus != null and checkStatus == 0">
|
|
|
+ AND 1=0
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getBusinessList" parameterType="String" resultType="String">
|
|
|
SELECT
|
|
|
business_name
|