rushfee/build/classes/db/companyauth_sql.xml

190 lines
4.4 KiB
XML
Raw Normal View History

2022-05-16 15:07:40 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqls SYSTEM "sql_definition.dtd">
<sqls>
<sql group="companyauth">
<i id="getList"><![CDATA[
select a.CNAME, a.cguid,wm_concat(ORG_SHORT_NAME) as ORG_NAME
from (SELECT
y.CNAME,
z.ORG_SHORT_NAME,
y.CGUID
FROM
RUSH_CRMCOMP_TO_USER_RELATION t
LEFT JOIN aos_rms_user y ON t.RUSH_USERID = y.CGUID
LEFT JOIN COMPANY_ORGANIZE z ON z.ORG_ID = t.CRMCOMPANYID
) a where $like(CNAME,CNAME)
group by a.CNAME,a.CGUID
]]></i>
<i id="getcompany"><![CDATA[
select t.ORG_ID as id,t.ORG_SHORT_NAME as text, t.PARENT_ORG_ID as pid from COMPANY_ORGANIZE t
]]></i>
<i id="getallList"><![CDATA[
select t.cguid ,x.CORGNID,y.cname as name,t.cname from (SELECT cguid,cname FROM
( SELECT CGUID AS id FROM AOS_RMS_USER MINUS SELECT RUSH_USERID AS id FROM RUSH_CRMCOMP_TO_USER_RELATION ) w,
AOS_RMS_USER z
WHERE
z.CGUID = w.id ) t
left join AOS_RMS_USER_ORGN_REL x on t.cguid=x.CUSERID
left join AOS_ORGN y on CORGNID=y.cguid
where t.cguid=x.CUSERID and x.CORGNID=y.cguid and
$like(t.CNAME,CNAME)
]]></i>
<i id="getqueryuserList"><![CDATA[
select t.cguid ,x.CORGNID,y.cname as name,t.cname from (SELECT cguid,cname FROM
( SELECT CGUID AS id FROM AOS_RMS_USER MINUS SELECT USER_ID AS id FROM RUSH_USER_QUERYAUTH ) w,
AOS_RMS_USER z
WHERE
z.CGUID = w.id ) t
left join AOS_RMS_USER_ORGN_REL x on t.cguid=x.CUSERID
left join AOS_ORGN y on CORGNID=y.cguid
where t.cguid=x.CUSERID and x.CORGNID=y.cguid and
$like(t.CNAME,CNAME)
]]></i>
<i id="getrushfeeuserList"><![CDATA[
SELECT
a.cname,
c.cname bname,
a.CGUID
FROM
aos_rms_user a
LEFT JOIN AOS_RMS_USER_ORGN_REL b ON a.CGUID = b.CUSERID
LEFT JOIN AOS_ORGN c ON c.CGUID = b.CORGNID
WHERE
a.ISTATUS = '1'
AND a.CUSERTYPE IN ( SELECT cguid FROM RUSH_AUTH d LEFT JOIN AOS_RMS_USERTYPE_CFG e ON d.NAME = e.CNAME WHERE d.TYPE = 'rush_sharer_type' )
]]></i>
<!--wm_concat ( cname ) AS auth,-->
<i id="getauthList"><![CDATA[
SELECT
t.bname || ' (' || t.dname || ')' bname,
t.dname,
t.cguid,
rtrim(xmlagg(xmlparse(content cname||',' wellformed)).getclobval(), ',') AS auth,
count( 1 ) num,
sum( CASE WHEN t.id = '1' THEN 1 ELSE 0 END ) AS aisino,
sum( CASE WHEN t.id = '932547335889271493' THEN 1 ELSE 0 END ) AS waihu
FROM
(
SELECT
b.cname bname,
d.cguid bid,
d.cname dname,
b.cguid,
c.cname,
c.cguid idid,
g.cname bumen,
g.cguid id
FROM
RUSH_USER_QUERYAUTH a
LEFT JOIN AOS_RMS_USER b ON a.USER_ID = b.cguid
LEFT JOIN AOS_RMS_USER c ON a.userauth_id = c.cguid
LEFT JOIN AOS_RMS_USER_ORGN_REL e ON b.CGUID = e.CUSERID
LEFT JOIN AOS_ORGN d ON d.CGUID = e.CORGNID
left join AOS_RMS_USER_ORGN_REL f ON c.CGUID = f.CUSERID
LEFT JOIN AOS_ORGN g ON g.CGUID = f.CORGNID
) t where $like(t.bname,cname)
GROUP BY
t.bname,
t.cguid,
t.dname
]]></i>
<i id="getauthbyid"><![CDATA[
SELECT
t.user_id,
t.USERAUTH_ID,
y.cname bname ,
z.cname
FROM
RUSH_USER_QUERYAUTH t
LEFT JOIN AOS_RMS_USER_ORGN_REL x ON t.USERAUTH_ID = x.CUSERID
LEFT JOIN AOS_ORGN y ON CORGNID = y.cguid
LEFT JOIN aos_rms_user z ON z.cguid = t.userauth_id
WHERE
t.user_id = {cguid}
]]></i>
<i id="getuserTreeData"><![CDATA[
SELECT
a.cname,
c.cname bname,
a.CGUID id ,
c.CPARENTID,
c.cguid ,
c.cname ||'---'||a.cname text
FROM
aos_rms_user a
LEFT JOIN AOS_RMS_USER_ORGN_REL b ON a.CGUID = b.CUSERID
LEFT JOIN AOS_ORGN c ON c.CGUID = b.CORGNID
WHERE
a.CUSERTYPE IN ( SELECT cguid FROM RUSH_AUTH d LEFT JOIN AOS_RMS_USERTYPE_CFG e ON d.NAME = e.CNAME WHERE d.TYPE = 'rush_sharer_type' )
]]></i>
2023-09-03 15:06:35 +00:00
<i id="getcompanybyshuiju"><![CDATA[
select distinct city_name id,city_name text,'0' pid from tel_dic_city
]]></i>
<i id="getbureauList"><![CDATA[
select a.CNAME, a.cguid,wm_concat(org_name) as ORG_NAME
from (SELECT
y.CNAME,
org_name,
y.CGUID
FROM
SHUIJU_QUYU_USER t
LEFT JOIN aos_rms_user y ON t.user_id = y.CGUID
) a where $like(CNAME,CNAME)
group by a.CNAME,a.CGUID ]]></i>
<i id="getallListshuiju"><![CDATA[
select t.cguid ,x.CORGNID,y.cname as name,t.cname from (SELECT cguid,cname FROM
( SELECT CGUID AS id FROM AOS_RMS_USER MINUS SELECT user_id AS id FROM SHUIJU_QUYU_USER ) w,
AOS_RMS_USER z
WHERE
z.CGUID = w.id ) t
left join AOS_RMS_USER_ORGN_REL x on t.cguid=x.CUSERID
left join AOS_ORGN y on CORGNID=y.cguid
where t.cguid=x.CUSERID and x.CORGNID=y.cguid and
$like(t.CNAME,CNAME)
]]></i>
2022-05-16 15:07:40 +00:00
</sql>
</sqls>