You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
3.8 KiB
104 lines
3.8 KiB
<?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.research.system.persist.dao.TmsUserDao">
|
|
|
|
<select id="queryById" resultType="com.research.system.domain.po.TmsTenant">
|
|
select id,
|
|
name
|
|
from dms_tenant
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<select id="selectUserByUserName" resultType="com.research.system.domain.vo.TmsLoginUserVo$DmsUserVo">
|
|
select
|
|
id,
|
|
tenant_id as tenantId,
|
|
user_name as userName,
|
|
nick_name as nickName,
|
|
email,
|
|
phonenumber,
|
|
sex,
|
|
status
|
|
from
|
|
tms_tenant_user
|
|
where
|
|
user_name = #{userName}
|
|
</select>
|
|
|
|
<select id="queryLoginUserDataScore" resultType="com.research.system.domain.vo.TmsLoginUserVo$DataScoreVo">
|
|
select
|
|
d.id as dmsUserId,
|
|
d.nick_name as dmsUserNickName,
|
|
d.user_name as username,
|
|
s.id as scoreId,
|
|
s.data_source_key as dataSourceKey,
|
|
s.url,
|
|
s.username as sUsername,
|
|
s.password as sPassword,
|
|
t.id as tenantId,
|
|
d.del_flag as delFlag
|
|
from
|
|
tms_tenant_user d
|
|
left join
|
|
tms_tenant t
|
|
on
|
|
d.tenant_id = t.id
|
|
left join
|
|
srv_data_source s
|
|
on
|
|
t.data_source_id = s.id
|
|
<where>
|
|
<if test="userName != null and userName != ''">
|
|
and d.user_name = #{userName}
|
|
</if>
|
|
and d.del_flag = 0
|
|
and s.del_flag = 0
|
|
and t.del_flag = 0
|
|
and t.status = 0
|
|
</where>
|
|
group by d.id
|
|
</select>
|
|
|
|
<update id="updateUser" parameterType="com.research.system.domain.vo.TmsLoginUserVo$DmsUserVo">
|
|
update tms_tenant_user
|
|
<set>
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
<if test="email != null ">email = #{email},</if>
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
|
<if test="password != null and password != ''">password = #{password},</if>
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
update_time = sysdate()
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<select id="checkUserNameUnique" parameterType="String" resultType="com.research.system.domain.vo.TmsLoginUserVo$DmsUserVo">
|
|
select id, user_name from dms_user where user_name = #{userName} and del_flag = '0' limit 1
|
|
</select>
|
|
|
|
<select id="checkPhoneUnique" parameterType="String" resultType="com.research.system.domain.vo.TmsLoginUserVo$DmsUserVo">
|
|
select id, user_name from dms_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
|
|
</select>
|
|
<select id="queryTenantUserById" resultType="com.research.system.domain.vo.TmsLoginUserVo$DmsUserVo">
|
|
select
|
|
u.id,
|
|
u.nick_name as nickName,
|
|
u.user_name as userName,
|
|
u.tenant_id as tenantId,
|
|
u.phonenumber as phonenumber,
|
|
u.email as email,
|
|
u.sex as sex,
|
|
t.`name` as tenantName,
|
|
t.contact_phone as tenantPhone,
|
|
u.slaver_admin as slaverAdmin
|
|
from
|
|
tms_tenant_user u join tms_tenant t on u.tenant_id = t.id
|
|
WHERE
|
|
u.del_flag = 0
|
|
and u.id = #{userId}
|
|
</select>
|
|
</mapper>
|
|
|