Commit 50ad3625 by wuwenlong

sql iplat/eplat to schema

parent 736c8cf2
...@@ -448,10 +448,10 @@ ...@@ -448,10 +448,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -490,10 +490,10 @@ ...@@ -490,10 +490,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -526,10 +526,10 @@ ...@@ -526,10 +526,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -558,10 +558,10 @@ ...@@ -558,10 +558,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -590,10 +590,10 @@ ...@@ -590,10 +590,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -632,10 +632,10 @@ ...@@ -632,10 +632,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -679,10 +679,10 @@ ...@@ -679,10 +679,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -718,10 +718,10 @@ ...@@ -718,10 +718,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -757,10 +757,10 @@ ...@@ -757,10 +757,10 @@
JOIN ( JOIN (
SELECT SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A FROM ${platSchema}.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID JOIN ${platSchema}.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID JOIN ${platSchema}.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID JOIN ${platSchema}.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup' WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO ) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
...@@ -774,7 +774,7 @@ ...@@ -774,7 +774,7 @@
<select id="queryCompanyCode" parameterClass="java.util.HashMap" <select id="queryCompanyCode" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap"> resultClass="java.util.HashMap">
select COMPANY_CODE from iplat.XS_USER where 1=1 select COMPANY_CODE from ${platSchema}.XS_USER where 1=1
<isNotEmpty prepend=" AND " property="loginName"> <isNotEmpty prepend=" AND " property="loginName">
LOGIN_NAME = #loginName# LOGIN_NAME = #loginName#
</isNotEmpty> </isNotEmpty>
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
SELECT SELECT
ORG_ID AS "orgId", ORG_ID AS "orgId",
ORG_CNAME AS "orgCname" ORG_CNAME AS "orgCname"
FROM iplat.TXSOG01 FROM ${platSchema}.TXSOG01
WHERE 1=1 WHERE 1=1
AND ORG_TYPE = 'factory' AND COMPANY_CODE = #companyCode# AND ORG_TYPE = 'factory' AND COMPANY_CODE = #companyCode#
AND IS_DELETED=0 AND IS_DELETED=0
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
SELECT SELECT
ORG_ID AS "orgId", ORG_ID AS "orgId",
ORG_CNAME AS "orgCname" ORG_CNAME AS "orgCname"
FROM iplat.TXSOG01 FROM ${platSchema}.TXSOG01
WHERE 1=1 WHERE 1=1
AND ORG_TYPE = 'factory' AND COMPANY_CODE = #companyCode# AND ORG_TYPE = 'factory' AND COMPANY_CODE = #companyCode#
AND IS_DELETED=0 AND IS_DELETED=0
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
SELECT SELECT
ITEM_CODE, ITEM_CODE,
ITEM_CNAME ITEM_CNAME
FROM iplat.TEDCM01 FROM ${platSchema}.TEDCM01
WHERE CODESET_CODE = 'hpjx.hpjx.poorType' WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE ) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# WHERE COMPANY_CODE= #companyCode#
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
<select id="queryFile" resultClass="java.util.HashMap"> <select id="queryFile" resultClass="java.util.HashMap">
SELECT URL FROM iplat.TEUDM05 where RES_ID=#docId# SELECT URL FROM ${platSchema}.TEUDM05 where RES_ID=#docId#
</select> </select>
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
<select id="queryFvalue" resultClass="java.util.HashMap"> <select id="queryFvalue" resultClass="java.util.HashMap">
SELECT DISTINCT FVALUE AS "fvalue" FROM iplat.TEDCC03 WHERE FKEY='docRootDir' SELECT DISTINCT FVALUE AS "fvalue" FROM ${platSchema}.TEDCC03 WHERE FKEY='docRootDir'
</select> </select>
<select id="pmBannerList" resultClass="java.util.HashMap"> <select id="pmBannerList" resultClass="java.util.HashMap">
......
...@@ -355,7 +355,7 @@ ...@@ -355,7 +355,7 @@
</isNotEmpty>--> </isNotEmpty>-->
<!--<isNotEmpty prepend="and" property="companyCode"> <!--<isNotEmpty prepend="and" property="companyCode">
ORG_ID in ( ORG_ID in (
select ORG_ID FROM iplat.txsog01 select ORG_ID FROM ${platSchema}.txsog01
WHERE IS_DELETED = '0' WHERE IS_DELETED = '0'
and COMPANY_CODE = #companyCode# and COMPANY_CODE = #companyCode#
<isNotEmpty prepend="and" property="orgEname"> <isNotEmpty prepend="and" property="orgEname">
...@@ -363,11 +363,11 @@ ...@@ -363,11 +363,11 @@
</isNotEmpty> </isNotEmpty>
AND ORG_TYPE NOT IN ('factory','dept') AND ORG_TYPE NOT IN ('factory','dept')
and FACTORY_CODE IN ( and FACTORY_CODE IN (
SELECT FACTORY_CODE FROM iplat.txsog01 SELECT FACTORY_CODE FROM ${platSchema}.txsog01
WHERE IS_DELETED = '0' and COMPANY_CODE = #companyCode# WHERE IS_DELETED = '0' and COMPANY_CODE = #companyCode#
and ORG_ID IN ( and ORG_ID IN (
SELECT ORG_ID FROM iplat.txsog02 T2 SELECT ORG_ID FROM ${platSchema}.txsog02 T2
INNER JOIN iplat.xs_user xu ON t2.USER_ID = xu.USER_ID INNER JOIN ${platSchema}.xs_user xu ON t2.USER_ID = xu.USER_ID
WHERE xu.COMPANY_CODE = #companyCode# WHERE xu.COMPANY_CODE = #companyCode#
ORDER BY T2.REC_CREATE_TIME desc ORDER BY T2.REC_CREATE_TIME desc
) )
......
...@@ -538,7 +538,7 @@ ...@@ -538,7 +538,7 @@
when ITEM_CODE in ('4') then '4' when ITEM_CODE in ('4') then '4'
else '0' end "param1Field" else '0' end "param1Field"
from from
iplat.tedcm01 ${platSchema}.tedcm01
where STATUS = '1' and CODESET_CODE = 'hpjx.hpkc.inventType' where STATUS = '1' and CODESET_CODE = 'hpjx.hpkc.inventType'
<isNotEmpty prepend=" AND " property="itemCode"> <isNotEmpty prepend=" AND " property="itemCode">
$itemCode$ $itemCode$
......
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
ORG_ENAME AS "groupCode", ORG_ENAME AS "groupCode",
ORG_TYPE AS "orgType", ORG_TYPE AS "orgType",
FACTORY_CODE as "factoryCode" FACTORY_CODE as "factoryCode"
FROM iplat.txsog01 FROM ${platSchema}.txsog01
WHERE IS_DELETED = '0' WHERE IS_DELETED = '0'
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
...@@ -248,11 +248,11 @@ ...@@ -248,11 +248,11 @@
</isEmpty> </isEmpty>
<isNotEmpty prepend=" AND " property="loginName"> <isNotEmpty prepend=" AND " property="loginName">
FACTORY_CODE IN ( FACTORY_CODE IN (
SELECT FACTORY_CODE FROM iplat.txsog01 SELECT FACTORY_CODE FROM ${platSchema}.txsog01
WHERE IS_DELETED = '0' and COMPANY_CODE = #companyCode# WHERE IS_DELETED = '0' and COMPANY_CODE = #companyCode#
and ORG_ID = ( and ORG_ID = (
select ORG_ID from iplat.txsog02 T2 select ORG_ID from ${platSchema}.txsog02 T2
INNER JOIN iplat.xs_user xu ON t2.USER_ID = xu.USER_ID INNER JOIN ${platSchema}.xs_user xu ON t2.USER_ID = xu.USER_ID
where xu.LOGIN_NAME = #loginName# where xu.LOGIN_NAME = #loginName#
order by T2.REC_CREATE_TIME desc order by T2.REC_CREATE_TIME desc
limit 1 limit 1
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
select select
ITEM_CODE as "groupType" ITEM_CODE as "groupType"
FROM FROM
iplat.tedcm01 ${platSchema}.tedcm01
where STATUS = '1' and CODESET_CODE = 'hpjx.hpjx.productionType' where STATUS = '1' and CODESET_CODE = 'hpjx.hpjx.productionType'
<isNotEmpty prepend=" AND " property="itemCode"> <isNotEmpty prepend=" AND " property="itemCode">
$itemCode$ $itemCode$
......
...@@ -106,16 +106,16 @@ ...@@ -106,16 +106,16 @@
FROM ( FROM (
SELECT SELECT
@CODES as CODES, @CODES as CODES,
(SELECT @CODES:=GROUP_CONCAT(PARENT_ORG_ID) FROM IPLAT.TXSOG01 WHERE FIND_IN_SET(ORG_ID, @CODES) (SELECT @CODES:=GROUP_CONCAT(PARENT_ORG_ID) FROM ${platSchema}.TXSOG01 WHERE FIND_IN_SET(ORG_ID, @CODES)
AND COMPANY_CODE = #companyCode# AND COMPANY_CODE = #companyCode#
AND IS_DELETED = 0 AND IS_DELETED = 0
) as T1, ) as T1,
@LEVEL:=@LEVEL+1 as level @LEVEL:=@LEVEL+1 as level
FROM IPLAT.TXSOG01, FROM ${platSchema}.TXSOG01,
(select @CODES:=#orgId#, @LEVEL:= 0) T4 (select @CODES:=#orgId#, @LEVEL:= 0) T4
where @CODES is not null where @CODES is not null
) T2, ) T2,
IPLAT.TXSOG01 T3 ${platSchema}.TXSOG01 T3
WHERE 1=1 WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES) AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
<isNotEmpty prepend=" AND " property="orgType"> <isNotEmpty prepend=" AND " property="orgType">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment