xuhy
2026-03-02 9da3041d5a71f30a0f0f9dc005ffc4af88ef7bec
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="com.ruoyi.system.mapper.TLargeKeyGridUserMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TLargeKeyGridUser">
        <id column="id" property="id" />
        <result column="grid_info" property="gridInfo" />
        <result column="community_name" property="communityName" />
        <result column="building_info" property="buildingInfo" />
        <result column="unit_number" property="unitNumber" />
        <result column="house_number" property="houseNumber" />
        <result column="registered_residence" property="registeredResidence" />
        <result column="user_name" property="userName" />
        <result column="user_sex" property="userSex" />
        <result column="id_card" property="idCard" />
        <result column="contact_number" property="contactNumber" />
        <result column="type_id" property="typeId" />
        <result column="user_type" property="userType" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, grid_info, community_name, building_info, unit_number, house_number,registered_residence,
          user_name, user_sex, id_card, contact_number, type_id, user_type, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TLargeKeyGridUserVO">
        select
            tlkgu.id, tlkgu.grid_info, tlkgu.community_name, tlkgu.building_info, tlkgu.unit_number, tlkgu.house_number,
            tlkgu.registered_residence,tlkgu.user_name, tlkgu.user_sex, tlkgu.id_card, tlkgu.contact_number, tlkgu.type_id,
            tlkgu.user_type,tlkgu.create_time, tlkgu.update_time, tlkgu.create_by, tlkgu.update_by, tlkgu.disabled,
            tlkpt.type_name
        from t_large_key_grid_user tlkgu
        left join t_large_key_personnel_type tlkpt on tlkgu.type_id = tlkpt.id
        <where>
            <if test="query.userName != null and query.userName != ''">
                and tlkgu.user_name like concat('%', #{query.userName}, '%')
            </if>
            <if test="query.contactNumber != null and query.contactNumber != ''">
                and tlkgu.contact_number like concat('%', #{query.contactNumber}, '%')
            </if>
            <if test="query.typeName != null and query.typeName != ''">
                and tlkpt.type_name like concat('%', #{query.typeName}, '%')
            </if>
            <if test="query.typeId != null and query.typeId != ''">
                and tlkgu.type_id = #{query.typeId}
            </if>
            <if test="query.userType != null">
                and tlkgu.user_type = #{query.userType}
            </if>
            and tlkgu.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        order by tlkgu.create_time desc
    </select>
 
</mapper>