Commit a59a1f7c by Water Wang

optimize fyc statistic

parent a591142e
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
<result column="order_price" jdbcType="DECIMAL" property="orderPrice" /> <result column="order_price" jdbcType="DECIMAL" property="orderPrice" />
<result column="commission_rate" jdbcType="DECIMAL" property="commissionRate" /> <result column="commission_rate" jdbcType="DECIMAL" property="commissionRate" />
<result column="commission_amount" jdbcType="DECIMAL" property="commissionAmount" /> <result column="commission_amount" jdbcType="DECIMAL" property="commissionAmount" />
<result column="announcement_commission_rate" jdbcType="DECIMAL" property="announcementCommissionRate" />
<result column="announcement_commission_amount" jdbcType="DECIMAL" property="announcementCommissionAmount" />
<result column="grade_commission_rate" jdbcType="DECIMAL" property="gradeCommissionRate" /> <result column="grade_commission_rate" jdbcType="DECIMAL" property="gradeCommissionRate" />
<result column="referral_rate" jdbcType="DECIMAL" property="referralRate" /> <result column="referral_rate" jdbcType="DECIMAL" property="referralRate" />
<result column="referral_amount" jdbcType="DECIMAL" property="referralAmount" /> <result column="referral_amount" jdbcType="DECIMAL" property="referralAmount" />
...@@ -27,7 +25,7 @@ ...@@ -27,7 +25,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, share_id, customer_id, order_id, order_date, order_price, commission_rate, commission_amount, id, share_id, customer_id, order_id, order_date, order_price, commission_rate, commission_amount,
announcement_commission_rate, announcement_commission_amount, grade_commission_rate, grade_commission_rate,
referral_rate, referral_amount, is_tax, tax_amount, referral_rate, referral_amount, is_tax, tax_amount,
net_amount, campaign_id, withdrawable_date, withdrawed_id, fortune_payed_id, created_at, net_amount, campaign_id, withdrawable_date, withdrawed_id, fortune_payed_id, created_at,
created_by created_by
...@@ -45,8 +43,7 @@ ...@@ -45,8 +43,7 @@
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerFortune" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerFortune" useGeneratedKeys="true">
insert into ag_acl_customer_fortune (share_id, customer_id, order_id, insert into ag_acl_customer_fortune (share_id, customer_id, order_id,
order_date, order_price, commission_rate, order_date, order_price, commission_rate,
commission_amount, announcement_commission_rate, commission_amount, grade_commission_rate,
announcement_commission_amount, grade_commission_rate,
referral_rate, referral_amount, referral_rate, referral_amount,
is_tax, tax_amount, net_amount, is_tax, tax_amount, net_amount,
campaign_id, withdrawable_date, withdrawed_id, campaign_id, withdrawable_date, withdrawed_id,
...@@ -54,8 +51,8 @@ ...@@ -54,8 +51,8 @@
) )
values (#{shareId,jdbcType=BIGINT}, #{customerId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, values (#{shareId,jdbcType=BIGINT}, #{customerId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT},
#{orderDate,jdbcType=TIMESTAMP}, #{orderPrice,jdbcType=DECIMAL}, #{commissionRate,jdbcType=DECIMAL}, #{orderDate,jdbcType=TIMESTAMP}, #{orderPrice,jdbcType=DECIMAL}, #{commissionRate,jdbcType=DECIMAL},
#{commissionAmount,jdbcType=DECIMAL}, #{announcementCommissionRate,jdbcType=DECIMAL}, #{commissionAmount,jdbcType=DECIMAL},
#{announcementCommissionAmount,jdbcType=DECIMAL}, #{gradeCommissionRate,jdbcType=DECIMAL}, #{gradeCommissionRate,jdbcType=DECIMAL},
#{referralRate,jdbcType=DECIMAL}, #{referralAmount,jdbcType=DECIMAL}, #{referralRate,jdbcType=DECIMAL}, #{referralAmount,jdbcType=DECIMAL},
#{isTax,jdbcType=INTEGER}, #{taxAmount,jdbcType=DECIMAL}, #{netAmount,jdbcType=DECIMAL}, #{isTax,jdbcType=INTEGER}, #{taxAmount,jdbcType=DECIMAL}, #{netAmount,jdbcType=DECIMAL},
#{campaignId,jdbcType=BIGINT}, #{withdrawableDate,jdbcType=TIMESTAMP}, #{withdrawedId,jdbcType=BIGINT}, #{campaignId,jdbcType=BIGINT}, #{withdrawableDate,jdbcType=TIMESTAMP}, #{withdrawedId,jdbcType=BIGINT},
...@@ -151,12 +148,6 @@ ...@@ -151,12 +148,6 @@
<if test="commissionAmount != null"> <if test="commissionAmount != null">
#{commissionAmount,jdbcType=DECIMAL}, #{commissionAmount,jdbcType=DECIMAL},
</if> </if>
<if test="announcementCommissionRate != null">
#{announcementCommissionRate,jdbcType=DECIMAL},
</if>
<if test="announcementCommissionAmount != null">
#{announcementCommissionAmount,jdbcType=DECIMAL},
</if>
<if test="gradeCommissionRate != null"> <if test="gradeCommissionRate != null">
#{gradeCommissionRate,jdbcType=DECIMAL}, #{gradeCommissionRate,jdbcType=DECIMAL},
</if> </if>
...@@ -219,12 +210,6 @@ ...@@ -219,12 +210,6 @@
<if test="commissionAmount != null"> <if test="commissionAmount != null">
commission_amount = #{commissionAmount,jdbcType=DECIMAL}, commission_amount = #{commissionAmount,jdbcType=DECIMAL},
</if> </if>
<if test="announcementCommissionRate != null">
announcement_commission_rate = #{announcementCommissionRate,jdbcType=DECIMAL},
</if>
<if test="announcementCommissionAmount != null">
announcement_commission_amount = #{announcementCommissionAmount,jdbcType=DECIMAL},
</if>
<if test="gradeCommissionRate != null"> <if test="gradeCommissionRate != null">
grade_commission_rate = #{gradeCommissionRate,jdbcType=DECIMAL}, grade_commission_rate = #{gradeCommissionRate,jdbcType=DECIMAL},
</if> </if>
...@@ -273,8 +258,6 @@ ...@@ -273,8 +258,6 @@
order_price = #{orderPrice,jdbcType=DECIMAL}, order_price = #{orderPrice,jdbcType=DECIMAL},
commission_rate = #{commissionRate,jdbcType=DECIMAL}, commission_rate = #{commissionRate,jdbcType=DECIMAL},
commission_amount = #{commissionAmount,jdbcType=DECIMAL}, commission_amount = #{commissionAmount,jdbcType=DECIMAL},
announcement_commission_rate = #{announcementCommissionRate,jdbcType=DECIMAL},
announcement_commission_amount = #{announcementCommissionAmount,jdbcType=DECIMAL},
grade_commission_rate = #{gradeCommissionRate,jdbcType=DECIMAL}, grade_commission_rate = #{gradeCommissionRate,jdbcType=DECIMAL},
referral_rate = #{referralRate,jdbcType=DECIMAL}, referral_rate = #{referralRate,jdbcType=DECIMAL},
referral_amount = #{referralAmount,jdbcType=DECIMAL}, referral_amount = #{referralAmount,jdbcType=DECIMAL},
...@@ -302,7 +285,7 @@ ...@@ -302,7 +285,7 @@
s.practitioner_level practitionerLevelId s.practitioner_level practitionerLevelId
FROM FROM
((ag_acl_practitioner_setting s LEFT JOIN ag_acl_practitioner p ON s.practitioner_id = p.id) ((ag_acl_practitioner_setting s LEFT JOIN ag_acl_practitioner p ON s.practitioner_id = p.id)
INNER JOIN ag_acl_customer_fortune f ON f.customer_id = p.customer_id ) INNER JOIN ag_acl_customer_fortune f ON f.customer_id = p.customer_id and f.drop_option_code = "S01")
INNER JOIN ag_po_order o ON f.order_id = o.id INNER JOIN ag_po_order o ON f.order_id = o.id
WHERE WHERE
o.status = 3 and o.order_price > 0 o.status = 3 and o.order_price > 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment