针灸质控中心平台
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.

81 lines
3.0 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.acupuncture.system.persist.dao.DmsUserDao">
<select id="selectUserByUserName" resultType="com.acupuncture.system.domain.vo.DmsLoginUserVo$DmsUserVo">
select
id,
tenant_id as tenantId,
user_name as userName,
password,
nick_name as nickName,
email,
phonenumber,
sex,
status
from
dms_user
where
user_name = #{userName}
</select>
<select id="queryLoginUserDataScore" resultType="com.acupuncture.system.domain.vo.DmsLoginUserVo$DataScoreVo">
select
d.id as dmsUserId,
d.nick_name as dmsUserNickName,
d.user_name as username,
d.password,
s.id as scoreId,
s.data_source_key as dataSourceKey,
s.hospital_id as hospitalId,
s.url,
s.username as sUsername,
s.password as sPassword,
t.id as tenantId,
d.del_flag as delFlag
from
dms_user d
left join
dms_tenant t
on
d.tenant_id = t.id
left join
ums_data_source s
on
t.data_source_id = s.id
<where>
<if test="userName != null and userName != ''">
and d.user_name = #{userName}
</if>
and s.del_flag = 0
and t.del_flag = 0
</where>
group by d.id
</select>
<update id="updateUser" parameterType="com.acupuncture.system.domain.vo.DmsLoginUserVo$DmsUserVo">
update dms_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.acupuncture.system.domain.vo.DmsLoginUserVo$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.acupuncture.system.domain.vo.DmsLoginUserVo$DmsUserVo">
select id, user_name from dms_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
</select>
</mapper>