12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?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.ubitech.ttc.dao.SysUsersMapper">
- <!-- 开启二级缓存 -->
- <!--<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>-->
- <select id="getSysUsersByAuthorityId" resultType="cn.ubitech.ttc.entity.SysUsers">
- select * from sys_users su,cloudauthoritygroup cg,cloudauthoritygroupuser cgu where cg.id = cgu.gid and cgu.userid =
- su.userid and cgu.isenabled = 1 and cg.id = #{gid}
- </select>
- <select id="getUserFocus" resultType="cn.ubitech.ttc.model.user.UserModel">
- SELECT DISTINCT su.UserId,IFNULL(su.userName,'') userName,IFNULL(su.photo,'') photo,su.mobile FROM click_record c,sys_users su WHERE
- c.clicktype = #{clicktype} and c.`status` = 1 and c.moduleid = #{moduleid}
- <if test='type == "0"'>
- AND c.userid = #{userid} AND su.userid = c.targetid
- </if>
- <if test='type == "1"'>
- AND c.targetid = #{userid} AND su.userid = c.userid
- </if>
- </select>
- <select id="getuserlist_1" resultType="cn.ubitech.ttc.model.user.UserModel">
- SELECT DISTINCT
- su.userid,
- su.username,
- IFNULL(su.photo, '') photo
- FROM click_record c,
- sys_users su
- WHERE c.userid = #{userid} and c.clicktype = 2617 and c.`status` = 1 AND su.userid = c.targetid
- AND (su.username like #{keyword} or su.mobile like #{keyword})
- </select>
- <select id="getuserlist_2" resultType="cn.ubitech.ttc.model.user.UserModel">
- SELECT DISTINCT
- su.userid,
- su.username,
- IFNULL(su.photo, '') photo
- FROM click_record c,
- sys_users su
- WHERE c.targetid = #{userid} and c.clicktype = 2617 and c.`status` = 1 AND su.userid = c.userid
- AND (su.username like #{keyword} or su.mobile like #{keyword})
- </select>
- <select id="getuserlist_3" resultType="cn.ubitech.ttc.model.user.UserModel">
- SELECT
- su.userid,
- su.username,
- IFNULL(su.photo, '') photo
- FROM (SELECT a.reciverid
- FROM
- (SELECT reciverid
- FROM im_user_topic iut
- WHERE iut.isactive = 1 AND iut.TYPE = 6202 AND iut.userid =
- #{userid}
- ) AS a LEFT JOIN (SELECT DISTINCT *
- from (SELECT DISTINCT cr.targetid AS userid
- FROM click_record cr
- WHERE cr.userid = #{userid} AND cr.clicktype = 2617
- AND cr.`status` = 1
- UNION ALL SELECT DISTINCT cr.userid AS userid
- FROM click_record cr
- WHERE cr.targetid = #{userid} AND cr.clicktype = 2617
- AND cr.`status` = 1) u) b
- on a.reciverid = b.userid
- where b.userid IS NULL) c, sys_users su
- WHERE su.userid = c.reciverid AND
- (su.username like #{keyword} or su.mobile like #{keyword})
- </select>
- <select id="selectUser" resultType="cn.ubitech.ttc.model.user.UserModel">
- select
- su.userid,
- su.username,
- IFNULL(su.photo, '') photo
- FROM sys_users su
- where (su.username like #{keyword} or su.mobile like #{keyword}) and su.IsEnabled != 2
- </select>
- <select id="getUsernameByOrgname" resultType="java.lang.String">
- select s.username
- from sys_users s
- left JOIN resourcelibrary r on s.userid = r.creator
- where r.title = #{orgName}
- </select>
- </mapper>
|