Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
89380ffe
Commit
89380ffe
authored
Jul 18, 2024
by
lilongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、全域、片区、风电场站、光伏场站健康状态指数与趋势,改成10分钟汇总
2、全域、片区各片区健康状态指数,改成10分钟汇总 3、风电场站风电站各设备状态、设备各分析变量预警、子系统状态指数,改成10分钟汇总 4、光伏场站风电站各子阵状态、设备各分析变量预警、子阵设备健康状态指数,改成10分钟汇总
parent
78a511f0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
792 additions
and
747 deletions
+792
-747
IPersonnelBusinessService.java
...ot/module/hygf/api/service/IPersonnelBusinessService.java
+2
-0
PersonnelBusinessController.java
...dule/hygf/biz/controller/PersonnelBusinessController.java
+13
-0
PersonnelBusinessServiceImpl.java
...e/hygf/biz/service/impl/PersonnelBusinessServiceImpl.java
+198
-176
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+2
-2
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+577
-569
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IPersonnelBusinessService.java
View file @
89380ffe
...
@@ -17,4 +17,6 @@ public interface IPersonnelBusinessService {
...
@@ -17,4 +17,6 @@ public interface IPersonnelBusinessService {
UserDataDto
getPersonnelBusinessById
(
String
id
);
UserDataDto
getPersonnelBusinessById
(
String
id
);
Object
deleteAllBySequenceNbr
(
Long
sequenceNbr
);
Object
deleteAllBySequenceNbr
(
Long
sequenceNbr
);
Boolean
deleteBySequenceNbrs
(
String
sequenceNbrs
);
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PersonnelBusinessController.java
View file @
89380ffe
...
@@ -108,6 +108,19 @@ public class PersonnelBusinessController extends BaseController {
...
@@ -108,6 +108,19 @@ public class PersonnelBusinessController extends BaseController {
}
}
/**
/**
* 根据sequenceNbrs批量删除
*
* @param sequenceNbrs 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/deleteDealerPerson"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbrs批量删除经销商人员信息"
,
notes
=
"根据sequenceNbrs批量删除经销商人员信息"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbrs
(
@RequestParam
(
value
=
"sequenceNbrs"
)
String
sequenceNbrs
){
return
ResponseHelper
.
buildResponse
(
personnelBusinessServiceImpl
.
deleteBySequenceNbrs
(
sequenceNbrs
));
}
/**
* 根据sequenceNbr查询
* 根据sequenceNbr查询
*
*
* @param sequenceNbr 主键
* @param sequenceNbr 主键
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PersonnelBusinessServiceImpl.java
View file @
89380ffe
...
@@ -27,6 +27,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...
@@ -27,6 +27,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -68,24 +70,27 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -68,24 +70,27 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
@Value
(
"${hygf.user.group.empty}"
)
@Value
(
"${hygf.user.group.empty}"
)
private
long
userGroupempty
;
private
long
userGroupempty
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
PersonnelBusinessServiceImpl
.
class
);
/**
/**
* 分页查询
* 分页查询
*/
*/
public
Page
<
PersonnelBusinessDto
>
queryForPersonnelBusinessPage
(
Page
<
PersonnelBusinessDto
>
page
)
{
public
Page
<
PersonnelBusinessDto
>
queryForPersonnelBusinessPage
(
Page
<
PersonnelBusinessDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
return
this
.
queryForPage
(
page
,
null
,
false
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
public
List
<
PersonnelBusinessDto
>
queryForPersonnelBusinessList
()
{
public
List
<
PersonnelBusinessDto
>
queryForPersonnelBusinessList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
@Override
@Override
public
IPage
<
CompanyDtoUserDto
>
getCompanyDtoUserDto
(
CompanyDtoUserDto
dto
)
{
public
IPage
<
CompanyDtoUserDto
>
getCompanyDtoUserDto
(
CompanyDtoUserDto
dto
)
{
Map
<
String
,
String
>
map
=
personnelBusinessMapper
.
getorgcode
(
dto
.
getAmosUnitId
());
Map
<
String
,
String
>
map
=
personnelBusinessMapper
.
getorgcode
(
dto
.
getAmosUnitId
());
dto
.
setAmosUnitOrgCode
(
map
.
get
(
"orgCode"
));
dto
.
setAmosUnitOrgCode
(
map
.
get
(
"orgCode"
));
IPage
<
CompanyDtoUserDto
>
pag
=
personnelBusinessMapper
.
getCompanyDtoUserDtopage
(
dto
);
IPage
<
CompanyDtoUserDto
>
pag
=
personnelBusinessMapper
.
getCompanyDtoUserDtopage
(
dto
);
...
@@ -93,11 +98,11 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -93,11 +98,11 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
}
@Transactional
@Transactional
public
void
savePersonnelBusiness
(
UserDataDto
model
)
{
public
void
savePersonnelBusiness
(
UserDataDto
model
)
{
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
//新增平台用户
//新增平台用户
try
{
try
{
// 1 创建平台用户
// 1 创建平台用户
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
...
@@ -114,13 +119,13 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -114,13 +119,13 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
new
HashMap
<>();
roleSeqMap
.
put
(
Long
.
valueOf
(
userDataJBDto
.
getAmosUnitId
()),
userDataZHDto
.
getRole
());
roleSeqMap
.
put
(
Long
.
valueOf
(
userDataJBDto
.
getAmosUnitId
()),
userDataZHDto
.
getRole
());
orgRoles
.
put
(
Long
.
valueOf
(
userDataJBDto
.
getAmosUnitId
()),
userRoleList
);
orgRoles
.
put
(
Long
.
valueOf
(
userDataJBDto
.
getAmosUnitId
()),
userRoleList
);
// agencyUserModel.setAppCodes(split);
// agencyUserModel.setAppCodes(split);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
// 将创建用户加入用户组
// 将创建用户加入用户组
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
userResult
.
getDevMessage
());
throw
new
BadRequest
(
"新增人员失败!"
+
userResult
.
getDevMessage
());
}
}
List
<
String
>
userId
=
new
ArrayList
<>();
List
<
String
>
userId
=
new
ArrayList
<>();
userId
.
add
(
userResult
.
getResult
().
getUserId
());
userId
.
add
(
userResult
.
getResult
().
getUserId
());
...
@@ -130,7 +135,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -130,7 +135,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
//新增人员基础信息表
//新增人员基础信息表
PublicAgencyUser
publicAgencyUser
=
new
PublicAgencyUser
();
PublicAgencyUser
publicAgencyUser
=
new
PublicAgencyUser
();
publicAgencyUser
.
setRealName
(
userDataJBDto
.
getRealName
());
publicAgencyUser
.
setRealName
(
userDataJBDto
.
getRealName
());
publicAgencyUser
.
setGender
(
userDataJBDto
.
getGender
());
publicAgencyUser
.
setGender
(
userDataJBDto
.
getGender
());
publicAgencyUser
.
setJobNumber
(
userDataJBDto
.
getJobNumber
());
publicAgencyUser
.
setJobNumber
(
userDataJBDto
.
getJobNumber
());
...
@@ -139,35 +144,35 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -139,35 +144,35 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
publicAgencyUser
.
setAmosId
(
userDataJBDto
.
getAmosUnitId
());
publicAgencyUser
.
setAmosId
(
userDataJBDto
.
getAmosUnitId
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
seleteOne
(
userDataJBDto
.
getAmosUnitId
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
seleteOne
(
userDataJBDto
.
getAmosUnitId
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult
.
getDevMessage
());
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult
.
getDevMessage
());
}
}
publicAgencyUser
.
setAmosOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
publicAgencyUser
.
setAmosOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
publicAgencyUser
.
setAmosUserId
(
userResult
.
getResult
().
getUserId
());
publicAgencyUser
.
setAmosUserId
(
userResult
.
getResult
().
getUserId
());
publicAgencyUser
.
setAmosUserName
(
userDataZHDto
.
getUserName
());
publicAgencyUser
.
setAmosUserName
(
userDataZHDto
.
getUserName
());
publicAgencyUser
.
setPassword
(
DesUtil
.
encode
(
userDataZHDto
.
getPassword
(),
secretKey
));
publicAgencyUser
.
setPassword
(
DesUtil
.
encode
(
userDataZHDto
.
getPassword
(),
secretKey
));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setLockStatus
(
"UNLOCK"
);
publicAgencyUser
.
setLockStatus
(
"UNLOCK"
);
publicAgencyUser
.
setLockTime
(
new
Date
());
publicAgencyUser
.
setLockTime
(
new
Date
());
publicAgencyUser
.
setHeight
(
userDataJBDto
.
getHeight
());
publicAgencyUser
.
setHeight
(
userDataJBDto
.
getHeight
());
publicAgencyUser
.
setWeight
(
userDataJBDto
.
getWeight
());
publicAgencyUser
.
setWeight
(
userDataJBDto
.
getWeight
());
publicAgencyUser
.
setEmergencyTelephone
(
userDataJBDto
.
getEmergencyTelephone
());
publicAgencyUser
.
setEmergencyTelephone
(
userDataJBDto
.
getEmergencyTelephone
());
publicAgencyUser
.
setDomicileAddress
(
userDataJBDto
.
getDomicileAddress
());
publicAgencyUser
.
setDomicileAddress
(
userDataJBDto
.
getDomicileAddress
());
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
()):
null
);
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
())
:
null
);
publicAgencyUser
.
setNowAddress
(
userDataJBDto
.
getNowAddress
());
publicAgencyUser
.
setNowAddress
(
userDataJBDto
.
getNowAddress
());
publicAgencyUser
.
setNativePlace
(
userDataJBDto
.
getNativePlace
());
publicAgencyUser
.
setNativePlace
(
userDataJBDto
.
getNativePlace
());
publicAgencyUser
.
setPoliticalOutlook
(
userDataJBDto
.
getPoliticalOutlook
());
publicAgencyUser
.
setPoliticalOutlook
(
userDataJBDto
.
getPoliticalOutlook
());
publicAgencyUserMapper
.
insert
(
publicAgencyUser
);
publicAgencyUserMapper
.
insert
(
publicAgencyUser
);
PersonnelBusiness
re
=
new
PersonnelBusiness
();
PersonnelBusiness
re
=
new
PersonnelBusiness
();
FeignClientResult
<
CompanyModel
>
companyResult1
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
FeignClientResult
<
CompanyModel
>
companyResult1
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult1
.
getDevMessage
());
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult1
.
getDevMessage
());
}
}
re
.
setRegionalCompaniesSeq
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
re
.
setRegionalCompaniesSeq
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
re
.
setRegionalCompaniesName
(
companyResult1
.
getResult
().
getCompanyName
());
re
.
setRegionalCompaniesName
(
companyResult1
.
getResult
().
getCompanyName
());
re
.
setRegionalCompaniesCode
(
companyResult1
.
getResult
().
getOrgCode
());
re
.
setRegionalCompaniesCode
(
companyResult1
.
getResult
().
getOrgCode
());
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
()):
null
);
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
())
:
null
);
re
.
setAmosUnitId
(
companyResult
.
getResult
().
getSequenceNbr
());
re
.
setAmosUnitId
(
companyResult
.
getResult
().
getSequenceNbr
());
re
.
setAmosUnitName
(
companyResult
.
getResult
().
getCompanyName
());
re
.
setAmosUnitName
(
companyResult
.
getResult
().
getCompanyName
());
re
.
setAmosUnitOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
re
.
setAmosUnitOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
...
@@ -176,8 +181,8 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -176,8 +181,8 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
personnelBusinessMapper
.
insert
(
re
);
personnelBusinessMapper
.
insert
(
re
);
//增加人员权限
//增加人员权限
List
<
String
>
lisk
=
new
ArrayList
<>();
List
<
String
>
lisk
=
new
ArrayList
<>();
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
lisk
.
add
(
re
.
getRegionalCompaniesCode
());
lisk
.
add
(
re
.
getRegionalCompaniesCode
());
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
...
@@ -186,10 +191,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -186,10 +191,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userEmpowerMapper
.
insert
(
stdUserEmpower
);
userEmpowerMapper
.
insert
(
stdUserEmpower
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
){
if
(
userResult
!=
null
&&
userResult
.
getResult
()
!=
null
if
(
userResult
!=
null
&&
userResult
.
getResult
()
!=
null
&&
StringUtils
.
isNotEmpty
(
userResult
.
getResult
().
getUserId
()))
{
&&
StringUtils
.
isNotEmpty
(
userResult
.
getResult
().
getUserId
()))
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
userResult
.
getResult
().
getUserId
());
Privilege
.
agencyUserClient
.
multDeleteUser
(
userResult
.
getResult
().
getUserId
());
...
@@ -202,20 +204,20 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -202,20 +204,20 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
@Transactional
@Transactional
public
void
updatePersonnelBusiness
(
UserDataDto
model
,
long
id
)
{
public
void
updatePersonnelBusiness
(
UserDataDto
model
,
long
id
)
{
PublicAgencyUser
publicAgencyUser
=
publicAgencyUserMapper
.
selectById
(
id
);
PublicAgencyUser
publicAgencyUser
=
publicAgencyUserMapper
.
selectById
(
id
);
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
try
{
try
{
List
<
Long
>
newRole
=
userDataZHDto
.
getRole
();
List
<
Long
>
newRole
=
userDataZHDto
.
getRole
();
List
<
Long
>
oldRole
=
JSONArray
.
parseArray
(
publicAgencyUser
.
getRole
(),
Long
.
class
);
List
<
Long
>
oldRole
=
JSONArray
.
parseArray
(
publicAgencyUser
.
getRole
(),
Long
.
class
);
for
(
Long
item
:
oldRole
)
{
for
(
Long
item
:
oldRole
)
{
if
(!
newRole
.
contains
(
item
))
{
if
(!
newRole
.
contains
(
item
))
{
throw
new
BadRequest
(
"角色只能增加, 不能删除"
);
throw
new
BadRequest
(
"角色只能增加, 不能删除"
);
}
}
}
}
...
@@ -238,9 +240,9 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -238,9 +240,9 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
// 将创建用户加入用户组
// 将创建用户加入用户组
userResult
=
Privilege
.
agencyUserClient
.
update
(
agencyUserModel
,
publicAgencyUser
.
getAmosUserId
());
userResult
=
Privilege
.
agencyUserClient
.
update
(
agencyUserModel
,
publicAgencyUser
.
getAmosUserId
());
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
userResult
.
getDevMessage
());
throw
new
BadRequest
(
"修改人员失败!"
+
userResult
.
getDevMessage
());
}
}
List
<
String
>
userId
=
new
ArrayList
<>();
List
<
String
>
userId
=
new
ArrayList
<>();
userId
.
add
(
userResult
.
getResult
().
getUserId
());
userId
.
add
(
userResult
.
getResult
().
getUserId
());
...
@@ -258,56 +260,56 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -258,56 +260,56 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
publicAgencyUser
.
setAmosId
(
userDataJBDto
.
getAmosUnitId
());
publicAgencyUser
.
setAmosId
(
userDataJBDto
.
getAmosUnitId
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
seleteOne
(
userDataJBDto
.
getAmosUnitId
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
seleteOne
(
userDataJBDto
.
getAmosUnitId
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult
.
getDevMessage
());
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult
.
getDevMessage
());
}
}
publicAgencyUser
.
setAmosOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
publicAgencyUser
.
setAmosOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
publicAgencyUser
.
setAmosUserName
(
userDataZHDto
.
getUserName
());
publicAgencyUser
.
setAmosUserName
(
userDataZHDto
.
getUserName
());
publicAgencyUser
.
setPassword
(
DesUtil
.
encode
(
userDataZHDto
.
getPassword
(),
secretKey
));
publicAgencyUser
.
setPassword
(
DesUtil
.
encode
(
userDataZHDto
.
getPassword
(),
secretKey
));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setLockStatus
(
"UNLOCK"
);
publicAgencyUser
.
setLockStatus
(
"UNLOCK"
);
publicAgencyUser
.
setLockTime
(
new
Date
());
publicAgencyUser
.
setLockTime
(
new
Date
());
publicAgencyUser
.
setHeight
(
userDataJBDto
.
getHeight
());
publicAgencyUser
.
setHeight
(
userDataJBDto
.
getHeight
());
publicAgencyUser
.
setWeight
(
userDataJBDto
.
getWeight
());
publicAgencyUser
.
setWeight
(
userDataJBDto
.
getWeight
());
publicAgencyUser
.
setEmergencyTelephone
(
userDataJBDto
.
getEmergencyTelephone
());
publicAgencyUser
.
setEmergencyTelephone
(
userDataJBDto
.
getEmergencyTelephone
());
publicAgencyUser
.
setDomicileAddress
(
userDataJBDto
.
getDomicileAddress
());
publicAgencyUser
.
setDomicileAddress
(
userDataJBDto
.
getDomicileAddress
());
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
()):
null
);
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
())
:
null
);
publicAgencyUser
.
setNowAddress
(
userDataJBDto
.
getNowAddress
());
publicAgencyUser
.
setNowAddress
(
userDataJBDto
.
getNowAddress
());
publicAgencyUser
.
setNativePlace
(
userDataJBDto
.
getNativePlace
());
publicAgencyUser
.
setNativePlace
(
userDataJBDto
.
getNativePlace
());
publicAgencyUser
.
setPoliticalOutlook
(
userDataJBDto
.
getPoliticalOutlook
());
publicAgencyUser
.
setPoliticalOutlook
(
userDataJBDto
.
getPoliticalOutlook
());
publicAgencyUserMapper
.
updateById
(
publicAgencyUser
);
publicAgencyUserMapper
.
updateById
(
publicAgencyUser
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUser
.
getSequenceNbr
());
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUser
.
getSequenceNbr
());
PersonnelBusiness
re
=
personnelBusinessMapper
.
selectOne
(
qug
);
PersonnelBusiness
re
=
personnelBusinessMapper
.
selectOne
(
qug
);
FeignClientResult
<
CompanyModel
>
companyResult1
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
FeignClientResult
<
CompanyModel
>
companyResult1
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult1
.
getDevMessage
());
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult1
.
getDevMessage
());
}
}
re
.
setRegionalCompaniesSeq
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
re
.
setRegionalCompaniesSeq
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
re
.
setRegionalCompaniesName
(
companyResult1
.
getResult
().
getCompanyName
());
re
.
setRegionalCompaniesName
(
companyResult1
.
getResult
().
getCompanyName
());
re
.
setRegionalCompaniesCode
(
companyResult1
.
getResult
().
getOrgCode
());
re
.
setRegionalCompaniesCode
(
companyResult1
.
getResult
().
getOrgCode
());
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
()):
null
);
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
())
:
null
);
re
.
setAmosUnitId
(
companyResult
.
getResult
().
getSequenceNbr
());
re
.
setAmosUnitId
(
companyResult
.
getResult
().
getSequenceNbr
());
re
.
setAmosUnitName
(
companyResult
.
getResult
().
getCompanyName
());
re
.
setAmosUnitName
(
companyResult
.
getResult
().
getCompanyName
());
re
.
setAmosUnitOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
re
.
setAmosUnitOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
personnelBusinessMapper
.
updateById
(
re
);
personnelBusinessMapper
.
updateById
(
re
);
//增加人员权限
//增加人员权限
List
<
String
>
lisk
=
new
ArrayList
<>();
List
<
String
>
lisk
=
new
ArrayList
<>();
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUser
.
getAmosUserId
());
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUser
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
// lisk.add(publicAgencyUser.getAmosOrgCode());
// lisk.add(publicAgencyUser.getAmosOrgCode());
lisk
.
add
(
re
.
getRegionalCompaniesCode
());
lisk
.
add
(
re
.
getRegionalCompaniesCode
());
if
(
stdUserEmpower
!=
null
)
{
if
(
stdUserEmpower
!=
null
)
{
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
stdUserEmpower
.
setAmosOrgCode
(
lisk
);
stdUserEmpower
.
setAmosOrgCode
(
lisk
);
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
}
else
{
}
else
{
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
stdUserEmpower
.
setAmosOrgCode
(
lisk
);
stdUserEmpower
.
setAmosOrgCode
(
lisk
);
stdUserEmpower
.
setPermissionType
(
"HYGF"
);
stdUserEmpower
.
setPermissionType
(
"HYGF"
);
...
@@ -315,11 +317,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -315,11 +317,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
e
.
getMessage
());
throw
new
BadRequest
(
e
.
getMessage
());
...
@@ -328,48 +326,40 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -328,48 +326,40 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
}
@Transactional
@Transactional
public
void
replace
(
String
id
){
public
void
replace
(
String
id
)
{
try
{
try
{
//获取当前用户
//获取当前用户
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
personnelBusines
.
setUserType
(
"2"
);
personnelBusines
.
setUserType
(
"2"
);
personnelBusinessMapper
.
updateById
(
personnelBusines
);
personnelBusinessMapper
.
updateById
(
personnelBusines
);
//获取经销商管理员
//获取经销商管理员
LambdaQueryWrapper
<
UnitInfo
>
qudg
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
UnitInfo
>
qudg
=
new
LambdaQueryWrapper
<>();
qudg
.
eq
(
UnitInfo:
:
getAmosCompanySeq
,
personnelBusines
.
getAmosDealerId
());
qudg
.
eq
(
UnitInfo:
:
getAmosCompanySeq
,
personnelBusines
.
getAmosDealerId
());
UnitInfo
unitInfo
=
unitInfoMapper
.
selectOne
(
qudg
);
UnitInfo
unitInfo
=
unitInfoMapper
.
selectOne
(
qudg
);
LambdaQueryWrapper
<
PublicAgencyUser
>
qudx
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PublicAgencyUser
>
qudx
=
new
LambdaQueryWrapper
<>();
qudx
.
eq
(
PublicAgencyUser:
:
getAmosUserId
,
unitInfo
.
getAdminUserId
());
qudx
.
eq
(
PublicAgencyUser:
:
getAmosUserId
,
unitInfo
.
getAdminUserId
());
PublicAgencyUser
publicAgencyUsex
=
publicAgencyUserMapper
.
selectOne
(
qudx
);
PublicAgencyUser
publicAgencyUsex
=
publicAgencyUserMapper
.
selectOne
(
qudx
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qugf
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PersonnelBusiness
>
qugf
=
new
LambdaQueryWrapper
<>();
qugf
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUsex
.
getSequenceNbr
());
qugf
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUsex
.
getSequenceNbr
());
PersonnelBusiness
personnelBusinesx
=
personnelBusinessMapper
.
selectOne
(
qugf
);
PersonnelBusiness
personnelBusinesx
=
personnelBusinessMapper
.
selectOne
(
qugf
);
personnelBusinesx
.
setUserType
(
"1"
);
personnelBusinesx
.
setUserType
(
"1"
);
personnelBusinessMapper
.
updateById
(
personnelBusinesx
);
personnelBusinessMapper
.
updateById
(
personnelBusinesx
);
unitInfo
.
setAdminLoginName
(
publicAgencyUse
.
getAmosUserName
());
unitInfo
.
setAdminLoginName
(
publicAgencyUse
.
getAmosUserName
());
unitInfo
.
setAdminPhone
(
publicAgencyUse
.
getEmergencyTelephone
());
unitInfo
.
setAdminPhone
(
publicAgencyUse
.
getEmergencyTelephone
());
unitInfo
.
setAdminUserId
(
publicAgencyUse
.
getAmosUserId
());
unitInfo
.
setAdminUserId
(
publicAgencyUse
.
getAmosUserId
());
unitInfo
.
setAdminUserName
(
publicAgencyUse
.
getRealName
());
unitInfo
.
setAdminUserName
(
publicAgencyUse
.
getRealName
());
unitInfoMapper
.
updateById
(
unitInfo
);
unitInfoMapper
.
updateById
(
unitInfo
);
//修改管理员
//修改管理员
List
<
Long
>
roidx
=
JSONArray
.
parseArray
(
publicAgencyUsex
.
getRole
(),
Long
.
class
);
List
<
Long
>
roidx
=
JSONArray
.
parseArray
(
publicAgencyUsex
.
getRole
(),
Long
.
class
);
//修改平台用户
//修改平台用户
...
@@ -377,43 +367,42 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -377,43 +367,42 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userId
.
add
(
publicAgencyUse
.
getAmosUserId
());
userId
.
add
(
publicAgencyUse
.
getAmosUserId
());
System
.
out
.
println
(
"删除旧管理员===================================:"
+
publicAgencyUsex
.
getAmosUserId
());
System
.
out
.
println
(
"删除旧管理员===================================:"
+
publicAgencyUsex
.
getAmosUserId
());
List
<
String
>
userId1
=
new
ArrayList
<>();
List
<
String
>
userId1
=
new
ArrayList
<>();
if
(
roidx
!=
null
&&!
roidx
.
isEmpty
()&&
roidx
.
size
()==
1
&&
roidx
.
get
(
0
).
longValue
()==
userGroupId
)
{
if
(
roidx
!=
null
&&
!
roidx
.
isEmpty
()
&&
roidx
.
size
()
==
1
&&
roidx
.
get
(
0
).
longValue
()
==
userGroupId
)
{
//新增空角色防止单位丢失
//新增空角色防止单位丢失
userId1
.
add
(
publicAgencyUsex
.
getAmosUserId
());
userId1
.
add
(
publicAgencyUsex
.
getAmosUserId
());
Privilege
.
groupUserClient
.
create
(
userGroupempty
,
userId1
);
Privilege
.
groupUserClient
.
create
(
userGroupempty
,
userId1
);
}
}
//删除旧管理员
//删除旧管理员
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupId
,
publicAgencyUsex
.
getAmosUserId
());
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupId
,
publicAgencyUsex
.
getAmosUserId
());
// 1 修改平台用户
// 1 修改平台用户
Privilege
.
groupUserClient
.
create
(
userGroupId
,
userId
);
Privilege
.
groupUserClient
.
create
(
userGroupId
,
userId
);
System
.
out
.
println
(
"新增角色用户===================================:"
+
userId
);
System
.
out
.
println
(
"新增角色用户===================================:"
+
userId
);
//修改权限
//修改权限
if
(
roidx
==
null
)
{
if
(
roidx
==
null
)
{
publicAgencyUsex
.
setRole
(
null
);
publicAgencyUsex
.
setRole
(
null
);
}
else
{
}
else
{
roidx
.
remove
(
userGroupId
);
roidx
.
remove
(
userGroupId
);
publicAgencyUsex
.
setRole
(
CollectionUtil
.
isEmpty
(
roidx
)
?
JSON
.
toJSONString
(
Arrays
.
asList
(
userGroupempty
)):
JSON
.
toJSONString
(
roidx
));
publicAgencyUsex
.
setRole
(
CollectionUtil
.
isEmpty
(
roidx
)
?
JSON
.
toJSONString
(
Arrays
.
asList
(
userGroupempty
))
:
JSON
.
toJSONString
(
roidx
));
}
}
//修改当前用户角色权限
//修改当前用户角色权限
List
<
Long
>
roid
=
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
Long
.
class
);
List
<
Long
>
roid
=
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
Long
.
class
);
if
(
roid
==
null
)
{
if
(
roid
==
null
)
{
roid
=
new
ArrayList
<>();
roid
=
new
ArrayList
<>();
}
}
roid
.
add
(
userGroupId
);
roid
.
add
(
userGroupId
);
if
(
roid
.
contains
(
userGroupempty
)){
if
(
roid
.
contains
(
userGroupempty
))
{
roid
.
remove
(
userGroupempty
);
roid
.
remove
(
userGroupempty
);
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupempty
,
publicAgencyUsex
.
getAmosUserId
());
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupempty
,
publicAgencyUsex
.
getAmosUserId
());
}
}
publicAgencyUse
.
setRole
(
JSON
.
toJSONString
(
roid
));
publicAgencyUse
.
setRole
(
JSON
.
toJSONString
(
roid
));
...
@@ -421,58 +410,51 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -421,58 +410,51 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
publicAgencyUserMapper
.
updateById
(
publicAgencyUse
);
publicAgencyUserMapper
.
updateById
(
publicAgencyUse
);
//旧管理员去除
List
<
String
>
li
=
null
;
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUsex
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
li
=
stdUserEmpower
.
getAmosOrgCode
();
if
(
stdUserEmpower
!=
null
)
{
stdUserEmpower
.
setAmosOrgCode
(
null
);
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
}
else
{
//旧管理员去除
stdUserEmpower
=
new
StdUserEmpower
();
List
<
String
>
li
=
null
;
stdUserEmpower
.
setAmosOrgCode
(
null
);
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
stdUserEmpower
.
setPermissionType
(
"HYGF"
);
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUsex
.
getAmosUserId
());
stdUserEmpower
.
setAmosUserId
(
publicAgencyUsex
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
userEmpowerMapper
.
insert
(
stdUserEmpower
);
li
=
stdUserEmpower
.
getAmosOrgCode
();
}
if
(
stdUserEmpower
!=
null
){
stdUserEmpower
.
setAmosOrgCode
(
null
);
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
}
else
{
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setAmosOrgCode
(
null
);
stdUserEmpower
.
setPermissionType
(
"HYGF"
);
stdUserEmpower
.
setAmosUserId
(
publicAgencyUsex
.
getAmosUserId
());
userEmpowerMapper
.
insert
(
stdUserEmpower
);
}
//新管理员新增
LambdaQueryWrapper
<
StdUserEmpower
>
uo1
=
new
LambdaQueryWrapper
();
uo1
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUse
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower1
=
userEmpowerMapper
.
selectOne
(
uo1
);
if
(
stdUserEmpower1
!=
null
){
//新管理员新增
stdUserEmpower1
.
setAmosOrgCode
(
li
);
LambdaQueryWrapper
<
StdUserEmpower
>
uo1
=
new
LambdaQueryWrapper
();
userEmpowerMapper
.
updateById
(
stdUserEmpower1
);
uo1
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUse
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower1
=
userEmpowerMapper
.
selectOne
(
uo1
);
}
else
{
stdUserEmpower1
=
new
StdUserEmpower
();
stdUserEmpower1
.
setAmosOrgCode
(
li
);
stdUserEmpower1
.
setPermissionType
(
"HYGF"
);
stdUserEmpower1
.
setAmosUserId
(
publicAgencyUse
.
getAmosUserId
());
userEmpowerMapper
.
insert
(
stdUserEmpower1
);
}
if
(
stdUserEmpower1
!=
null
)
{
stdUserEmpower1
.
setAmosOrgCode
(
li
);
userEmpowerMapper
.
updateById
(
stdUserEmpower1
);
}
else
{
stdUserEmpower1
=
new
StdUserEmpower
();
stdUserEmpower1
.
setAmosOrgCode
(
li
);
stdUserEmpower1
.
setPermissionType
(
"HYGF"
);
stdUserEmpower1
.
setAmosUserId
(
publicAgencyUse
.
getAmosUserId
());
userEmpowerMapper
.
insert
(
stdUserEmpower1
);
}
UserMessage
userMessage
=
new
UserMessage
(
TaskTypeStationEnum
.
设置管理员
.
getCode
(),
personnelBusines
.
getSequenceNbr
()
,
publicAgencyUse
.
getAmosUserId
(),
new
Date
(),
"您已成为单位管理员。"
,
personnelBusines
.
getAmosUnitOrgCode
());
UserMessage
userMessage
=
new
UserMessage
(
TaskTypeStationEnum
.
设置管理员
.
getCode
(),
personnelBusines
.
getSequenceNbr
(),
publicAgencyUse
.
getAmosUserId
(),
new
Date
(),
"您已成为单位管理员。"
,
personnelBusines
.
getAmosUnitOrgCode
());
userMessageMapper
.
insert
(
userMessage
);
userMessageMapper
.
insert
(
userMessage
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
BadRequest
(
"设置失败!"
);
throw
new
BadRequest
(
"设置失败!"
);
}
}
...
@@ -480,27 +462,27 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -480,27 +462,27 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
@Override
@Override
public
UserDataDto
getPersonnelBusinessById
(
String
id
)
{
public
UserDataDto
getPersonnelBusinessById
(
String
id
)
{
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
UserDataZHDto
userDataZHDto
=
new
UserDataZHDto
();
UserDataZHDto
userDataZHDto
=
new
UserDataZHDto
();
UserDataJBDto
userDataJBDto
=
new
UserDataJBDto
();
UserDataJBDto
userDataJBDto
=
new
UserDataJBDto
();
UserDataZZDto
userDataZZDto
=
new
UserDataZZDto
();
UserDataZZDto
userDataZZDto
=
new
UserDataZZDto
();
userDataZZDto
.
setCertificate
(
personnelBusines
.
getCertificate
()
!=
null
?
JSONArray
.
parseArray
(
personnelBusines
.
getCertificate
(),
JSONObject
.
class
):
null
);
userDataZZDto
.
setCertificate
(
personnelBusines
.
getCertificate
()
!=
null
?
JSONArray
.
parseArray
(
personnelBusines
.
getCertificate
(),
JSONObject
.
class
)
:
null
);
userDataZHDto
.
setRole
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
long
.
class
));
userDataZHDto
.
setRole
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
long
.
class
));
userDataZHDto
.
setUserName
(
publicAgencyUse
.
getAmosUserName
());
userDataZHDto
.
setUserName
(
publicAgencyUse
.
getAmosUserName
());
BeanUtils
.
copyProperties
(
publicAgencyUse
,
userDataJBDto
);
BeanUtils
.
copyProperties
(
publicAgencyUse
,
userDataJBDto
);
userDataJBDto
.
setPosition
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getPosition
(),
String
.
class
));
userDataJBDto
.
setPosition
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getPosition
(),
String
.
class
));
userDataJBDto
.
setRegionalCompaniesSeq
(
personnelBusines
.
getRegionalCompaniesSeq
()
!=
null
?
personnelBusines
.
getRegionalCompaniesSeq
().
toString
():
null
);
userDataJBDto
.
setRegionalCompaniesSeq
(
personnelBusines
.
getRegionalCompaniesSeq
()
!=
null
?
personnelBusines
.
getRegionalCompaniesSeq
().
toString
()
:
null
);
userDataJBDto
.
setAmosUnitId
(
personnelBusines
.
getAmosUnitId
());
userDataJBDto
.
setAmosUnitId
(
personnelBusines
.
getAmosUnitId
());
Boolean
hasOperationRecords
=
hasOperationRecords
(
id
);
Boolean
hasOperationRecords
=
hasOperationRecords
(
id
);
...
@@ -517,17 +499,16 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -517,17 +499,16 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userDataJBDto
.
setUnallowModify
(
hasOperationRecords
?
"unallow"
:
"allow"
);
userDataJBDto
.
setUnallowModify
(
hasOperationRecords
?
"unallow"
:
"allow"
);
}
}
return
new
UserDataDto
(
userDataZHDto
,
userDataJBDto
,
userDataZZDto
);
return
new
UserDataDto
(
userDataZHDto
,
userDataJBDto
,
userDataZZDto
);
}
}
/**
/**
* 用户是否有业务操作
* 用户是否有业务操作
*
*
*
* @param id id
* @param id id
* @return {@link Boolean}
* @return {@link Boolean}
* @author yangyang
* @throws
* @throws
* @author yangyang
* @date 2024/7/3 16:24
* @date 2024/7/3 16:24
*/
*/
public
Boolean
hasOperationRecords
(
String
id
)
{
public
Boolean
hasOperationRecords
(
String
id
)
{
...
@@ -598,4 +579,44 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -598,4 +579,44 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
}
@Override
public
Boolean
deleteBySequenceNbrs
(
String
sequenceNbrs
)
{
//根据sequenceNbr查询用户userId
if
(
StringUtils
.
isEmpty
(
sequenceNbrs
))
{
throw
new
BadRequest
(
"入参:sequenceNbrs为空"
);
}
List
<
String
>
sequenceNbrList
=
new
ArrayList
<>();
String
[]
sequenceNbrArray
=
sequenceNbrs
.
split
(
","
);
for
(
String
sequenceNbr
:
sequenceNbrArray
)
{
String
userId
=
personnelBusinessMapper
.
selectUserInfo
(
Long
.
valueOf
(
sequenceNbr
));
//添加校验,如果业务表里面有相关的用户id不能删除
List
<
String
>
tableName
=
personnelBusinessMapper
.
selectHygfTableName
();
if
(
CollectionUtil
.
isNotEmpty
(
tableName
))
{
for
(
String
table
:
tableName
)
{
int
count
=
personnelBusinessMapper
.
countByUserId
(
table
,
userId
);
if
(
count
>
0
)
{
logger
.
error
(
"sequenceNbr:{}对应的用户:{},对应的表:{}有操作记录无法删除"
,
sequenceNbr
,
userId
,
table
);
sequenceNbrList
.
add
(
sequenceNbr
);
return
false
;
}
}
}
try
{
//删除平台表账号
Privilege
.
agencyUserClient
.
multDeleteUser
(
userId
);
personnelBusinessMapper
.
deleteSubByUserId
(
userId
);
//删除hygf_personnel_business表中数据
personnelBusinessMapper
.
deleteHpbByFoundationId
(
Long
.
valueOf
(
sequenceNbr
));
//删除std_user_empower表中数据
personnelBusinessMapper
.
deleteSueByUserId
(
userId
);
return
null
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"sequenceNbr:{}对应删除失败"
,
sequenceNbr
);
sequenceNbrList
.
add
(
sequenceNbr
);
}
}
return
true
;
}
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
89380ffe
...
@@ -176,7 +176,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -176,7 +176,7 @@ public class TDBigScreenAnalyseController extends BaseController {
String
finalStationCode
=
stationCode
;
String
finalStationCode
=
stationCode
;
// List<String> dateList = dateInfoBy15.stream().map(i -> i.get("date")).collect(Collectors.toList());
// List<String> dateList = dateInfoBy15.stream().map(i -> i.get("date")).collect(Collectors.toList());
String
finalAreaCode
=
areaCode
;
String
finalAreaCode
=
areaCode
;
if
((
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
)
||
analysisType
==
null
))
{
if
((
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
)))
{
List
<
String
>
fullDateList
=
dateList
.
stream
().
map
(
s
->
{
List
<
String
>
fullDateList
=
dateList
.
stream
().
map
(
s
->
{
return
s
+
" 00:00:00"
;
return
s
+
" 00:00:00"
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -198,7 +198,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -198,7 +198,7 @@ public class TDBigScreenAnalyseController extends BaseController {
String
value
=
map
.
get
(
date
)
!=
null
?
String
.
valueOf
(
map
.
get
(
date
))
:
"100"
;
String
value
=
map
.
get
(
date
)
!=
null
?
String
.
valueOf
(
map
.
get
(
date
))
:
"100"
;
valueList
.
add
(
String
.
valueOf
(
Math
.
round
(
Double
.
valueOf
(
value
)
*
10.0
)
/
10.0
));
valueList
.
add
(
String
.
valueOf
(
Math
.
round
(
Double
.
valueOf
(
value
)
*
10.0
)
/
10.0
));
}
}
}
else
if
(
WarningPeriodEnum
.
MINUTES
.
getName
().
equals
(
analysisType
))
{
}
else
if
(
WarningPeriodEnum
.
MINUTES
.
getName
().
equals
(
analysisType
)
||
analysisType
==
null
)
{
List
<
Map
<
String
,
Object
>>
healthListInfo
=
fanHealthIndexMapper
.
getInfoByMoment
(
finalAreaCode
,
List
<
Map
<
String
,
Object
>>
healthListInfo
=
fanHealthIndexMapper
.
getInfoByMoment
(
finalAreaCode
,
finalStationCode
,
dateList
);
finalStationCode
,
dateList
);
Map
<
String
,
Object
>
map
=
healthListInfo
.
stream
().
collect
(
Collectors
Map
<
String
,
Object
>
map
=
healthListInfo
.
stream
().
collect
(
Collectors
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
89380ffe
...
@@ -129,96 +129,97 @@
...
@@ -129,96 +129,97 @@
FROM
FROM
${tableName}
${tableName}
<where>
<where>
ANALYSIS_TYPE = '按
天
'
ANALYSIS_TYPE = '按
10分钟
'
<!-- AND DATE_ADD(DATE_FORMAT( REC_DATE, '%Y-%m-%d' ),INTERVAL 1 DAY) = CURRENT_DATE-->
<!-- AND DATE_ADD(DATE_FORMAT( REC_DATE, '%Y-%m-%d' ),INTERVAL 1 DAY) = CURRENT_DATE-->
AND CURRENT_DATE = get_time_add(1,'DAY')
<!-- AND CURRENT_DATE = get_time_add(1,'DAY')-->
<if
test=
"stationCode != null and stationCode != ''"
>
AND REC_DATE >= get_time_sub(9,'MINUTE')
AND GATEWAY_ID = #{stationCode}
<if
test=
"stationCode != null and stationCode != ''"
>
AND ANALYSIS_OBJ_TYPE = '场站'
AND GATEWAY_ID = #{stationCode}
</if>
AND ANALYSIS_OBJ_TYPE = '场站'
</where>
</if>
limit 1
</where>
</select>
limit 1
<select
id=
"getHealthListInfo"
resultType=
"java.util.Map"
>
</select>
SELECT
<select
id=
"getHealthListInfo"
resultType=
"java.util.Map"
>
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
SELECT
DATE_ADD( a.date, INTERVAL - 1 DAY ) as date
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
FROM
DATE_ADD( a.date, INTERVAL - 1 DAY ) as date
(
FROM
SELECT
(
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
SELECT
@s := @s + 1 AS `index`
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
FROM
@s := @s + 1 AS `index`
mysql.help_topic,
FROM
( SELECT @s := 1 ) temp
mysql.help_topic,
WHERE
( SELECT @s := 1 ) temp
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 15 DAY )) ) >= @s
WHERE
) a
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 15 DAY )) ) >= @s
LEFT JOIN (
) a
SELECT
LEFT JOIN (
HEALTH_INDEX,
SELECT
DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) AS recDate
HEALTH_INDEX,
FROM
DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) AS recDate
idx_biz_pv_health_index
FROM
<where>
idx_biz_pv_health_index
ANALYSIS_TYPE = '按天'
<where>
<if
test=
"areaCode != null and areaCode != ''"
>
ANALYSIS_TYPE = '按天'
AND ARAE like concat('%', #{areaCode}, '%')
<if
test=
"areaCode != null and areaCode != ''"
>
AND ANALYSIS_OBJ_TYPE = '片区'
AND ARAE like concat('%', #{areaCode}, '%')
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"stationCode != null and stationCode != ''"
>
</if>
AND GATEWAY_ID = #{stationCode}
<if
test=
"stationCode != null and stationCode != ''"
>
AND ANALYSIS_OBJ_TYPE = '场站'
AND GATEWAY_ID = #{stationCode}
</if>
AND ANALYSIS_OBJ_TYPE = '场站'
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
</if>
AND GATEWAY_ID IN
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
AND GATEWAY_ID IN
${item}
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
</foreach>
${item}
</if>
</foreach>
</where>
</if>
UNION ALL
</where>
(
UNION ALL
SELECT
(
HEALTH_INDEX,
SELECT
DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) AS recDate
HEALTH_INDEX,
FROM
DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) AS recDate
idx_biz_fan_health_index
FROM
<where>
idx_biz_fan_health_index
ANALYSIS_TYPE = '按天'
<where>
<if
test=
"areaCode != null and areaCode != ''"
>
ANALYSIS_TYPE = '按天'
AND ARAE like concat('%', #{areaCode}, '%')
<if
test=
"areaCode != null and areaCode != ''"
>
AND ANALYSIS_OBJ_TYPE = '片区'
AND ARAE like concat('%', #{areaCode}, '%')
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"stationCode != null and stationCode != ''"
>
</if>
AND GATEWAY_ID = #{stationCode}
<if
test=
"stationCode != null and stationCode != ''"
>
AND ANALYSIS_OBJ_TYPE = '场站'
AND GATEWAY_ID = #{stationCode}
</if>
AND ANALYSIS_OBJ_TYPE = '场站'
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
</if>
AND GATEWAY_ID IN
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
AND GATEWAY_ID IN
#{item}
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
</foreach>
#{item}
</if>
</foreach>
</where>
</if>
)
</where>
) b ON DATE_FORMAT( b.recDate, '%Y-%m-%d' ) = a.date
)
GROUP BY
) b ON DATE_FORMAT( b.recDate, '%Y-%m-%d' ) = a.date
a.date
GROUP BY
</select>
a.date
<select
id=
"getAllEquipAlarmInfo"
resultType=
"java.util.Map"
>
</select>
SELECT ARAE as area,
<select
id=
"getAllEquipAlarmInfo"
resultType=
"java.util.Map"
>
WARNING_NAME as warningName,
SELECT ARAE as area,
count(1) as num
WARNING_NAME as warningName,
FROM ${tableName} a
count(1) as num
where (a.DISPOSOTION_STATE = '待确认')
FROM ${tableName} a
<!-- or (a.DISPOSOTION_STATE = '已确认' and a.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))-->
where (a.DISPOSOTION_STATE = '待确认')
<!-- or (a.DISPOSOTION_STATE = '已确认' and a.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))-->
or (a.DISPOSOTION_STATE = '已确认' and a.DISPOSOTION_DATE > get_time_sub(3,'DAY')
or (a.DISPOSOTION_STATE = '已确认' and a.DISPOSOTION_DATE > get_time_sub(3,'DAY')
group by ARAE,
group by ARAE,
WARNING_NAME
WARNING_NAME
...
@@ -231,35 +232,37 @@
...
@@ -231,35 +232,37 @@
ARAE
ARAE
FROM fan_health_index_latest_data
FROM fan_health_index_latest_data
WHERE ANALYSIS_OBJ_TYPE = '片区'
WHERE ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
GROUP BY ARAE
AND REC_DATE >= get_time_sub(9,'MINUTE')
UNION ALL
GROUP BY ARAE
(
UNION ALL
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
(
ARAE
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
FROM pv_health_index_latest_data
ARAE
WHERE ANALYSIS_OBJ_TYPE = '片区'
FROM pv_health_index_latest_data
AND ANALYSIS_TYPE = '按天'
WHERE ANALYSIS_OBJ_TYPE = '片区'
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
AND ANALYSIS_TYPE = '按10分钟'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
GROUP BY ARAE
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
)
AND REC_DATE >= get_time_sub(9,'MINUTE')
) a
GROUP BY ARAE
GROUP BY a.ARAE
)
</select>
) a
<select
id=
"getAllEquipAlarmInfoByStation"
resultType=
"java.util.Map"
>
GROUP BY a.ARAE
SELECT a.*
</select>
FROM (
<select
id=
"getAllEquipAlarmInfoByStation"
resultType=
"java.util.Map"
>
SELECT STATION AS station,
SELECT a.*
WARNING_NAME AS warningName,
FROM (
count(1) AS num,
SELECT STATION AS station,
(SELECT count(1)
WARNING_NAME AS warningName,
FROM idx_biz_fan_warning_record wr
count(1) AS num,
WHERE ((wr.DISPOSOTION_STATE = '待确认')
(SELECT count(1)
or (wr.DISPOSOTION_STATE = '已确认' and
FROM idx_biz_fan_warning_record wr
<!--wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))-->
WHERE ((wr.DISPOSOTION_STATE = '待确认')
or (wr.DISPOSOTION_STATE = '已确认' and
<!--wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))-->
wr.DISPOSOTION_DATE > get_time_sub(3,'DAY')
wr.DISPOSOTION_DATE > get_time_sub(3,'DAY')
AND wr.STATION = STATION
AND wr.STATION = STATION
) AS allNum
) AS allNum
...
@@ -303,9 +306,10 @@
...
@@ -303,9 +306,10 @@
fan_health_index_latest_data
fan_health_index_latest_data
<where>
<where>
ANALYSIS_OBJ_TYPE = '场站'
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
</if>
</if>
...
@@ -476,9 +480,10 @@
...
@@ -476,9 +480,10 @@
fan_health_index_latest_data
fan_health_index_latest_data
<where>
<where>
ANALYSIS_OBJ_TYPE = '子系统'
ANALYSIS_OBJ_TYPE = '子系统'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"equipmentName != null and equipmentName != ''"
>
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
</if>
</if>
...
@@ -573,7 +578,7 @@
...
@@ -573,7 +578,7 @@
fan_health_index_latest_data
fan_health_index_latest_data
<where>
<where>
ANALYSIS_OBJ_TYPE= '测点'
ANALYSIS_OBJ_TYPE= '测点'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
AND POINT_NAME IS NOT NULL
AND POINT_NAME IS NOT NULL
AND POINT_NAME != ''
AND POINT_NAME != ''
<if
test=
"subSystem != null and subSystem != ''"
>
<if
test=
"subSystem != null and subSystem != ''"
>
...
@@ -651,418 +656,419 @@
...
@@ -651,418 +656,419 @@
pv_health_index_latest_data
pv_health_index_latest_data
<where>
<where>
ANALYSIS_OBJ_TYPE = '设备'
ANALYSIS_OBJ_TYPE = '设备'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<if
test=
"subarray != null and subarray != ''"
>
AND REC_DATE >= get_time_sub(9,'MINUTE')
AND SUBARRAY = concat('#', #{subarray})
<if
test=
"subarray != null and subarray != ''"
>
</if>
AND SUBARRAY = concat('#', #{subarray})
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
</where>
</if>
group by EQUIPMENT_NAME
</where>
</select>
group by EQUIPMENT_NAME
<select
id=
"getPvSumSystemListByEquipment"
resultType=
"java.util.Map"
>
</select>
SELECT
<select
id=
"getPvSumSystemListByEquipment"
resultType=
"java.util.Map"
>
EQUIPMENT_NAME as equipmentName
SELECT
FROM
EQUIPMENT_NAME as equipmentName
idx_biz_pv_point_process_variable_classification
FROM
<where>
idx_biz_pv_point_process_variable_classification
EQUIPMENT_NAME IS NOT NULL
<where>
AND EQUIPMENT_NAME != ''
EQUIPMENT_NAME IS NOT NULL
AND TAG_CODE = '分析变量'
AND EQUIPMENT_NAME != ''
<if
test=
"subarray != null and subarray != ''"
>
AND TAG_CODE = '分析变量'
AND SUBARRAY = concat('#', #{subarray})
<if
test=
"subarray != null and subarray != ''"
>
</if>
AND SUBARRAY = concat('#', #{subarray})
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
</where>
</if>
GROUP BY
</where>
EQUIPMENT_NAME
GROUP BY
</select>
EQUIPMENT_NAME
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
</select>
SELECT
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
IFNULL(HEALTH_INDEX, 100) AS healthIndex,
SELECT
POINT_NAME AS pointName
IFNULL(HEALTH_INDEX, 100) AS healthIndex,
FROM
POINT_NAME AS pointName
pv_health_index_latest_data
FROM
<where>
pv_health_index_latest_data
ANALYSIS_OBJ_TYPE = '测点'
<where>
AND ANALYSIS_TYPE = '按天'
ANALYSIS_OBJ_TYPE = '测点'
AND POINT_NAME IS NOT NULL
AND ANALYSIS_TYPE = '按10分钟'
AND POINT_NAME != ''
AND POINT_NAME IS NOT NULL
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND POINT_NAME != ''
AND EQUIPMENT_NAME = #{equipmentName}
<if
test=
"equipmentName != null and equipmentName != ''"
>
</if>
AND EQUIPMENT_NAME = #{equipmentName}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
</where>
</if>
GROUP BY
</where>
POINT_NAME
GROUP BY
</select>
POINT_NAME
<select
id=
"getPvWarningInfoBySubSystem"
resultType=
"java.util.Map"
>
</select>
SELECT
<select
id=
"getPvWarningInfoBySubSystem"
resultType=
"java.util.Map"
>
POINT_NAME as pointName,
SELECT
WARNING_NAME as warningName
POINT_NAME as pointName,
FROM
WARNING_NAME as warningName
idx_biz_pv_warning_record
FROM
<where>
idx_biz_pv_warning_record
DISPOSOTION_STATE = '待确认'
<where>
<if
test=
"equipmentName != null and equipmentName != ''"
>
DISPOSOTION_STATE = '待确认'
AND EQUIPMENT_NAME = #{equipmentName}
<if
test=
"equipmentName != null and equipmentName != ''"
>
</if>
AND EQUIPMENT_NAME = #{equipmentName}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
</where>
</if>
GROUP BY
</where>
POINT_NAME
GROUP BY
ORDER BY
POINT_NAME
WARNING_NAME ASC
ORDER BY
</select>
WARNING_NAME ASC
<select
id=
"getPvPointNameListBySumSystem"
resultType=
"java.util.Map"
>
</select>
SELECT
<select
id=
"getPvPointNameListBySumSystem"
resultType=
"java.util.Map"
>
POINT_NAME as pointName,
SELECT
INDEX_ADDRESS as indexAddress,
POINT_NAME as pointName,
STATION AS station
INDEX_ADDRESS as indexAddress,
FROM
STATION AS station
idx_biz_pv_point_process_variable_classification
FROM
<where>
idx_biz_pv_point_process_variable_classification
TAG_CODE = '分析变量'
<where>
<if
test=
"equipmentName != null and equipmentName != ''"
>
TAG_CODE = '分析变量'
AND EQUIPMENT_NAME = #{equipmentName}
<if
test=
"equipmentName != null and equipmentName != ''"
>
</if>
AND EQUIPMENT_NAME = #{equipmentName}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
<if
test=
"gatewayId != null and gatewayId != ''"
>
</if>
AND GATEWAY_ID = #{gatewayId}
</where>
</if>
GROUP BY
</where>
POINT_NAME
GROUP BY
</select>
POINT_NAME
<select
id=
"getPointNameByIndexAddress"
resultType=
"java.lang.String"
>
</select>
select POINT_NAME
<select
id=
"getPointNameByIndexAddress"
resultType=
"java.lang.String"
>
from ${tableName}
select POINT_NAME
where INDEX_ADDRESS = #{varDesc}
from ${tableName}
and GATEWAY_ID = #{gatewayId}
where INDEX_ADDRESS = #{varDesc}
limit 1
and GATEWAY_ID = #{gatewayId}
limit 1
</select>
</select>
<select
id=
"getFullViewRecall"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO"
>
<select
id=
"getFullViewRecall"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO"
>
SELECT a.*,
SELECT a.*,
row_number() over ( ORDER BY pointName ) AS id
row_number() over ( ORDER BY pointName ) AS id
FROM (
FROM (
(SELECT ARAE AS area,
(SELECT ARAE AS area,
STATION AS station,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
EQUIPMENT_NAME AS equipmentName,
SUB_SYSTEM AS subSystem,
SUB_SYSTEM AS subSystem,
POINT_NAME AS pointName,
POINT_NAME AS pointName,
INDEX_ADDRESS AS indexAddress,
INDEX_ADDRESS AS indexAddress,
KKS
KKS
FROM idx_biz_fan_point_process_variable_classification
FROM idx_biz_fan_point_process_variable_classification
WHERE TAG_CODE = '分析变量'
WHERE TAG_CODE = '分析变量'
AND ARAE is not null
AND ARAE is not null
AND STATION is not null
AND STATION is not null
AND EQUIPMENT_NAME is not null
AND EQUIPMENT_NAME is not null
AND SUB_SYSTEM is not null
AND SUB_SYSTEM is not null
AND POINT_NAME is not null
AND POINT_NAME is not null
AND INDEX_ADDRESS is not null
AND INDEX_ADDRESS is not null
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
</if>
</if>
)
)
UNION ALL
UNION ALL
(SELECT ARAE AS area,
(SELECT ARAE AS area,
STATION AS station,
STATION AS station,
SUBARRAY AS equipmentName,
SUBARRAY AS equipmentName,
EQUIPMENT_NAME AS subSystem,
EQUIPMENT_NAME AS subSystem,
POINT_NAME AS pointName,
POINT_NAME AS pointName,
INDEX_ADDRESS AS indexAddress,
INDEX_ADDRESS AS indexAddress,
KKS
KKS
FROM idx_biz_pv_point_process_variable_classification
FROM idx_biz_pv_point_process_variable_classification
WHERE TAG_CODE = '分析变量'
WHERE TAG_CODE = '分析变量'
AND ARAE is not null
AND ARAE is not null
AND STATION is not null
AND STATION is not null
AND SUBARRAY is not null
AND SUBARRAY is not null
AND EQUIPMENT_NAME is not null
AND EQUIPMENT_NAME is not null
AND POINT_NAME is not null
AND POINT_NAME is not null
AND INDEX_ADDRESS is not null
AND INDEX_ADDRESS is not null
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
</if>
</if>
)
)
) a
) a
ORDER BY a.station ASC, a.equipmentName ASC, a.equipmentName asc, a.subSystem asc
ORDER BY a.station ASC, a.equipmentName ASC, a.equipmentName asc, a.subSystem asc
</select>
</select>
<select
id=
"getStationIndexInfo"
resultType=
"java.util.Map"
>
<select
id=
"getStationIndexInfo"
resultType=
"java.util.Map"
>
SELECT a.STATION AS station,
SELECT a.STATION AS station,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
FROM (
FROM (
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
STATION AS STATION
FROM idx_biz_fan_health_index
WHERE ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY STATION
UNION ALL
(
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
STATION AS STATION
STATION AS STATION
FROM idx_biz_
fan
_health_index
FROM idx_biz_
pv
_health_index
WHERE ANALYSIS_OBJ_TYPE = '场站'
WHERE ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY STATION
GROUP BY STATION
UNION ALL
)
(
) a
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
GROUP BY a.STATION
STATION AS STATION
</select>
FROM idx_biz_pv_health_index
<select
id=
"getEquipmentIndexInfo"
resultType=
"java.util.Map"
>
WHERE ANALYSIS_OBJ_TYPE = '场站'
SELECT a.equipmentName AS equipmentName,
AND ANALYSIS_TYPE = '按天'
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
FROM (
GROUP BY STATION
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
)
EQUIPMENT_NAME AS equipmentName
) a
FROM idx_biz_fan_health_index
GROUP BY a.STATION
WHERE ANALYSIS_OBJ_TYPE = '设备'
</select>
AND ANALYSIS_TYPE = '按天'
<select
id=
"getEquipmentIndexInfo"
resultType=
"java.util.Map"
>
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
SELECT a.equipmentName AS equipmentName,
GROUP BY EQUIPMENT_NAME
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
UNION ALL
FROM
(
(
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
EQUIPMENT_NAME
AS equipmentName
SUBARRAY
AS equipmentName
FROM idx_biz_
fan
_health_index
FROM idx_biz_
pv
_health_index
WHERE ANALYSIS_OBJ_TYPE = '
设备
'
WHERE ANALYSIS_OBJ_TYPE = '
子阵
'
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY EQUIPMENT_NAME
GROUP BY SUBARRAY
UNION ALL
)
(
) a
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
where equipmentName is not null
SUBARRAY AS equipmentName
and equipmentName != ''
FROM idx_biz_pv_health_index
GROUP BY
WHERE ANALYSIS_OBJ_TYPE = '子阵'
a.equipmentName
AND ANALYSIS_TYPE = '按天'
</select>
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
<select
id=
"getSubSystemIndexInfo"
resultType=
"java.util.Map"
>
GROUP BY SUBARRAY
)
) a
where equipmentName is not null
and equipmentName != ''
GROUP BY
a.equipmentName
</select>
<select
id=
"getSubSystemIndexInfo"
resultType=
"java.util.Map"
>
SELECT a.subSystem AS subSystem,
SELECT a.subSystem AS subSystem,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
FROM (
FROM (
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
SUB_SYSTEM AS subSystem
FROM idx_biz_fan_health_index
WHERE ANALYSIS_OBJ_TYPE = '子系统'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY SUB_SYSTEM
UNION ALL
(
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
SUB_SYSTEM
AS subSystem
EQUIPMENT_NAME
AS subSystem
FROM idx_biz_
fan
_health_index
FROM idx_biz_
pv
_health_index
WHERE ANALYSIS_OBJ_TYPE = '
子系统
'
WHERE ANALYSIS_OBJ_TYPE = '
设备
'
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY SUB_SYSTEM
GROUP BY EQUIPMENT_NAME
UNION ALL
)
(
) a
SELECT IFNULL(AVG(HEALTH_INDEX), 100) AS avgHealthIndex,
where subSystem is not null
EQUIPMENT_NAME AS subSystem
and subSystem != ''
FROM idx_biz_pv_health_index
GROUP BY
WHERE ANALYSIS_OBJ_TYPE = '设备'
a.subSystem
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY EQUIPMENT_NAME
)
) a
where subSystem is not null
and subSystem != ''
GROUP BY
a.subSystem
</select>
</select>
<select
id=
"getPointNameIndexInfo"
resultType=
"java.util.Map"
>
<select
id=
"getPointNameIndexInfo"
resultType=
"java.util.Map"
>
SELECT IFNULL(MAX(HEALTH_INDEX), 100) AS healthIndex,
concat(MAX(STATION), '_', INDEX_ADDRESS) as gatewayIndexAddress
FROM idx_biz_fan_health_index
WHERE ANALYSIS_OBJ_TYPE = '测点'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY INDEX_ADDRESS
UNION ALL
(
SELECT IFNULL(MAX(HEALTH_INDEX), 100) AS healthIndex,
SELECT IFNULL(MAX(HEALTH_INDEX), 100) AS healthIndex,
concat(MAX(STATION), '_', INDEX_ADDRESS) as gatewayIndexAddress
concat(MAX(STATION), '_', INDEX_ADDRESS) as gatewayIndexAddress
FROM idx_biz_
fan
_health_index
FROM idx_biz_
pv
_health_index
WHERE ANALYSIS_OBJ_TYPE = '测点'
WHERE ANALYSIS_OBJ_TYPE = '测点'
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY INDEX_ADDRESS
GROUP BY INDEX_ADDRESS
UNION ALL
)
(
</select>
SELECT IFNULL(MAX(HEALTH_INDEX), 100) AS healthIndex,
<select
id=
"getHealthLevelInfoList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel"
>
concat(MAX(STATION), '_', INDEX_ADDRESS) as gatewayIndexAddress
SELECT CONCAT(`STATUS`, '_', ANALYSIS_OBJ_TYPE) AS analysisObjType,
FROM idx_biz_pv_health_index
HEALTH_LEVEL AS healthLevel,
WHERE ANALYSIS_OBJ_TYPE = '测点'
GROUP_LOWER_LIMIT AS groupLowerLimit,
AND ANALYSIS_TYPE = '按天'
GROUP_UPPER_LIMIT AS groupUpperLimit
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
FROM idx_biz_fan_health_level
GROUP BY INDEX_ADDRESS
WHERE (STATUS IS NOT NULL
)
OR STATUS != '')
</select>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<select
id=
"getHealthLevelInfoList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
SELECT CONCAT(`STATUS`, '_', ANALYSIS_OBJ_TYPE) AS analysisObjType,
#{item}
HEALTH_LEVEL AS healthLevel,
</foreach>
GROUP_LOWER_LIMIT AS groupLowerLimit,
</if>
GROUP_UPPER_LIMIT AS groupUpperLimit
UNION ALL
FROM idx_biz_fan_health_level
SELECT CONCAT(`STATUS`, '_', ANALYSIS_OBJ_TYPE) AS analysisObjType,
WHERE (STATUS IS NOT NULL
HEALTH_LEVEL AS healthLevel,
OR STATUS != '')
GROUP_LOWER_LIMIT AS groupLowerLimit,
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
GROUP_UPPER_LIMIT AS groupUpperLimit
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
FROM idx_biz_pv_health_level
#{item}
WHERE (STATUS IS NOT NULL
</foreach>
OR STATUS != '')
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"getAddressInfo"
resultType=
"java.lang.String"
>
select index_address
from wl_equipment_specific_index
where gateway_id = '1668801435891929089'
and data_type = 'analog' limit 100
</select>
<select
id=
"queryForLeftTableList"
resultType=
"map"
>
SELECT
b.*,
IFNULL(CAST(HEALTH_INDEX AS UNSIGNED), 100 ) as HEALTH_INDEX ,
IFNULL( ibfhi.HEALTH_LEVEL, '安全' ) as HEALTH_LEVEL,
(case ibfhi.HEALTH_LEVEL
WHEN '危险' THEN 3
WHEN '警告' THEN 2
WHEN '注意' THEN 1
ELSE 0 end) as status
FROM
(
SELECT
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
FROM
`idx_biz_fan_point_process_variable_classification`
WHERE
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
ORDER BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
) b
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND
DATE_FORMAT(ibfhi.REC_DATE,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
<where>
<if
test=
"STATION != '' and STATION != null"
>
b.STATION = #{STATION}
</if>
</if>
UNION ALL
<if
test=
"HEALTHLEVEL != '' and HEALTHLEVEL != null"
>
SELECT CONCAT(`STATUS`, '_', ANALYSIS_OBJ_TYPE) AS analysisObjType,
AND HEALTH_LEVEL = #{HEALTHLEVEL}
HEALTH_LEVEL AS healthLevel,
GROUP_LOWER_LIMIT AS groupLowerLimit,
GROUP_UPPER_LIMIT AS groupUpperLimit
FROM idx_biz_pv_health_level
WHERE (STATUS IS NOT NULL
OR STATUS != '')
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</if>
</select>
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
<select
id=
"getAddressInfo"
resultType=
"java.lang.String"
>
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
select index_address
</if>
from wl_equipment_specific_index
</where>
where gateway_id = '1668801435891929089'
order by HEALTH_INDEX ASC
and data_type = 'analog' limit 100
limit ${current},${size}
</select>
</select>
<select
id=
"queryForLeftTableList"
resultType=
"map"
>
<select
id=
"queryForLeftTableListCount"
resultType=
"int"
>
SELECT
SELECT
b.*,
count(1)
IFNULL(CAST(HEALTH_INDEX AS UNSIGNED), 100 ) as HEALTH_INDEX ,
FROM
IFNULL( ibfhi.HEALTH_LEVEL, '安全' ) as HEALTH_LEVEL,
(
(case ibfhi.HEALTH_LEVEL
SELECT
WHEN '危险' THEN 3
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
WHEN '警告' THEN 2
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
WHEN '注意' THEN 1
FROM
ELSE 0 end) as status
`idx_biz_fan_point_process_variable_classification`
FROM
WHERE
(
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
SELECT
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
ORDER BY
FROM
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
`idx_biz_fan_point_process_variable_classification`
) b
WHERE
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND
GROUP BY
DATE_FORMAT(ibfhi.REC_DATE,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
<where>
ORDER BY
<if
test=
"STATION != '' and STATION != null"
>
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
b.STATION = #{STATION}
) b
</if>
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
<if
test=
"HEALTHLEVEL != '' and HEALTHLEVEL != null"
>
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND
AND HEALTH_LEVEL = #{HEALTHLEVEL}
DATE_FORMAT(ibfhi.REC_DATE,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
</if>
<where>
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
<if
test=
"STATION != '' and STATION != null"
>
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
b.STATION = #{STATION}
</if>
</if>
</where>
<if
test=
"HEALTHLEVEL != '' and HEALTHLEVEL != null"
>
</select>
AND HEALTH_LEVEL = #{HEALTHLEVEL}
<select
id=
"queryForLeftTableListNum"
resultType=
"map"
>
</if>
SELECT
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
order by HEALTH_INDEX ASC
limit ${current},${size}
</select>
<select
id=
"queryForLeftTableListCount"
resultType=
"int"
>
SELECT
count(1)
FROM
(
SELECT
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
FROM
`idx_biz_fan_point_process_variable_classification`
WHERE
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
ORDER BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
) b
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND
DATE_FORMAT(ibfhi.REC_DATE,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
<where>
<if
test=
"STATION != '' and STATION != null"
>
b.STATION = #{STATION}
</if>
<if
test=
"HEALTHLEVEL != '' and HEALTHLEVEL != null"
>
AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
</select>
<select
id=
"queryForLeftTableListNum"
resultType=
"map"
>
SELECT
CAST(ibfhi.HEALTH_INDEX AS UNSIGNED) as value
CAST(ibfhi.HEALTH_INDEX AS UNSIGNED) as value
FROM
FROM
(
(
SELECT
SELECT
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
FROM
FROM
`idx_biz_fan_point_process_variable_classification`
`idx_biz_fan_point_process_variable_classification`
WHERE
WHERE
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
GROUP BY
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
ORDER BY
ORDER BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
) b
) b
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND
DATE_FORMAT(ibfhi.REC_DATE,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
DATE_FORMAT(ibfhi.REC_DATE,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
<where>
<where>
<if
test=
"STATION != '' and STATION != null"
>
<if
test=
"STATION != '' and STATION != null"
>
b.STATION = #{STATION}
b.STATION = #{STATION}
</if>
</if>
<if
test=
"HEALTHLEVEL != '' and HEALTHLEVEL != null"
>
<if
test=
"HEALTHLEVEL != '' and HEALTHLEVEL != null"
>
AND HEALTH_LEVEL = #{HEALTHLEVEL}
AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
</if>
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</if>
</where>
</where>
</select>
</select>
<select
id=
"queryForLeftTableListByPoint"
resultType=
"map"
>
<select
id=
"queryForLeftTableListByPoint"
resultType=
"map"
>
SELECT
SELECT
b.*
b.*
FROM
FROM
(
(
SELECT
SELECT
POINT_NAME ,
POINT_NAME ,
STATION,
STATION,
CAST(HEALTH_INDEX AS UNSIGNED) as HEALTH_INDEX,
CAST(HEALTH_INDEX AS UNSIGNED) as HEALTH_INDEX,
CAST(HEALTH_INDEX AS UNSIGNED) as value,
CAST(HEALTH_INDEX AS UNSIGNED) as value,
HEALTH_LEVEL,
HEALTH_LEVEL,
( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status,
SUB_SYSTEM,
SUB_SYSTEM,
REC_DATE,
REC_DATE,
EQUIPMENT_NAME,
EQUIPMENT_NAME,
INDEX_ADDRESS,
INDEX_ADDRESS,
ANALYSIS_OBJ_SEQ,
ANALYSIS_OBJ_SEQ,
ANALYSIS_TYPE
ANALYSIS_TYPE
FROM
FROM
`idx_biz_fan_health_index`
`idx_biz_fan_health_index`
WHERE
WHERE
ANALYSIS_OBJ_TYPE = '测点'
ANALYSIS_OBJ_TYPE = '测点'
<!--AND ( ANALYSIS_TYPE = '按小时' AND REC_DATE >= DATE_SUB( NOW( ), INTERVAL 1 HOUR ) )-->
<!--AND ( ANALYSIS_TYPE = '按小时' AND REC_DATE >= DATE_SUB( NOW( ), INTERVAL 1 HOUR ) )-->
AND ( ANALYSIS_TYPE = '按小时' AND REC_DATE >= get_time_sub(1,'HOUR') )
AND ( ANALYSIS_TYPE = '按小时' AND REC_DATE >= get_time_sub(1,'HOUR') )
OR ( REC_DATE >= CURRENT_DATE ( ) AND ANALYSIS_TYPE = '按天' )
OR ( REC_DATE >= CURRENT_DATE ( ) AND ANALYSIS_TYPE = '按天' )
<!--OR ( ANALYSIS_TYPE = '按10分钟' AND REC_DATE >= DATE_SUB( NOW( ), INTERVAL 10 MINUTE ) )-->
<!--OR ( ANALYSIS_TYPE = '按10分钟' AND REC_DATE >= DATE_SUB( NOW( ), INTERVAL 10 MINUTE ) )-->
...
@@ -1688,9 +1694,10 @@
...
@@ -1688,9 +1694,10 @@
FROM
FROM
fan_health_index_latest_data
fan_health_index_latest_data
<where>
<where>
ANALYSIS_TYPE = '按天'
ANALYSIS_TYPE = '按10分钟'
<!-- AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY') -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_OBJ_TYPE = '片区'
...
@@ -1710,64 +1717,65 @@
...
@@ -1710,64 +1717,65 @@
FROM
FROM
pv_health_index_latest_data
pv_health_index_latest_data
<where>
<where>
ANALYSIS_TYPE = '按天
'
ANALYSIS_TYPE = '按10分钟
'
<!-- AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
<!-- AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<if
test=
"areaCode != null and areaCode != ''"
>
AND REC_DATE >= get_time_sub(9,'MINUTE')
AND ARAE like concat('%', #{areaCode}, '%')
<if
test=
"areaCode != null and areaCode != ''"
>
AND ANALYSIS_OBJ_TYPE = '片区'
AND ARAE like concat('%', #{areaCode}, '%')
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"stationCode != null and stationCode != ''"
>
</if>
AND GATEWAY_ID = #{stationCode}
<if
test=
"stationCode != null and stationCode != ''"
>
AND ANALYSIS_OBJ_TYPE = '场站'
AND GATEWAY_ID = #{stationCode}
</if>
AND ANALYSIS_OBJ_TYPE = '场站'
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
</if>
AND ANALYSIS_OBJ_TYPE = '片区'
</where>
</if>
)
</where>
) a
)
</select>
) a
<!--<select id="getDateInfoBy15" resultType="java.util.Map">
</select>
SELECT
<!--<select id="getDateInfoBy15" resultType="java.util.Map">
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( CURDATE() - INTERVAL 1 DAY, INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
SELECT
@s := @s + 1 AS `index`
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( CURDATE() - INTERVAL 1 DAY, INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
FROM
@s := @s + 1 AS `index`
mysql.help_topic,
FROM
( SELECT @s := 1 ) temp
mysql.help_topic,
WHERE
( SELECT @s := 1 ) temp
DATEDIFF( CURDATE() - INTERVAL 1 DAY, DATE( DATE_ADD( CURDATE() - INTERVAL 1 DAY, INTERVAL - 15 DAY )) ) >= @s
WHERE
</select>
DATEDIFF( CURDATE() - INTERVAL 1 DAY, DATE( DATE_ADD( CURDATE() - INTERVAL 1 DAY, INTERVAL - 15 DAY )) ) >= @s
<select id="getDateInfo" resultType="java.util.Map">
</select>
SELECT
<select id="getDateInfo" resultType="java.util.Map">
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( #{endTime}, INTERVAL - DATEDIFF( #{endTime}, #{startTime})-1 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
SELECT
@s := @s + 1 AS `index`
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( #{endTime}, INTERVAL - DATEDIFF( #{endTime}, #{startTime})-1 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
FROM
@s := @s + 1 AS `index`
mysql.help_topic,
FROM
( SELECT @s := 1 ) temp
mysql.help_topic,
WHERE
( SELECT @s := 1 ) temp
DATEDIFF( #{endTime}, DATE( DATE_ADD( #{endTime}, INTERVAL - DATEDIFF( #{endTime}, #{startTime})-1 DAY )) ) >= @s
WHERE
</select>
DATEDIFF( #{endTime}, DATE( DATE_ADD( #{endTime}, INTERVAL - DATEDIFF( #{endTime}, #{startTime})-1 DAY )) ) >= @s
<select id="getHourInfo" resultType="java.util.Map">
</select>
SELECT
<select id="getHourInfo" resultType="java.util.Map">
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL @s-1 HOUR ), '%Y-%m-%d %H:%i:%s' ) AS date,
SELECT
( @s := @s + 1 )- 1 AS `index`
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL @s-1 HOUR ), '%Y-%m-%d %H:%i:%s' ) AS date,
FROM
( @s := @s + 1 )- 1 AS `index`
mysql.help_topic,
FROM
( SELECT @s := 1 ) temp
mysql.help_topic,
WHERE
( SELECT @s := 1 ) temp
TIMESTAMPDIFF( HOUR, #{startTime} , #{endTime}) >= @s-1
WHERE
</select>
TIMESTAMPDIFF( HOUR, #{startTime} , #{endTime}) >= @s-1
<select id="getMomentInfo" resultType="java.util.Map">
</select>
SELECT
<select id="getMomentInfo" resultType="java.util.Map">
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL (@s-1)*10 MINUTE ), '%Y-%m-%d %H:%i:%s' ) AS date,
SELECT
( @s := @s + 1 )- 1 AS `index`
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL (@s-1)*10 MINUTE ), '%Y-%m-%d %H:%i:%s' ) AS date,
FROM
( @s := @s + 1 )- 1 AS `index`
mysql.help_topic,
FROM
( SELECT @s := 1 ) temp
mysql.help_topic,
WHERE
( SELECT @s := 1 ) temp
TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
WHERE
</select>-->
TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
</select>-->
<select
id=
"getHealthIndexByIndexAddress"
resultType=
"java.util.Map"
>
<select
id=
"getHealthIndexByIndexAddress"
resultType=
"java.util.Map"
>
select ROUND(ifnull(HEALTH_INDEX, 100.0), 1) as healthIndex,
select ROUND(ifnull(HEALTH_INDEX, 100.0), 1) as healthIndex,
...
@@ -1777,7 +1785,7 @@
...
@@ -1777,7 +1785,7 @@
INDEX_ADDRESS = #{indexAddress}
INDEX_ADDRESS = #{indexAddress}
and GATEWAY_ID = #{gatewayId}
and GATEWAY_ID = #{gatewayId}
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按
天
'
and ANALYSIS_TYPE = '按
10分钟
'
limit 1
limit 1
</select>
</select>
...
@@ -1789,7 +1797,7 @@
...
@@ -1789,7 +1797,7 @@
INDEX_ADDRESS = #{indexAddress}
INDEX_ADDRESS = #{indexAddress}
and GATEWAY_ID = #{gatewayId}
and GATEWAY_ID = #{gatewayId}
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按
天
'
and ANALYSIS_TYPE = '按
10分钟
'
limit 1
limit 1
</select>
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment