Commit e5670968 by liuyang

驾驶舱逻辑调整

parent 721e0f61
......@@ -173,13 +173,17 @@
</delete>
<select id="queryBySbStatus" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
select distinct
a.DEVICE_CODE as "deviceCode",
a.DEVICE_NAME as "deviceName",
a.DEVICE_MODEL as "deviceModel",
ifnull(c.LOG_VALUE, 0) as "status"
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
from ${hggpSchema}.HGSB010 where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -202,9 +206,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
......@@ -212,7 +213,7 @@
</select>
<select id="queryBySbYes" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
select distinct
a.DEVICE_CODE as "deviceCode",
a.DEVICE_MODEL as "deviceModel",
a.DATE as "date",
......@@ -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,
ifnull(c.NUM, 0) NUM
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
EQUIPMENT_CODE,
count(1) as NUM
EQUIPMENT_CODE, count(1) as NUM
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -249,9 +253,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
......@@ -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,
ifnull(c.NUM, 0) NUM
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
EQUIPMENT_CODE,
count(1) as NUM
EQUIPMENT_CODE, count(1) as NUM
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -286,9 +290,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
......@@ -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,
ifnull(c.NUM, 0) NUM
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
EQUIPMENT_CODE,
count(1) as NUM
EQUIPMENT_CODE, count(1) as NUM
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -324,9 +328,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
......@@ -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,
ifnull(c.NUM, 0) NUM
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
EQUIPMENT_CODE,
count(1) as NUM
EQUIPMENT_CODE, count(1) as NUM
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -361,9 +365,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
......@@ -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,
ifnull(c.NUM, 0) NUM
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
EQUIPMENT_CODE,
count(1) as NUM
EQUIPMENT_CODE, count(1) as NUM
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -398,9 +402,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
......@@ -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,
ifnull(c.NUM, 0) NUM
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
EQUIPMENT_CODE,
count(1) as NUM
EQUIPMENT_CODE, count(1) as NUM
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -435,9 +439,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
......@@ -448,10 +449,13 @@
right(replace(#date#, '-', ''), 4) as DATE,
ifnull(c.NUM, 0) NUM
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
EQUIPMENT_CODE,
count(1) as NUM
EQUIPMENT_CODE, count(1) as NUM
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -472,9 +476,6 @@
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</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