Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop
This commit is contained in:
@ -42,12 +42,17 @@
|
||||
<if test="endTime != null and endTime != ''">AND date_format(order_time,'%y%m%d') <=
|
||||
date_format(${endTime},'%y%m%d')
|
||||
</if>
|
||||
<!-- 因为体验单、售中单都存在售中,所以售中的提成金额只计算售中单的,不计算体验单 -->
|
||||
<if test="postCode != null and postCode == 'on_sale_id'">
|
||||
and order_type = 3
|
||||
</if>
|
||||
GROUP BY ${column}
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCommisionDetail" parameterType="SysCommision" resultMap="SysCommisionResult">
|
||||
SELECT * FROM view_user_post pa
|
||||
JOIN (
|
||||
<if test="postId == null or postId == 0">
|
||||
<include refid="groupAmountVo">
|
||||
<property name="column" value="pre_sale_id"/>
|
||||
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||
@ -56,6 +61,22 @@
|
||||
<property name="postId" value="5"/>
|
||||
</include>
|
||||
UNION
|
||||
<include refid="groupAmountVo">
|
||||
<property name="column" value="push_pre_sale_id"/>
|
||||
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||
<property name="beginTime" value="#{beginTime}"/>
|
||||
<property name="endTime" value="#{endTime}"/>
|
||||
<property name="postId" value="18"/>
|
||||
</include>
|
||||
UNION
|
||||
<include refid="groupAmountVo">
|
||||
<property name="column" value="on_sale_id"/>
|
||||
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||
<property name="beginTime" value="#{beginTime}"/>
|
||||
<property name="endTime" value="#{endTime}"/>
|
||||
<property name="postId" value="16"/>
|
||||
</include>
|
||||
UNION
|
||||
<include refid="groupAmountVo">
|
||||
<property name="column" value="after_sale_id"/>
|
||||
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||
@ -111,9 +132,19 @@
|
||||
<property name="endTime" value="#{endTime}"/>
|
||||
<property name="postId" value="8"/>
|
||||
</include>
|
||||
</if>
|
||||
<if test="postId != null and postId > 0">
|
||||
<include refid="groupAmountVo">
|
||||
<property name="column" value="${postCode}"/>
|
||||
<property name="reviewStatus" value="#{reviewStatus}"/>
|
||||
<property name="beginTime" value="#{beginTime}"/>
|
||||
<property name="endTime" value="#{endTime}"/>
|
||||
<property name="postId" value="${postId}"/>
|
||||
</include>
|
||||
</if>
|
||||
) AS a USING(user_id, post_id)
|
||||
<where>
|
||||
<if test="postId != null and postId != ''">and post_id = #{postId}</if>
|
||||
<!--<if test="postId != null and postId != ''">and post_id = #{postId}</if>-->
|
||||
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
|
||||
<if test="userIds != null">
|
||||
and user_id in
|
||||
@ -122,6 +153,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by user_id asc
|
||||
</select>
|
||||
|
||||
<sql id="selectSysCommisionVo">
|
||||
|
@ -41,6 +41,7 @@
|
||||
<result property="serverEndTime" column="server_end_time"/>
|
||||
<result property="becomeFanTime" column="become_fan_time"/>
|
||||
|
||||
<result property="pushPreSaleId" column="push_pre_sale_id" />
|
||||
<result property="onSaleId" column="on_sale_id"/>
|
||||
<result property="orderType" column="order_type"/>
|
||||
<result property="orderCountType" column="order_count_type"/>
|
||||
@ -63,7 +64,7 @@
|
||||
o.serve_time_id, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time,
|
||||
o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.operator_assis_id,
|
||||
o.recommender, o.order_time,o.give_serve_day,o.conditioning_project_id,cp.dict_label as conditioning_project,o.server_end_time,
|
||||
o.on_sale_id,o.order_type,o.order_count_type,o.order_money_type,o.main_order_id,o.after_sale_commiss_order,o.commiss_start_time, o.counted
|
||||
o.on_sale_id,o.order_type,o.order_count_type,o.order_money_type,o.main_order_id,o.after_sale_commiss_order,o.commiss_start_time, o.counted,o.push_pre_sale_id
|
||||
from sys_order o
|
||||
LEFT JOIN sys_customer sc ON sc.id = o.cus_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id
|
||||
@ -227,6 +228,7 @@
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="serveTimeId != null">serve_time_id,</if>
|
||||
<if test="recommender != null">recommender,</if>
|
||||
<if test="pushPreSaleId != null">push_pre_sale_id,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="orderTime != null">order_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
@ -270,6 +272,7 @@
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="serveTimeId != null">#{serveTimeId},</if>
|
||||
<if test="recommender != null">#{recommender},</if>
|
||||
<if test="pushPreSaleId != null">#{pushPreSaleId},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="orderTime != null">#{orderTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
@ -316,6 +319,7 @@
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="serveTimeId != null">serve_time_id = #{serveTimeId},</if>
|
||||
<if test="recommender != null">recommender = #{recommender},</if>
|
||||
<if test="pushPreSaleId != null">push_pre_sale_id = #{pushPreSaleId},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="orderTime != null">order_time = #{orderTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
@ -387,6 +391,7 @@
|
||||
<result property="serverEndTime" column="server_end_time"/>
|
||||
<result property="becomeFanTime" column="become_fan_time"/>
|
||||
|
||||
<result property="pushPreSaleId" column="push_pre_sale_id" />
|
||||
<result property="onSaleId" column="on_sale_id"/>
|
||||
<result property="orderType" column="order_type"/>
|
||||
<result property="orderCountType" column="order_count_type"/>
|
||||
|
@ -35,7 +35,7 @@
|
||||
FROM sys_wx_distribution AS swd
|
||||
lEFT JOIN sys_wx_sale_account swsa ON swsa.id = swd.wechat_account and swsa.del_flag = 0
|
||||
LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'fan_channel') AS acc ON acc.dict_value = swd.account_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = swd.account_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'sale_group') AS asg ON asg.dict_value = swd.sale_group_id
|
||||
where swd.del_flag = 0
|
||||
</sql>
|
||||
|
@ -37,7 +37,7 @@
|
||||
left join sys_wx_sale_account swsa on swsa.id = swfs.wx_id and swsa.del_flag = 0
|
||||
left join sys_wx_distribution swd on swd.wechat_account = swfs.wx_id and swd.del_flag = 0
|
||||
left join sys_user su on su.user_id = swd.user_id and su.del_flag = 0
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'fan_channel') AS acc ON acc.dict_value = swd.account_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = swd.account_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'sale_group') AS asg ON asg.dict_value = swd.sale_group_id
|
||||
</sql>
|
||||
|
||||
|
@ -145,6 +145,15 @@
|
||||
left join sys_wx_distribution swd on wa.id = swd.wechat_account and swd.del_flag = 0
|
||||
LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0
|
||||
where wa.del_flag = 0 and wa.status = 0
|
||||
<if test="saleId != null">
|
||||
and swd.user_id = #{saleId}
|
||||
</if>
|
||||
<if test="wxAccount != null and wxAccount != ''">
|
||||
and wa.wx_account like concat('%',#{wxAccount},'%')
|
||||
</if>
|
||||
<if test="channel != null">
|
||||
and swd.account_id = #{channel}
|
||||
</if>
|
||||
order by su.user_id asc
|
||||
</select>
|
||||
|
||||
|
@ -135,4 +135,9 @@
|
||||
where phone = #{phone} order by create_time desc limit 1
|
||||
</select>
|
||||
|
||||
<!-- 根据openid移除绑定的cusId -->
|
||||
<update id="removeCusIdByOpenId" parameterType="String">
|
||||
update sys_wx_user_info set cus_id = null where openid = #{openid}
|
||||
</update>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user