from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE
group by a.GROUP_NAME,b.GROUP_TYPE
...
@@ -104,9 +104,9 @@
...
@@ -104,9 +104,9 @@
else 4 end as SORT,
else 4 end as SORT,
2 as SORT1
2 as SORT1
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME,b.GROUP_TYPE
group by a.GROUP_NAME,b.GROUP_TYPE
...
@@ -121,9 +121,9 @@
...
@@ -121,9 +121,9 @@
else 4 end as SORT,
else 4 end as SORT,
3 as SORT1
3 as SORT1
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode# and b.DELETE_FLAG = 0
group by a.GROUP_NAME) a
group by a.GROUP_NAME) a
...
@@ -134,9 +134,9 @@
...
@@ -134,9 +134,9 @@
select a.GROUP_NAME,ifnull(GROUP_CONCAT(distinct PRDT_NAME SEPARATOR ','),'') as PART_NAME
select a.GROUP_NAME,ifnull(GROUP_CONCAT(distinct PRDT_NAME SEPARATOR ','),'') as PART_NAME
from (
from (
select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on a.GROUP_CODE = b.GROUP_CODE and b.REGISTER_DATE = #date# and b.DELETE_FLAG = 0
where a.COMPANY_CODE = #companyCode# and a.FACTORY_CODE = #factorycode#
where a.COMPANY_CODE = #companyCode# and a.FACTORY_CODE = #factorycode#
...
@@ -157,9 +157,9 @@
...
@@ -157,9 +157,9 @@
when right(a.GROUP_NAME,2) = '三组' then 3
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-','') and b.FACTORY_CODE = #factorycode#
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-','') and b.FACTORY_CODE = #factorycode#
...
@@ -175,9 +175,9 @@
...
@@ -175,9 +175,9 @@
when right(a.GROUP_NAME,2) = '三组' then 3
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-','') and b.FACTORY_CODE = #factorycode#
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-','') and b.FACTORY_CODE = #factorycode#
...
@@ -193,9 +193,9 @@
...
@@ -193,9 +193,9 @@
when right(a.GROUP_NAME,2) = '三组' then 3
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') and b.FACTORY_CODE = #factorycode#
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') and b.FACTORY_CODE = #factorycode#
...
@@ -211,9 +211,9 @@
...
@@ -211,9 +211,9 @@
when right(a.GROUP_NAME,2) = '三组' then 3
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-','') and b.FACTORY_CODE = #factorycode#
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 3 day),'-','') and b.FACTORY_CODE = #factorycode#
...
@@ -229,9 +229,9 @@
...
@@ -229,9 +229,9 @@
when right(a.GROUP_NAME,2) = '三组' then 3
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-','') and b.FACTORY_CODE = #factorycode#
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 2 day),'-','') and b.FACTORY_CODE = #factorycode#
...
@@ -247,9 +247,9 @@
...
@@ -247,9 +247,9 @@
when right(a.GROUP_NAME,2) = '三组' then 3
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode#and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode#and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-','') and b.FACTORY_CODE = #factorycode#
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 1 day),'-','') and b.FACTORY_CODE = #factorycode#
...
@@ -265,9 +265,9 @@
...
@@ -265,9 +265,9 @@
when right(a.GROUP_NAME,2) = '三组' then 3
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
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.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
join ${platSchema}.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode# and c.ORG_ID <![CDATA[ <> ]]> 'R24050801') a
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
left join ${hpjxSchema}.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode#
and b.REGISTER_DATE = #date# and b.FACTORY_CODE = #factorycode#