123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <?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.SysUsersInfoMapper">
- <!-- 开启二级缓存 -->
- <cache type="org.mybatis.caches.ehcache.EhcacheCache">
- <property name="timeToIdleSeconds" value="120"/>
- <property name="timeToLiveSeconds" value="180"/>
- <property name="maxEntriesLocalHeap" value="1000"/>
- <property name="maxEntriesLocalDisk" value="10000000"/>
- <property name="memoryStoreEvictionPolicy" value="LRU"/>
- </cache>
- <select id="getreviewAuthlist" resultType="cn.ubitech.ttc.entity.SysUsersInfo" useCache="false">
- SELECT
- *
- FROM
- sys_users_info
- WHERE
- (id IN (
- SELECT
- s.id
- FROM
- sys_users_info s,
- sys_users_review_auth u
- WHERE
- s.usercomefrom = u.nodeid
- AND u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND s.applytype IN
- <foreach collection="personTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- )
- OR id IN (
- SELECT
- i.id
- FROM
- sys_users_info i,
- organization_info o,
- company_node_lk n
- WHERE
- i.orgid = o.id
- AND o.id = n.companyid
- AND i.applytype IN
- <foreach collection="companyTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND n.comefrom IN (
- SELECT
- u.nodeid
- FROM
- sys_users_review_auth u
- WHERE
- u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- )
- )
- OR id IN (
- SELECT
- i.id
- FROM
- sys_users_info i,
- node nod
- WHERE
- i.orgid = nod.orgid
- AND i.applytype IN
- <foreach collection="companyTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND nod.id IN (
- SELECT
- u.nodeid
- FROM
- sys_users_review_auth u
- WHERE
- u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- )
- )
- OR id IN (
- SELECT
- f.id
- FROM
- sys_users_info f,
- sys_users_review_auth u
- WHERE
- f.usercomefrom = u.nodeid
- AND f.applytype IN
- <foreach collection="companyTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND f.orgid IS NULL
- AND u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- ))
- <if test='idtype != 0'>
- AND idtype=#{idtype}
- </if>
- <if test='authenstatus != 0'>
- AND authenstatus=#{authenstatus}
- </if>
- <if test="key != null and key != ''">
- AND (username like '%${key}%' or applyname like '%${key}%')
- </if>
- ORDER BY createtime DESC
- </select>
- <select id="getreviewAuthlist1" resultType="cn.ubitech.ttc.entity.SysUsersInfo" useCache="false">
- SELECT
- *
- FROM
- sys_users_info
- where usercomefrom in
- (select nodeid
- FROM sys_users_review_auth
- WHERE userid = #{userid})
- ORDER BY createtime DESC
- </select>
- <select id="getreviewAuthcount" resultType="java.lang.Integer" useCache="false">
- SELECT
- count(id)
- FROM
- sys_users_info
- WHERE
- (id IN (
- SELECT
- s.id
- FROM
- sys_users_info s,
- sys_users_review_auth u
- WHERE
- s.usercomefrom = u.nodeid
- AND u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND s.applytype IN
- <foreach collection="personTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- )
- OR id IN (
- SELECT
- i.id
- FROM
- sys_users_info i,
- organization_info o,
- company_node_lk n
- WHERE
- i.orgid = o.id
- AND o.id = n.companyid
- AND i.applytype IN
- <foreach collection="companyTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND n.comefrom IN (
- SELECT
- u.nodeid
- FROM
- sys_users_review_auth u
- WHERE
- u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- )
- )
- OR id IN (
- SELECT
- i.id
- FROM
- sys_users_info i,
- node nod
- WHERE
- i.orgid = nod.orgid
- AND i.applytype IN
- <foreach collection="companyTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND nod.id IN (
- SELECT
- u.nodeid
- FROM
- sys_users_review_auth u
- WHERE
- u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- )
- )
- OR id IN (
- SELECT
- f.id
- FROM
- sys_users_info f,
- sys_users_review_auth u
- WHERE
- f.usercomefrom = u.nodeid
- AND f.applytype IN
- <foreach collection="companyTypeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND f.orgid IS NULL
- AND u.userid IN
- <foreach collection="usernodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- ))
- <if test='idtype != 0'>
- AND idtype=#{idtype}
- </if>
- <if test='authenstatus != 0'>
- AND authenstatus=#{authenstatus}
- </if>
- <if test="key != null and key != ''">
- AND (username like '%${key}%' or applyname like '%${key}%')
- </if>
- </select>
- <select id="getUserInOrg" resultType="cn.ubitech.ttc.entity.SysUsersInfo">
- select sui.*
- from sys_users_info sui
- where sui.userid = #{userid}
- and sui.orgid = #{oid}
- and sui.authenstatus = #{status}
- </select>
- <select id="getUserInNode" resultType="cn.ubitech.ttc.entity.SysUsersInfo">
- select sui.* from sys_users_info sui where sui.userid = #{userid} and sui.authenstatus = #{status}
- </select>
- </mapper>
|