123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- <?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.OrganizationInfoMapper">
- <!-- 开启二级缓存 -->
- <!--<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>-->
- <select id="getInterviewListByUserid"
- resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
- SELECT
- a.*
- FROM (SELECT
- oi.id,
- oi.name,
- oi.orgtype,
- c.id as connid,
- c.creator as userid,
- c.createtime,
- c.pagecode,
- c.node,
- oi.district as address,
- c.templettype
- FROM connectioninfo c,
- conn_org_lk col,
- organization_info oi,
- sys_page sp
- WHERE c.id = col.connid
- AND col.orgid = oi.id
- AND c.templettype = sp.id
- AND c.isresourcelibrarydata = 0
- AND c.by1 = 0
- AND c.node = #{node}
- AND sp.funid = #{funid}
- AND c.creator = #{userid}
- AND c.templettype IN
- <foreach collection="funlist" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- ORDER BY c.createtime DESC) a
- WHERE a.name LIKE #{keyword}
- GROUP BY a.name order by a.createtime desc
- </select>
- <select id="getInterviewListByUid"
- resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
- SELECT
- a.*
- FROM (SELECT
- oi.id,
- oi.name,
- oi.orgtype,
- c.id as connid,
- c.creator as userid,
- c.createtime,
- c.pagecode,
- c.node,
- oi.district as address,
- c.templettype
- FROM connectioninfo c,
- conn_org_lk col,
- organization_info oi,
- sys_page sp
- WHERE c.id = col.connid
- AND col.orgid = oi.id
- AND c.templettype = sp.id
- AND c.isresourcelibrarydata = 0
- AND c.by1 = 0
- AND c.node = #{node}
- AND sp.funid = #{funid}
- AND c.creator = #{userid}
- AND c.templettype IN
- <foreach collection="funlist" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- ORDER BY c.createtime DESC) a
- GROUP BY a.name order by a.createtime desc
- </select>
- <select id="getInterviewListByUseridCount" resultType="java.lang.Integer">
- SELECT COUNT(*) AS total FROM (
- SELECT
- a.*
- FROM (SELECT
- oi.id,
- oi.name,
- c.creator as userid,
- c.createtime,
- c.pagecode,
- c.node,
- oi.district as address,
- c.templettype
- FROM connectioninfo c,
- conn_org_lk col,
- organization_info oi,
- sys_page sp
- WHERE c.id = col.connid
- AND col.orgid = oi.id
- AND c.templettype = sp.id
- AND c.by1 = 0
- AND c.isresourcelibrarydata = 0
- AND c.node = #{node}
- AND sp.funid = #{funid}
- AND c.creator = #{userid}
- AND c.templettype IN
- <foreach collection="funlist" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- ORDER BY c.createtime DESC) a
- WHERE a.name LIKE #{keyword} GROUP BY a.name) b
- </select>
- <select id="getInterviewList" resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
- SELECT
- a.*
- FROM (SELECT
- oi.id,
- oi.name,
- c.creator AS userid,
- c.createtime,
- oi.district AS address
- FROM (SELECT
- ci.*
- FROM connectioninfo ci,
- coninfo_classification cc,
- conninfoclassrelation ccr
- WHERE ci.id = ccr.infoId
- AND cc.id = ccr.claid
- AND cc.id = #{claid}) c,
- conn_org_lk col,
- organization_info oi
- WHERE c.id = col.connid
- AND col.orgid = oi.id
- ORDER BY c.createtime DESC) a
- WHERE a.name LIKE #{keyword}
- GROUP BY a.name
- ORDER BY a.createtime DESC
- </select>
- <select id="getInterviewListCount" resultType="java.lang.Integer">
- SELECT COUNT(*) AS total
- FROM (
- SELECT
- a.*
- FROM (SELECT
- oi.id,
- oi.name,
- c.creator AS userid,
- c.createtime,
- oi.district AS address
- FROM (SELECT
- ci.*
- FROM connectioninfo ci,
- coninfo_classification cc,
- conninfoclassrelation ccr
- WHERE ci.id = ccr.infoId
- AND cc.id = ccr.claid
- AND cc.id = #{claid}) c,
- conn_org_lk col,
- organization_info oi
- WHERE c.id = col.connid
- AND col.orgid = oi.id
- ORDER BY c.createtime DESC) a
- WHERE a.name LIKE #{keyword}
- GROUP BY a.name ) b
- </select>
- <select id="getInterviewListTwo" resultType="cn.ubitech.ttc.model.datatools.interview.InterviewListModel">
- SELECT
- a.*
- FROM (SELECT
- oi.id,
- oi.name,
- c.id as connid,
- c.creator as userid,
- c.createtime,
- c.pagecode,
- c.node,
- c.templettype,
- oi.district as address,
- oi.orgtype
- FROM connectioninfo c,
- conn_org_lk col,
- organization_info oi,
- sys_page sp
- WHERE c.id = col.connid
- AND col.orgid = oi.id
- AND c.by1 =0
- AND c.templettype = sp.id
- AND c.isresourcelibrarydata = 0
- AND sp.funid = #{funid}
- AND c.templettype IN
- <foreach collection="funlist" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND c.node IN
- <foreach collection="nodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- ORDER BY c.createtime DESC) a
- WHERE a.name LIKE #{keyword}
- GROUP BY a.name order by a.createtime desc
- </select>
- <select id="getInterviewListCountTwo" resultType="java.lang.Integer">
- SELECT COUNT(*) AS total
- FROM (
- SELECT a.*
- FROM (SELECT
- oi.id,
- oi.name,
- c.creator as userid,
- c.createtime,
- c.pagecode,
- c.node,
- c.templettype,
- oi.orgtype,
- oi.district as address
- FROM connectioninfo c,
- conn_org_lk col,
- organization_info oi,
- sys_page sp
- WHERE c.id = col.connid
- AND col.orgid = oi.id
- AND c.by1 =0
- AND c.templettype = sp.id
- AND c.isresourcelibrarydata = 0
- AND sp.funid = #{funid}
- AND c.templettype IN
- <foreach collection="funlist" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- AND c.node IN
- <foreach collection="nodeList" item="id" index="index"
- open="(" close=")" separator=",">
- #{id}
- </foreach>
- ORDER BY c.createtime DESC) a
- WHERE a.name LIKE #{keyword}
- GROUP BY a.name) b
- </select>
- <select id="getViceOrgByOrgname" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
- select * from organization_info where id in(
- select otherorg from union_org_lk u
- inner join organization_info o on u.unionorg = o.id
- where o.name = #{orgname}
- )
- </select>
- <select id="getOrgListByNode" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
- select * from organization_info where id in (
- select companyid from company_node_lk where companyid in(
- select id from organization_info where name = #{orgname}) AND comefrom = #{node})
- </select>
- <select id="getOrgListByCodeAndNameAndNode" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
- select * from organization_info where id in (
- select companyid from company_node_lk where companyid in(
- select id from organization_info where name = #{orgname} and orgcode = #{orgcode}) AND comefrom = #{node})
- </select>
- </mapper>
|