linwe
2024-08-09 8b7258c9427882bb1798f1502eaa35184c6e374e
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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="org.springblade.modules.discuss.mapper.UserPublicEnrollMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="userPublicEnrollResultMap" type="org.springblade.modules.discuss.vo.UserPublicEnrollVO">
        <result property="id"    column="id"    />
        <result property="publicDiscussId"    column="public_discuss_id"    />
        <result property="householdId"    column="household_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deletedFlag"    column="deleted_flag"    />
    </resultMap>
 
    <sql id="selectUserPublicEnroll">
        select
            id,
            public_discuss_id,
            user_id,
            create_time,
            update_time,
            deleted_flag
        from
            jczz_user_public_enroll
    </sql>
 
 
 
    <select id="selectUserPublicEnrollPage" resultMap="userPublicEnrollResultMap">
        SELECT
        jup.id,
        jup.public_discuss_id,
        jup.household_id,
        jup.create_time,
        jup.update_time,
        jup.deleted_flag,
        jup.signature_path,
        bu.avatar,
        jh.`name`,
        jh.phone_number phone,
        jda.address_name,
        jda.aoi_name
        FROM
        jczz_user_public_enroll jup
        LEFT JOIN jczz_household jh ON jh.house_code = jup.house_code
        AND jh.is_deleted = 0
        AND jup.household_id = jh.id
        LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code
        LEFT JOIN blade_user bu ON jh.associated_user_id = bu.id
        AND bu.is_deleted = 0
        <where>
        <if test="userPublicEnroll.id != null "> and jup.id = #{userPublicEnroll.id}</if>
        <if test="userPublicEnroll.publicDiscussId != null "> and jup.public_discuss_id = #{userPublicEnroll.publicDiscussId}</if>
        <if test="userPublicEnroll.householdId != null "> and jup.household_id = #{userPublicEnroll.householdId}</if>
        <if test="userPublicEnroll.createTime != null "> and jup.create_time = #{userPublicEnroll.createTime}</if>
        <if test="userPublicEnroll.updateTime != null "> and jup.update_time = #{userPublicEnroll.updateTime}</if>
        <if test="userPublicEnroll.deletedFlag != null "> and jup.deleted_flag = #{userPublicEnroll.deletedFlag}</if>
        <if test="userPublicEnroll.articleId != null ">and jup.article_id = #{userPublicEnroll.articleId}</if>
    </where>
    </select>
 
    <select id="selectUserPublicEnrollList" parameterType="org.springblade.modules.discuss.dto.UserPublicEnrollDTO" resultMap="userPublicEnrollResultMap">
        <include refid="selectUserPublicEnroll"/>
        <where>
            <if test="id != null "> and id = #{id}</if>
            <if test="publicDiscussId != null "> and public_discuss_id = #{publicDiscussId}</if>
            <if test="userId != null "> and user_id = #{userId}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="updateTime != null "> and update_time = #{updateTime}</if>
            <if test="deletedFlag != null "> and deleted_flag = #{deletedFlag}</if>
        </where>
    </select>
 
 
</mapper>