<?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.mapper.UserinfoMapper">
|
<resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.Userinfo">
|
<!--
|
WARNING - @mbg.generated
|
-->
|
<id column="UI_GUID" jdbcType="VARCHAR" property="guid" />
|
<result column="UI_HeadIconUrl" jdbcType="VARCHAR" property="headIconUrl" />
|
<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="UI_User_SubType_Id" jdbcType="INTEGER" property="userSubTypeId" />
|
<result column="UI_User_SubType" jdbcType="VARCHAR" property="userSubType" />
|
<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_Create_Time" jdbcType="TIMESTAMP" property="uiCreateTime" />
|
<result column="UI_Login_Time" jdbcType="TIMESTAMP" property="uiLoginTime" />
|
<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_HeadIconUrl, UI_AcountName, UI_RealName, UI_Password, UI_UserTypeID,
|
UI_UserType, UI_User_SubType_Id, UC_User_SubType, D_GUID, UI_DepartmentName, UI_IsEnable,
|
UI_WorkNo, UI_Telephone, UI_WechatID, UI_Create_Time, UI_Login_Time, UI_Extension1,
|
UI_Extension2, UI_Extension3, UI_Remark
|
</sql>
|
|
<select id="searchUser" resultMap="BaseResultMap">
|
SELECT
|
a.*
|
FROM
|
sm_t_userinfo AS a
|
LEFT JOIN ea_t_baseinfo AS b ON a.UI_GUID = b.BI_GUID
|
WHERE
|
(a.UI_WorkNo IS NULL OR a.UI_WorkNo != 'test')
|
AND (a.UI_WorkNo != 'test' || a.UI_WorkNo IS NULL)
|
<if test="provinceCode != null">
|
AND b.BI_Province_Code = #{provinceCode}
|
</if>
|
<if test="provinceName != null">
|
AND b.BI_Province_Name = #{provinceName}
|
</if>
|
<if test="cityCode != null">
|
AND b.BI_City_Code = #{cityCode}
|
</if>
|
<if test="cityName != null">
|
AND b.BI_City_Name = #{cityName}
|
</if>
|
<if test="districtCode != null">
|
AND b.BI_District_Code = #{districtCode}
|
</if>
|
<if test="districtName != null">
|
AND (b.BI_District_Name = #{districtName} OR a.UI_Extension1 = #{districtName})
|
</if>
|
<if test="townCode != null">
|
AND b.BI_Town_Code = #{townCode}
|
</if>
|
<if test="townName != null">
|
AND b.BI_Town_Name = #{townName}
|
</if>
|
<if test="areaCode != null">
|
AND b.BI_Area_Code = #{areaCode}
|
</if>
|
<if test="area != null">
|
AND b.BI_Area = #{area}
|
</if>
|
<if test="mcId != null">
|
AND b.BI_Management_Company_Id = #{mcId}
|
</if>
|
<if test="mcName != null">
|
AND b.BI_Management_Company = #{mcName}
|
</if>
|
<if test="userTypeId != null">
|
AND a.UI_UserTypeID = #{userTypeId}
|
</if>
|
<if test="userSubTypeId != null">
|
AND a.UI_User_SubType_Id = #{userSubTypeId}
|
</if>
|
<if test="sceneTypes.size() != 0">
|
AND a.UI_Extension2 in
|
<foreach collection="sceneTypes" item="type" open="(" separator="," close=")">
|
#{type, jdbcType=VARCHAR}
|
</foreach>
|
</if>
|
<if test="searchText != null and searchText != ''">
|
AND a.UI_RealName LIKE CONCAT('%', #{searchText}, '%')
|
</if>
|
</select>
|
|
<select id="getUnAuthedUsers" resultMap="BaseResultMap">
|
SELECT
|
a.*
|
FROM
|
sm_t_userinfo AS a
|
LEFT JOIN ea_t_personal_info AS b ON a.UI_GUID = b.PI_Scene_Id
|
LEFT JOIN ea_t_baseinfo AS c ON a.UI_GUID = c.BI_GUID
|
WHERE
|
a.UI_IsEnable = TRUE
|
AND a.UI_UserTypeID = 3
|
AND (
|
a.UI_WorkNo IS NULL
|
OR a.UI_WorkNo != 'test'
|
)
|
AND a.UI_Login_Time IS NOT NULL
|
AND (
|
(
|
c.BI_Extension3 != 'authenticated'
|
OR c.BI_Extension3 IS NULL
|
)
|
OR b.PI_Extension3 IS NULL
|
)
|
</select>
|
</mapper>
|