From 05d286d33b25ea7e317eae2861bb765ac11a927d Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 15 五月 2025 17:44:34 +0800
Subject: [PATCH] 新增客户管理,客户标签(暂留)功能
---
framework/src/main/resources/mapper/lmk/CustomerMapper.xml | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 107 insertions(+), 0 deletions(-)
diff --git a/framework/src/main/resources/mapper/lmk/CustomerMapper.xml b/framework/src/main/resources/mapper/lmk/CustomerMapper.xml
new file mode 100644
index 0000000..0a38e6b
--- /dev/null
+++ b/framework/src/main/resources/mapper/lmk/CustomerMapper.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.lili.modules.lmk.mapper.CustomerMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="cn.lili.modules.member.entity.vo.MemberVO">
+ <id property="id" column="id"/>
+
+ <!-- 鍩虹瀛楁鏄犲皠 -->
+ <result property="username" column="username"/>
+ <result property="nickName" column="nick_name"/>
+ <result property="sex" column="sex"/>
+ <result property="birthday" column="birthday"/>
+ <result property="regionId" column="region_id"/>
+ <result property="region" column="region"/>
+ <result property="mobile" column="mobile"/>
+ <result property="point" column="point"/>
+ <result property="totalPoint" column="total_point"/>
+ <result property="face" column="face"/>
+ <result property="disabled" column="disabled"/>
+ <result property="haveStore" column="have_store"/>
+ <result property="storeId" column="store_id"/>
+ <result property="openId" column="open_id"/>
+ <result property="clientEnum" column="client_enum"/>
+ <result property="lastLoginDate" column="last_login_date"/>
+ <result property="gradeId" column="grade_id"/>
+ <result property="experience" column="experience"/>
+ <result property="createTime" column="create_time"/>
+ <collection property="customerTagList" ofType="cn.lili.modules.lmk.domain.vo.CustomerTagVO"
+ select="selectTagByMemberId"
+ column="id"
+ />
+ </resultMap>
+
+ <select id="getPage" resultMap="BaseResultMap">
+ SELECT
+ *
+ FROM
+ li_member lm
+ <where>
+ <!-- 鐢ㄦ埛鍚嶆ā绯婃煡璇� -->
+ <if test="query.username != null and query.username != ''">
+ AND lm.username LIKE CONCAT('%', #{query.username}, '%')
+ </if>
+
+ <!-- 鏄电О妯$硦鏌ヨ -->
+ <if test="query.nickName != null and query.nickName != ''">
+ AND lm.nick_name LIKE CONCAT('%', #{query.nickName}, '%')
+ </if>
+
+ <!-- 鎵嬫満鍙风爜绮剧‘鏌ヨ -->
+ <if test="query.mobile != null and query.mobile != ''">
+ AND lm.mobile = #{query.mobile}
+ </if>
+
+ <!-- 浼氬憳鐘舵�佽浆 -->
+ <if test="query.disabled != null and query.disabled != ''">
+ AND lm.disabled = #{query.disabled}
+ </if>
+
+ <!-- 鍟嗛摵id -->
+ <if test="query.storeId != null and query.storeId != ''">
+ AND lm.store_id = #{query.storeId}
+ </if>
+ AND EXISTS (
+ SELECT 1
+ FROM li_order lo
+ WHERE lo.member_id = lm.id
+ )
+ </where>
+ ORDER BY lm.create_time DESC
+ </select>
+
+ <select id="selectTagByMemberId" resultType="cn.lili.modules.lmk.domain.vo.CustomerTagVO">
+ SELECT
+ LCT.id,
+ LCT.tag_name,
+ LCT.create_type
+ FROM lmk_customer_tag_ref LCTR
+ LEFT JOIN lmk_customer_tag LCT
+ ON LCTR.customer_tag_id = LCT.id
+ WHERE LCTR.customer_id =#{id}
+ </select>
+
+
+
+
+ <select id="getById" resultMap="BaseResultMap">
+ SELECT
+ LCT.tag_name,
+ LCT.create_type,
+ LCT.create_by,
+ LCT.create_time,
+ LCT.update_by,
+ LCT.update_time,
+ LCT.delete_flag,
+ LCT.id
+ FROM
+ lmk_customer_tag LCT
+ WHERE
+ LCT.id = #{id} AND LCT.delete_flag = 0
+ </select>
+
+
+
+
+</mapper>
--
Gitblit v1.8.0