|
@@ -66,7 +66,7 @@
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
<select id="getTotalList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- select *
|
|
|
+ select t.*,t2.promoter_info as 'promoterInfo'
|
|
|
from (select promoter_create_name as 'userName',
|
|
|
promoter_id as 'promoterId',
|
|
|
promoter_name as 'promoterName',
|
|
@@ -86,35 +86,38 @@
|
|
|
<if test="promoterName != null and promoterName != '' ">
|
|
|
AND promoter_name LIKE CONCAT('%', #{promoterName}, '%')
|
|
|
</if>
|
|
|
- group by promoter_id) t
|
|
|
+ group by promoter_id) t left join kuaishou_rule_settlement_mentor t2
|
|
|
+ on t.promoterId = t2.promoter_id
|
|
|
order by t.referenceAmount desc, t.promoterId asc
|
|
|
</select>
|
|
|
<select id="detailList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- select id as 'id',
|
|
|
- item_ids as 'itemIds',
|
|
|
- item_title as 'itemName',
|
|
|
- promoter_id as 'promoterId',
|
|
|
- promoter_create_name as 'promoterCreateName',
|
|
|
- promoter_name as 'promoterName',
|
|
|
- item_create_id as 'itemCreateId',
|
|
|
- item_create_name as 'itemCreateName',
|
|
|
- anchor_amount as 'anchorAmount',
|
|
|
- reference_amount as 'referenceAmount',
|
|
|
+ select t.id as 'id',
|
|
|
+ t.item_ids as 'itemIds',
|
|
|
+ t.item_title as 'itemName',
|
|
|
+ t.promoter_id as 'promoterId',
|
|
|
+ t.promoter_create_name as 'promoterCreateName',
|
|
|
+ t.promoter_name as 'promoterName',
|
|
|
+ t.item_create_id as 'itemCreateId',
|
|
|
+ t.item_create_name as 'itemCreateName',
|
|
|
+ t.anchor_amount as 'anchorAmount',
|
|
|
+ t.reference_amount as 'referenceAmount',
|
|
|
(case
|
|
|
- when settlement_status = 1 then '待付款'
|
|
|
- when settlement_status = 2 then '已付款'
|
|
|
+ when t.settlement_status = 1 then '待付款'
|
|
|
+ when t.settlement_status = 2 then '已付款'
|
|
|
else ''
|
|
|
end
|
|
|
) as 'settlementStatusStr',
|
|
|
- settlement_status as 'settlementStatus',
|
|
|
- remarks as 'remarks'
|
|
|
- from kuaishou_rule_settlement_check
|
|
|
- where promoter_id = #{promoterId}
|
|
|
- and stat_date = #{date}
|
|
|
+ t.settlement_status as 'settlementStatus',
|
|
|
+ t.remarks as 'remarks',
|
|
|
+ t2.promoter_info as 'promoterInfo'
|
|
|
+ from kuaishou_rule_settlement_check t left join kuaishou_rule_settlement_mentor t2
|
|
|
+ on t.promoter_id = t2.promoter_id
|
|
|
+ where t.promoter_id = #{promoterId}
|
|
|
+ and t.stat_date = #{date}
|
|
|
<if test="itemId != null ">
|
|
|
- and item_ids like concat('%',concat(#{itemId},'%'))
|
|
|
+ and t.item_ids like concat('%',concat(#{itemId},'%'))
|
|
|
</if>
|
|
|
- order by anchorAmount desc, item_ids asc
|
|
|
+ order by t.anchor_amount desc, t.item_ids asc
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertKuaishouRuleSettlementCheck" parameterType="com.ruixuan.isc.entity.KuaishouRuleSettlementCheck"
|
|
@@ -205,6 +208,12 @@
|
|
|
</foreach>
|
|
|
|
|
|
</insert>
|
|
|
+ <insert id="replacePromoterInfo">
|
|
|
+ replace into kuaishou_rule_settlement_mentor(promoter_id,promoter_info) values (
|
|
|
+ #{promoterId},
|
|
|
+ #{promoterInfo}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
|
|
|
<update id="updateKuaishouRuleSettlementCheck" parameterType="com.ruixuan.isc.entity.KuaishouRuleSettlementCheck">
|
|
|
update kuaishou_rule_settlement_check
|