From 8fd8e2f7c84446ab6bf84fe252053b85d9b20d30 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 30 Oct 2025 10:45:44 +0800
Subject: [PATCH] feat(ai): 简化AI对话项创建逻辑并新增连续对话类型 - 移除复杂的对话项更新逻辑,统一通过add方法创建新项 - 新增AiTalkOutputEnum枚举值CONTEXT_TALK用于AI陪练连续对话 - 更新ApiMemberTalkAnswerSavaDto注释以包含新的对话类型 - 修复对话项创建时类型参数未正确传递的问题 - 优化代码结构,减少冗余的条件判断和数据转换操作
---
src/main/resources/mapper/modules/MallSalesmanMapper.xml | 141 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 140 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/modules/MallSalesmanMapper.xml b/src/main/resources/mapper/modules/MallSalesmanMapper.xml
index 70c0859..994a14b 100644
--- a/src/main/resources/mapper/modules/MallSalesmanMapper.xml
+++ b/src/main/resources/mapper/modules/MallSalesmanMapper.xml
@@ -95,6 +95,145 @@
a.province
FROM mall_address_info a
group by a.province
-</select>
+ </select>
+
+ <select id="selectSalesmanAchieveListInPage" resultType="cc.mrbird.febs.mall.vo.AdminSalesmanAchieveVo">
+ SELECT
+ a.province,
+ a.city,
+ a.name salesmanName,
+ a.id salesmanId,
+ (select count(b.id) from mall_member b where b.salesmans_id = a.id) memberCnt
+ FROM mall_salesman a
+ <where>
+ <if test="record != null" >
+ <if test="record.province != null and record.province != ''">
+ and a.province = #{record.province}
+ </if>
+ <if test="record.city != null and record.city != ''">
+ and a.city = #{record.city}
+ </if>
+ <if test="record.name != null and record.name != ''">
+ and a.name like concat('%', #{record.name},'%')
+ </if>
+ </if>
+ </where>
+ ORDER BY
+ memberCnt DESC, a.province ASC
+ </select>
+
+ <select id="selectSalesmanAchieveProvince" resultType="cc.mrbird.febs.mall.vo.AdminSalesmanAchieveVo">
+ SELECT
+ a.province
+ FROM mall_salesman a
+ group by a.province
+ </select>
+
+ <select id="selectAdminMemberOrderVoBySalesmanId" resultType="cc.mrbird.febs.mall.vo.AdminMemberOrderVo">
+ select
+ c.name memberName,
+ c.phone memberPhone,
+ a.address memberAddress,
+ a.id orderId,
+ a.order_no orderNo,
+ a.CREATED_TIME createdTime,
+ a.amount orderAmount
+ from
+ mall_order_info a
+ left join mall_member c on a.member_id = c.id
+ where
+ a.status in (2, 3, 4)
+ and a.order_type = 1
+ and a.member_id in (
+ select
+ b.id
+ from mall_member b
+ where
+ b.salesmans_id = #{salesmanId}
+ )
+ </select>
+
+ <select id="selectAgentAchieveListInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallAgentRecordVo">
+ SELECT
+ a.province,
+ a.city,
+ a.name,
+ a.phone,
+ d.name nickname,
+ (
+ select ifnull(sum(e.amount),0)
+ from mall_money_flow e
+ where e.flow_type = 1
+ and e.type = 20
+ and e.member_id = a.member_id
+ ) rechargeSendAmount,
+ (
+ select count(b.id)
+ from mall_order_info b
+ <where>
+ b.member_id = a.member_id
+ and (b.status = 4)
+ <if test="record != null" >
+ <if test="record.startTime != null and record.startTime != ''">
+ and b.order_time >= #{record.startTime}
+ </if>
+ <if test="record.endTime != null and record.endTime != ''">
+ and b.order_time <= #{record.endTime}
+ </if>
+ </if>
+ </where>
+ ) orderCnt,
+ (
+ select ifnull(sum(c.amount),0)
+ from mall_order_info c
+
+ <where>
+ c.member_id = a.member_id
+ and (c.status = 4)
+ <if test="record != null" >
+ <if test="record.startTime != null and record.startTime != ''">
+ and c.order_time >= #{record.startTime}
+ </if>
+ <if test="record.endTime != null and record.endTime != ''">
+ and c.order_time <= #{record.endTime}
+ </if>
+ </if>
+ </where>
+ ) orderAmount
+ FROM mall_agent_record a
+ inner join mall_member d on a.member_id = d.id
+ <where>
+ <if test="record != null" >
+ <if test="record.province != null and record.province != ''">
+ and a.province = #{record.province}
+ </if>
+ <if test="record.city != null and record.city != ''">
+ and a.city = #{record.city}
+ </if>
+ <if test="record.name != null and record.name != ''">
+ and a.name like concat('%', #{record.name},'%')
+ </if>
+ <if test="record.nickname != null and record.nickname != ''">
+ and d.name like concat('%', #{record.nickname},'%')
+ </if>
+ </if>
+ </where>
+ ORDER BY orderAmount desc
+ </select>
+
+ <select id="selectAgentAddressProvince" resultType="cc.mrbird.febs.mall.vo.AdminMallAgentRecordVo">
+ SELECT
+ a.province
+ FROM mall_agent_record a
+ group by a.province
+ </select>
+
+ <select id="selectAgentAddressCity" resultType="java.lang.String">
+ SELECT
+ a.city
+ FROM mall_agent_record a
+ where a.province = #{province}
+ group by a.city
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1