Commit e5670968 by liuyang

驾驶舱逻辑调整

parent 721e0f61
...@@ -173,13 +173,17 @@ ...@@ -173,13 +173,17 @@
</delete> </delete>
<select id="queryBySbStatus" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryBySbStatus" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select select distinct
a.DEVICE_CODE as "deviceCode", a.DEVICE_CODE as "deviceCode",
a.DEVICE_NAME as "deviceName", a.DEVICE_NAME as "deviceName",
a.DEVICE_MODEL as "deviceModel", a.DEVICE_MODEL as "deviceModel",
ifnull(c.LOG_VALUE, 0) as "status" ifnull(c.LOG_VALUE, 0) as "status"
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( inner join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
INNER join (
select EQUIPMENT_CODE, LOG_VALUE select EQUIPMENT_CODE, LOG_VALUE
from ${hggpSchema}.HGSB010 where EQUIPMENT_TYPE = 'STARUS_TYPE' from ${hggpSchema}.HGSB010 where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -202,9 +206,6 @@ ...@@ -202,9 +206,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
...@@ -212,7 +213,7 @@ ...@@ -212,7 +213,7 @@
</select> </select>
<select id="queryBySbYes" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryBySbYes" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select select distinct
a.DEVICE_CODE as "deviceCode", a.DEVICE_CODE as "deviceCode",
a.DEVICE_MODEL as "deviceModel", a.DEVICE_MODEL as "deviceModel",
a.DATE as "date", a.DATE as "date",
...@@ -224,10 +225,13 @@ ...@@ -224,10 +225,13 @@
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 7, 2)) as DATE, concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 7, 2)) as DATE,
ifnull(c.NUM, 0) NUM ifnull(c.NUM, 0) NUM
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
join (
select select
EQUIPMENT_CODE, EQUIPMENT_CODE, count(1) as NUM
count(1) as NUM
from ${hggpSchema}.HGSB010 from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -249,9 +253,6 @@ ...@@ -249,9 +253,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
...@@ -262,10 +263,13 @@ ...@@ -262,10 +263,13 @@
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 7, 2)) as DATE, concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 7, 2)) as DATE,
ifnull(c.NUM, 0) NUM ifnull(c.NUM, 0) NUM
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
join (
select select
EQUIPMENT_CODE, EQUIPMENT_CODE, count(1) as NUM
count(1) as NUM
from ${hggpSchema}.HGSB010 from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -286,9 +290,6 @@ ...@@ -286,9 +290,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
...@@ -299,10 +300,13 @@ ...@@ -299,10 +300,13 @@
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 7, 2)) as DATE, concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 7, 2)) as DATE,
ifnull(c.NUM, 0) NUM ifnull(c.NUM, 0) NUM
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
join (
select select
EQUIPMENT_CODE, EQUIPMENT_CODE, count(1) as NUM
count(1) as NUM
from ${hggpSchema}.HGSB010 from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -324,9 +328,6 @@ ...@@ -324,9 +328,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
...@@ -337,10 +338,13 @@ ...@@ -337,10 +338,13 @@
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 7, 2)) as DATE, concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 7, 2)) as DATE,
ifnull(c.NUM, 0) NUM ifnull(c.NUM, 0) NUM
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
join (
select select
EQUIPMENT_CODE, EQUIPMENT_CODE, count(1) as NUM
count(1) as NUM
from ${hggpSchema}.HGSB010 from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -361,9 +365,6 @@ ...@@ -361,9 +365,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
...@@ -374,10 +375,13 @@ ...@@ -374,10 +375,13 @@
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 7, 2)) as DATE, concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 7, 2)) as DATE,
ifnull(c.NUM, 0) NUM ifnull(c.NUM, 0) NUM
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
join (
select select
EQUIPMENT_CODE, EQUIPMENT_CODE, count(1) as NUM
count(1) as NUM
from ${hggpSchema}.HGSB010 from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -398,9 +402,6 @@ ...@@ -398,9 +402,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
...@@ -411,10 +412,13 @@ ...@@ -411,10 +412,13 @@
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 7, 2)) as DATE, concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 7, 2)) as DATE,
ifnull(c.NUM, 0) NUM ifnull(c.NUM, 0) NUM
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
join (
select select
EQUIPMENT_CODE, EQUIPMENT_CODE, count(1) as NUM
count(1) as NUM
from ${hggpSchema}.HGSB010 from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -435,9 +439,6 @@ ...@@ -435,9 +439,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
...@@ -448,10 +449,13 @@ ...@@ -448,10 +449,13 @@
right(replace(#date#, '-', ''), 4) as DATE, right(replace(#date#, '-', ''), 4) as DATE,
ifnull(c.NUM, 0) NUM ifnull(c.NUM, 0) NUM
from ${hggpSchema}.HGSB001 a from ${hggpSchema}.HGSB001 a
left join ( join ${platSchema}.TXSOG01 B ON A.ACCOUNT_CODE = B.ACCOUNT_CODE and a.GROUP_CODE = B.ORG_ID
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
join (
select select
EQUIPMENT_CODE, EQUIPMENT_CODE, count(1) as NUM
count(1) as NUM
from ${hggpSchema}.HGSB010 from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -472,9 +476,6 @@ ...@@ -472,9 +476,6 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode"> <isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode# a.DEVICE_CODE = #deviceCode#
</isNotEmpty> </isNotEmpty>
......
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