All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.dolphinscheduler.dao.mapper.UserMapper.xml Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
<?xml version="1.0" encoding="UTF-8" ?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.apache.dolphinscheduler.dao.mapper.UserMapper">
    <select id="queryAllGeneralUser" resultType="org.apache.dolphinscheduler.dao.entity.User">
        select * from t_ds_user
        where user_type=1;
    </select>
    <select id="queryByUserNameAccurately" resultType="org.apache.dolphinscheduler.dao.entity.User">
        select * from t_ds_user
        where user_name=#{userName}
    </select>
    <select id="queryUserByNamePassword" resultType="org.apache.dolphinscheduler.dao.entity.User">
        select * from t_ds_user
        where user_name=#{userName} and user_password = #{password}
    </select>
    <select id="queryUserPaging" resultType="org.apache.dolphinscheduler.dao.entity.User">
        select u.id,u.user_name,u.user_password,u.user_type,u.email,u.phone,u.tenant_id,u.create_time,
        u.update_time,t.tenant_name,
        case when u.queue  <![CDATA[ <> ]]> '' then u.queue else q.queue_name end as queue, q.queue_name
        from t_ds_user u
        left join t_ds_tenant t on u.tenant_id=t.id
        left join t_ds_queue q on t.queue_id = q.id
        where 1=1
        <if test="userName!=null and userName != ''" >
             and u.user_name like concat ('%', #{userName}, '%')
        </if>
        order by u.update_time desc
    </select>
    <select id="queryDetailsById" resultType="org.apache.dolphinscheduler.dao.entity.User">
        select u.*, t.tenant_name,
        case when u.queue <![CDATA[ <> ]]>  '' then u.queue else q.queue_name end as queue_name
        from t_ds_user u,t_ds_tenant t,t_ds_queue q
        WHERE u.tenant_id = t.id and t.queue_id = q.id and u.id = #{userId}
    </select>
    <select id="queryUserListByAlertGroupId" resultType="org.apache.dolphinscheduler.dao.entity.User">
      select u.*
      from t_ds_user u, t_ds_relation_user_alertgroup rel
      where u.id = rel.user_id AND rel.alertgroup_id = #{alertgroupId}
    </select>
    <select id="queryUserListByTenant" resultType="org.apache.dolphinscheduler.dao.entity.User">
      select *
      from t_ds_user
      where tenant_id = #{tenantId}
    </select>
    <select id="queryTenantCodeByUserId" resultType="org.apache.dolphinscheduler.dao.entity.User">
        SELECT  u.*,t.tenant_code
        FROM  t_ds_user u, t_ds_tenant t
        WHERE u.tenant_id = t.id AND u.id = #{userId}
    </select>
    <select id="queryUserByToken" resultType="org.apache.dolphinscheduler.dao.entity.User">
        select u.*
        from t_ds_user u ,t_ds_access_token t
        where u.id = t.user_id and token=#{token} and t.expire_time > NOW()
    </select>
</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy