zxl
2025-06-04 33aa0f005c1952dda7dc1f713b424a6700a6befd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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.StoreMemberMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.StoreMemberVO">
        <result column="real_name" property="realName" />
        <result column="mobile" property="mobile" />
        <result column="password" property="password" />
        <result column="role" property="role" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="delete_flag" property="deleteFlag" />
 
        <result column="store_id" property="storeId" />
        <result column="member_id" property="memberId" />
        <result column="username" property="userName" />
    </resultMap>
 
 
    <select id="getById" resultMap="BaseResultMap">
        SELECT
            LSM.id,
            LSM.real_name,
            LSM.role,
            LSM.store_id,
            LSM.member_id,
            LM.mobile,
            LM.username
        FROM lmk_store_member LSM
        LEFT JOIN li_member LM
        ON LM.id = LSM.member_id
        where LSM.delete_flag = 0
        AND LM.delete_flag = 0
        AND LSM.id = #{id}
    </select>
 
 
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
            LSM.id,
            LSM.real_name,
            LSM.role,
            LSM.store_id,
            LSM.member_id,
            LM.mobile,
            LM.username
        FROM lmk_store_member LSM
        LEFT JOIN li_member LM
        ON LM.id = LSM.member_id
        where LSM.delete_flag = 0
        AND LM.delete_flag = 0
        <if test="query.realName != null and query.realName != ''">
            AND LSM.real_name LIKE CONCAT('%', #{query.realName}, '%')
        </if>
        AND LSM.store_id = #{query.storeId}
    </select>
 
</mapper>