|
|
@@ -427,7 +427,7 @@
|
|
|
o.first_amount as firstAmount, o.settlement_amount as settlementAmount, o.refund_amount as refundAmount,
|
|
|
o.order_status as orderStatus, o.project_status as projectStatus, b.bonus_subject as bonusSubject,
|
|
|
o.proof_count as proofCount, b.grant_status as grantStatus, a.name as salesName, o.proof_status as proofStatus,
|
|
|
- ad.name as byName
|
|
|
+ ad.name as byName, b.grant_target as grantTarget
|
|
|
from t_order_bonus b
|
|
|
left join t_order_new o on o.order_no = b.order_no
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
@@ -453,7 +453,7 @@
|
|
|
<bind name="e" value="b.endTime +'-31'"/>
|
|
|
and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- order by b.grant_status , b.create_time
|
|
|
+ order by b.grant_status , b.create_time desc
|
|
|
<if test="page_sql != null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
@@ -550,7 +550,7 @@
|
|
|
<bind name="e" value="endTime +'-31'"/>
|
|
|
and o.sign_time between #{a,jdbcType=VARCHAR} and #{e,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- order by b.grant_status ,b.create_time
|
|
|
+ order by b.grant_status ,b.create_time desc
|
|
|
</select>
|
|
|
<!-- 查看营销员的奖金数据 -->
|
|
|
<select id="getSaleBounsList" parameterType="com.goafanti.order.bo.TOrderBonusBo" resultType="com.goafanti.order.bo.TOrderBonusBo">
|
|
|
@@ -588,4 +588,12 @@
|
|
|
<select id="checkByOnoAndSub" parameterType="com.goafanti.common.model.TOrderBonus" resultType="java.lang.Integer">
|
|
|
select count(*) from t_order_bonus where order_no = #{orderNo,jdbcType=VARCHAR} and bonus_subject = #{bonusSubject,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
+ <!-- 判断当前订单中有没有未发放的数据 -->
|
|
|
+ <select id="checkNoPay" parameterType="com.goafanti.order.bo.TOrderBonusBo" resultType="java.lang.Integer">
|
|
|
+ select bonus_subject from t_order_bonus
|
|
|
+ where id = #{id,jdbcType=VARCHAR} and bonus_subject > (
|
|
|
+ select min(bonus_subject) from t_order_bonus
|
|
|
+ where order_no = #{orderNo,jdbcType=VARCHAR} and grant_status = 0 and grant_type = 0)
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|