feiyu02
2025-08-14 f373bbf83d9d2a7e5f96118d7dcd658c9fea8bc8
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
76
77
78
79
80
81
82
83
84
85
86
87
<?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.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper">
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Userinfo">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="UI_GUID" jdbcType="VARCHAR" property="guid" />
    <result column="UI_AcountName" jdbcType="VARCHAR" property="acountname" />
    <result column="UI_RealName" jdbcType="VARCHAR" property="realname" />
    <result column="UI_Password" jdbcType="VARCHAR" property="password" />
    <result column="UI_UserTypeID" jdbcType="TINYINT" property="usertypeid" />
    <result column="UI_UserType" jdbcType="VARCHAR" property="usertype" />
    <result column="D_GUID" jdbcType="VARCHAR" property="dGuid" />
    <result column="UI_DepartmentName" jdbcType="VARCHAR" property="departmentname" />
    <result column="UI_IsEnable" jdbcType="BIT" property="isenable" />
    <result column="UI_WorkNo" jdbcType="VARCHAR" property="workno" />
    <result column="UI_Telephone" jdbcType="VARCHAR" property="telephone" />
    <result column="UI_WechatID" jdbcType="VARCHAR" property="wechatid" />
    <result column="UI_Extension1" jdbcType="VARCHAR" property="extension1" />
    <result column="UI_Extension2" jdbcType="VARCHAR" property="extension2" />
    <result column="UI_Extension3" jdbcType="VARCHAR" property="extension3" />
    <result column="UI_Remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    UI_GUID, UI_AcountName, UI_RealName, UI_Password, UI_UserTypeID,
    UI_UserType, D_GUID, UI_DepartmentName, UI_IsEnable,
    UI_WorkNo, UI_Telephone, UI_WechatID, UI_Extension1,
    UI_Extension2, UI_Extension3, UI_Remark
  </sql>
 
  <select id="searchUser" resultMap="BaseResultMap">
    SELECT
    a.*
    FROM
    sm_t_userinfo AS a
    LEFT JOIN sm_t_scense AS b ON a.D_GUID = b.S_GUID
    WHERE
    (a.UI_WorkNo IS NULL OR a.UI_WorkNo != 'test')
    <if test="areaVo.provincecode != null">
      AND b.S_ProvinceCode = #{areaVo.provincecode}
    </if>
    <if test="areaVo.provincename != null">
      AND b.S_ProvinceName = #{areaVo.provincename}
    </if>
    <if test="areaVo.citycode != null">
      AND b.S_CityCode = #{areaVo.citycode}
    </if>
    <if test="areaVo.cityname != null">
      AND b.S_CityName = #{areaVo.cityname}
    </if>
    <if test="areaVo.districtcode != null">
      AND b.S_DistrictCode = #{areaVo.districtcode}
    </if>
    <if test="areaVo.districtname != null">
      AND b.S_DistrictName = #{areaVo.districtname}
    </if>
    <if test="areaVo.towncode != null">
      AND b.S_TownCode = #{areaVo.towncode}
    </if>
    <if test="areaVo.townname != null">
      AND b.S_TownName = #{areaVo.townname}
    </if>
    <if test="areaVo.scensetypeid != null">
      AND b.S_TypeID = #{areaVo.scensetypeid}
    </if>
    <if test="areaVo.online == true">
      AND b.S_Extension1 = '1'
    </if>
    <if test="areaVo.online == false">
      AND b.S_Extension1 = '0'
    </if>
    <if test="userTypeId != null">
      AND a.UI_UserTypeID = #{userTypeId}
    </if>
    <if test="keyword != null and keyword != ''">
      AND (
        a.UI_AcountName LIKE CONCAT('%', #{keyword}, '%')
        OR
        a.UI_RealName LIKE CONCAT('%', #{keyword}, '%')
      )
    </if>
  </select>
</mapper>