Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
659e65a0
Commit
659e65a0
authored
Apr 29, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://111.203.232.171:8888/lee/chnmuseum-party
into dev
parents
f6ae744b
7f260533
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
351 additions
and
4 deletions
+351
-4
ExportExcelUtil.java
.../java/cn/chnmuseum/party/common/util/ExportExcelUtil.java
+137
-0
ObjectToMapUtil.java
.../java/cn/chnmuseum/party/common/util/ObjectToMapUtil.java
+23
-0
MvcConfiguration.java
src/main/java/cn/chnmuseum/party/conf/MvcConfiguration.java
+47
-0
TBoxOperationMapper.java
...n/java/cn/chnmuseum/party/mapper/TBoxOperationMapper.java
+2
-0
RunLog.java
src/main/java/cn/chnmuseum/party/model/RunLog.java
+8
-0
TBoxOperation.java
src/main/java/cn/chnmuseum/party/model/TBoxOperation.java
+8
-0
TUser.java
src/main/java/cn/chnmuseum/party/model/TUser.java
+8
-0
TBoxOperationService.java
...java/cn/chnmuseum/party/service/TBoxOperationService.java
+2
-0
TBoxOperationServiceImpl.java
...hnmuseum/party/service/impl/TBoxOperationServiceImpl.java
+14
-0
TBoxOperationController.java
...nmuseum/party/web/controller/TBoxOperationController.java
+57
-1
RunLogMapper.xml
src/main/resources/mapper/RunLogMapper.xml
+5
-2
TBoxOperationMapper.xml
src/main/resources/mapper/TBoxOperationMapper.xml
+40
-1
No files found.
src/main/java/cn/chnmuseum/party/common/util/ExportExcelUtil.java
0 → 100644
View file @
659e65a0
package
cn
.
chnmuseum
.
party
.
common
.
util
;
import
org.apache.poi.hssf.usermodel.*
;
import
org.apache.poi.ss.usermodel.Cell
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
ExportExcelUtil
{
//
// public static String exportExcel(List<?> list, String[] titles, String[] keys, String name) {
// OutputStream outputStream = null;
// String id = UUIDUtil.getUUID();
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
// Date date = new Date();
// String saveDir = "/" + simpleDateFormat.format(date);
//// String property = "/home/changfa/app/tomcat-zhny/file" + saveDir;
// String property = RuoYiConfig.getProfile() + saveDir;
//// String property = "D:\\畅发科技公司";
// File fileDir = new File(property);
// if (!fileDir.exists()) {
// fileDir.mkdir();
// }
// String path = property + "/" + name + id + ".xls";
// try {
// try {
// File file = new File(path);
// outputStream = new FileOutputStream(file);
// } catch (Exception e) {
// e.printStackTrace();
// }
// getHSSFWorkbook(titles, list, keys).write(outputStream);
// } catch (IOException e) {
// e.printStackTrace();
// } finally {
// if (outputStream != null) {
// try {
// outputStream.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// }
// return RuoYiConfig.getDownload() + saveDir + "/" + name + id + ".xls";
//// return "192.168.110.86:8081/file" + saveDir + "/" + name + id + ".xls";
//
// }
/**
* 导出Excel
*
* @param title 标题
* @param mapList 内容
* @return
*/
public
static
HSSFWorkbook
getHSSFWorkbook
(
String
[]
title
,
List
<?>
mapList
,
String
[]
keys
)
{
// 第一步,创建一个HSSFWorkbook,对应一个Excel文件
HSSFWorkbook
wb
=
new
HSSFWorkbook
();
// 第二步,在workbook中添加一个sheet,对应Excel文件中的sheet
HSSFSheet
sheet
=
wb
.
createSheet
(
"sheet1"
);
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
HSSFRow
row
=
sheet
.
createRow
(
0
);
// 第四步,创建单元格,并设置值表头 设置表头居中
HSSFCellStyle
style
=
wb
.
createCellStyle
();
// style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
//声明列对象
HSSFCell
cell
=
null
;
//存储最大列宽
Map
<
Integer
,
Integer
>
maxWidth
=
new
HashMap
<>();
//创建标题
for
(
int
i
=
0
;
i
<
title
.
length
;
i
++)
{
cell
=
row
.
createCell
(
i
);
cell
.
setCellValue
(
title
[
i
]);
cell
.
setCellStyle
(
style
);
maxWidth
.
put
(
i
,
cell
.
getStringCellValue
().
getBytes
().
length
*
256
+
512
);
}
Map
<
String
,
Object
>
map
=
null
;
Object
a
=
null
;
//创建内容
for
(
int
i
=
0
;
i
<
mapList
.
size
();
i
++)
{
a
=
mapList
.
get
(
i
);
//将实体类转化为map集合
map
=
ObjectToMapUtil
.
object2Map
(
a
);
//添加数据行
row
=
sheet
.
createRow
(
i
+
1
);
int
k
=
0
;
int
length
=
0
;
for
(
int
j
=
0
;
j
<
keys
.
length
;
j
++)
{
//创建单元格
Cell
cells
=
row
.
createCell
(
j
);
//获取单元格内容
Object
o
=
map
.
get
(
keys
[
j
]);
if
(
j
==
0
)
{
//设置序号
cells
.
setCellValue
(
i
+
1
);
}
else
{
if
(
o
==
null
)
{
cells
.
setCellValue
(
""
);
}
else
{
cells
.
setCellValue
(
o
.
toString
());
}
//根据内容设置列宽
length
=
cells
.
getStringCellValue
().
length
()
*
521
+
1024
;
//这里把宽度最大限制到25000
if
(
length
>
25000
)
{
length
=
25000
;
}
maxWidth
.
put
(
k
,
Math
.
max
(
length
,
maxWidth
.
get
(
k
)));
k
++;
cells
.
setCellStyle
(
style
);
}
}
}
//根据内容设置列宽
for
(
int
i
=
0
;
i
<
title
.
length
;
i
++)
{
//跳过序号列
sheet
.
setColumnWidth
(
i
+
1
,
maxWidth
.
get
(
i
));
}
return
wb
;
}
}
src/main/java/cn/chnmuseum/party/common/util/ObjectToMapUtil.java
0 → 100644
View file @
659e65a0
package
cn
.
chnmuseum
.
party
.
common
.
util
;
import
java.lang.reflect.Field
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
ObjectToMapUtil
{
public
static
Map
<
String
,
Object
>
object2Map
(
Object
object
){
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
//获得类的的属性名 数组
Field
[]
fields
=
object
.
getClass
().
getDeclaredFields
();
try
{
for
(
Field
field
:
fields
)
{
field
.
setAccessible
(
true
);
String
name
=
new
String
(
field
.
getName
());
result
.
put
(
name
,
field
.
get
(
object
));
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
result
;
}
}
src/main/java/cn/chnmuseum/party/conf/MvcConfiguration.java
View file @
659e65a0
...
...
@@ -13,10 +13,15 @@ import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.StringHttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
...
...
@@ -128,5 +133,47 @@ public class MvcConfiguration extends WebMvcConfigurationSupport {
.
addResourceLocations
(
"classpath:/template/"
)
.
addResourceLocations
(
"classpath:/"
);
}
/**
* 添加自定义的拦截器
* @author fxbin
* @param registry
*/
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
new
MyInterceptor
()).
addPathPatterns
(
"/**"
);
}
/**
* 拦截器
* @author fxbin
* @version v1.0
* @since 2018/11/7 1:25
*/
class
MyInterceptor
extends
HandlerInterceptorAdapter
{
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
System
.
out
.
println
(
"Interceptor preHandler method is running !"
);
return
super
.
preHandle
(
request
,
response
,
handler
);
}
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
System
.
out
.
println
(
"Interceptor postHandler method is running !"
);
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
}
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
System
.
out
.
println
(
"Interceptor afterCompletion method is running !"
);
super
.
afterCompletion
(
request
,
response
,
handler
,
ex
);
}
@Override
public
void
afterConcurrentHandlingStarted
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
System
.
out
.
println
(
"Interceptor afterConcurrentHandlingStarted method is running !"
);
super
.
afterConcurrentHandlingStarted
(
request
,
response
,
handler
);
}
}
}
src/main/java/cn/chnmuseum/party/mapper/TBoxOperationMapper.java
View file @
659e65a0
...
...
@@ -23,4 +23,6 @@ public interface TBoxOperationMapper extends BaseMapper<TBoxOperation> {
List
<
TBoxOperation
>
selectBoxPage
(
Page
<
TBoxOperation
>
page
,
@Param
(
"user"
)
TUser
user
);
List
<
TBoxOperation
>
selectPageList
(
Page
<
TBoxOperation
>
page
,
@Param
(
"tBoxOperation"
)
TBoxOperation
tBoxOperation
);
List
<
TBoxOperation
>
selectBoxPage
(
@Param
(
"user"
)
TUser
user
);
}
src/main/java/cn/chnmuseum/party/model/RunLog.java
View file @
659e65a0
...
...
@@ -54,6 +54,10 @@ public class RunLog implements Serializable {
@TableField
(
"end_time"
)
private
LocalDateTime
endTime
;
@ApiModelProperty
(
value
=
"展板ID"
)
@TableField
(
"exhibition_board_id"
)
private
String
exhibitionBoardId
;
@ApiModelProperty
(
value
=
"机构名称"
)
@TableField
(
exist
=
false
)
private
String
orgName
;
...
...
@@ -62,6 +66,10 @@ public class RunLog implements Serializable {
@TableField
(
exist
=
false
)
private
String
learnName
;
@ApiModelProperty
(
value
=
"学习内容名称"
)
@TableField
(
exist
=
false
)
private
String
exhibitionBoardName
;
@ApiModelProperty
(
"开始时间"
)
@TableField
(
exist
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd hh:mm:ss"
)
...
...
src/main/java/cn/chnmuseum/party/model/TBoxOperation.java
View file @
659e65a0
...
...
@@ -102,4 +102,12 @@ public class TBoxOperation implements Serializable {
@TableField
(
exist
=
false
)
private
LocalDate
exiredDate
;
@ApiModelProperty
(
"展板播放次数"
)
@TableField
(
exist
=
false
)
private
Long
num
;
@ApiModelProperty
(
"账号状态"
)
@TableField
(
exist
=
false
)
private
String
macStatus
;
}
src/main/java/cn/chnmuseum/party/model/TUser.java
View file @
659e65a0
...
...
@@ -164,4 +164,12 @@ public class TUser implements Serializable {
@TableField
(
exist
=
false
)
private
String
jwtToken
;
@ApiModelProperty
(
"开始日期"
)
@TableField
(
exist
=
false
)
private
LocalDateTime
beginDate
;
@ApiModelProperty
(
"结束日期"
)
@TableField
(
exist
=
false
)
private
LocalDateTime
endDate
;
}
src/main/java/cn/chnmuseum/party/service/TBoxOperationService.java
View file @
659e65a0
...
...
@@ -22,4 +22,6 @@ public interface TBoxOperationService extends IService<TBoxOperation> {
Page
<
TBoxOperation
>
selectBoxPage
(
Page
<
TBoxOperation
>
page
,
TUser
user
);
Page
<
TBoxOperation
>
selectPage
(
Page
<
TBoxOperation
>
page
,
TBoxOperation
tBoxOperation
);
List
<
TBoxOperation
>
selectBoxList
(
TUser
user
);
}
src/main/java/cn/chnmuseum/party/service/impl/TBoxOperationServiceImpl.java
View file @
659e65a0
...
...
@@ -43,5 +43,19 @@ public class TBoxOperationServiceImpl extends ServiceImpl<TBoxOperationMapper, T
public
Page
<
TBoxOperation
>
selectPage
(
Page
<
TBoxOperation
>
page
,
TBoxOperation
tBoxOperation
)
{
return
page
.
setRecords
(
tBoxOperationMapper
.
selectPageList
(
page
,
tBoxOperation
));
}
@Override
public
List
<
TBoxOperation
>
selectBoxList
(
TUser
user
)
{
List
<
TBoxOperation
>
list
=
tBoxOperationMapper
.
selectBoxPage
(
user
);
for
(
TBoxOperation
tBoxOperation
:
list
)
{
if
(
tBoxOperation
.
getPermanent
()){
tBoxOperation
.
setMacStatus
(
"永久有效"
);
}
if
(
null
!=
tBoxOperation
.
getExiredDate
()){
tBoxOperation
.
setMacStatus
(
tBoxOperation
.
getExiredDate
().
toString
());
}
}
return
list
;
}
}
src/main/java/cn/chnmuseum/party/web/controller/TBoxOperationController.java
View file @
659e65a0
...
...
@@ -3,8 +3,10 @@ package cn.chnmuseum.party.web.controller;
import
cn.chnmuseum.party.common.log.MethodLog
;
import
cn.chnmuseum.party.common.log.OperModule
;
import
cn.chnmuseum.party.common.log.OperType
;
import
cn.chnmuseum.party.common.util.ExportExcelUtil
;
import
cn.chnmuseum.party.common.util.RSAUtils
;
import
cn.chnmuseum.party.common.validator.groups.Update
;
import
cn.chnmuseum.party.model.TAppVersion
;
import
cn.chnmuseum.party.model.TBoxOperation
;
import
cn.chnmuseum.party.model.TUser
;
import
cn.chnmuseum.party.service.TBoxOperationService
;
...
...
@@ -18,6 +20,7 @@ import io.swagger.annotations.ApiImplicitParams;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.shiro.authz.annotation.RequiresAuthentication
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.ValueOperations
;
...
...
@@ -25,6 +28,10 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.OutputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.time.LocalDate
;
import
java.util.*
;
/**
...
...
@@ -64,7 +71,7 @@ public class TBoxOperationController extends BaseController {
@RequiresAuthentication
//@RequiresPermissions("/boxOperation/selectPageList")
@ApiOperation
(
value
=
"获取机顶盒基础信息分页列表"
,
notes
=
"获取机顶盒基础信息分页列表"
)
@MethodLog
(
operModule
=
OperModule
.
STBBASE
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
selectPageList
(
String
organId
,
String
areaId
)
{
public
Map
<
String
,
Object
>
selectPageList
(
String
organId
,
String
areaId
,
LocalDate
beginDate
,
LocalDate
endDate
)
{
TUser
user1
=
getcurUser
();
TUser
user
=
new
TUser
();
if
(
StringUtils
.
isNotBlank
(
organId
))
{
...
...
@@ -78,6 +85,10 @@ public class TBoxOperationController extends BaseController {
// String areaId1 = getAreaId(user1.getAreaId());
// user.setAreaName(areaId1);
// }
if
(
beginDate
!=
null
&&
endDate
!=
null
)
{
user
.
setBeginDate
(
beginDate
.
atTime
(
0
,
0
,
0
));
user
.
setEndDate
(
endDate
.
atTime
(
23
,
59
,
59
));
}
if
(!
user1
.
getRoleList
().
contains
(
"1"
))
{
user
.
setOrgCode
(
user1
.
getOrgCode
());
}
...
...
@@ -272,6 +283,51 @@ public class TBoxOperationController extends BaseController {
}
@PostMapping
(
"/export"
)
@RequiresAuthentication
//@RequiresPermissions("/boxOperation/selectPageList")
@ApiOperation
(
value
=
"导出机顶盒基础信息列表"
,
notes
=
"导出机顶盒基础信息列表"
)
// @MethodLog(operModule = OperModule.STBBASE,operType = OperType.SELECT)
public
void
export
(
String
organId
,
String
areaId
,
LocalDate
beginDate
,
LocalDate
endDate
,
HttpServletResponse
response
)
{
TUser
user1
=
getcurUser
();
TUser
user
=
new
TUser
();
if
(
StringUtils
.
isNotBlank
(
organId
))
{
user
.
setOrgId
(
organId
);
}
if
(
StringUtils
.
isNotBlank
(
areaId
))
{
user
.
setAreaId
(
areaId
);
}
//设置数据权限
// if (StringUtils.isNotBlank(user1.getAreaId())) {
// String areaId1 = getAreaId(user1.getAreaId());
// user.setAreaName(areaId1);
// }
if
(
beginDate
!=
null
&&
endDate
!=
null
)
{
user
.
setBeginDate
(
beginDate
.
atTime
(
0
,
0
,
0
));
user
.
setEndDate
(
endDate
.
atTime
(
23
,
59
,
59
));
}
if
(!
user1
.
getRoleList
().
contains
(
"1"
))
{
user
.
setOrgCode
(
user1
.
getOrgCode
());
}
try
{
List
<
TBoxOperation
>
list
=
tBoxOperationService
.
selectBoxList
(
user
);
String
[]
title
=
{
"序号"
,
"MAc地址"
,
"所属单位"
,
"展板播放次数"
,
"到期时间"
};
String
[]
keys
=
{
"id"
,
"mac"
,
"organName"
,
"num"
,
"macStatus"
};
HSSFWorkbook
hssfWorkbook
=
ExportExcelUtil
.
getHSSFWorkbook
(
title
,
list
,
keys
);
response
.
setContentType
(
"application/octet-stream;charset=ISO8859-1"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
"机顶盒基础信息表.xls"
);
response
.
addHeader
(
"Pargam"
,
"no-cache"
);
response
.
addHeader
(
"Cache-Control"
,
"no-cache"
);
OutputStream
os
=
response
.
getOutputStream
();
hssfWorkbook
.
write
(
os
);
os
.
flush
();
os
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
static
String
getAreaId
(
String
areaId
)
{
if
(
"0000"
.
equals
(
areaId
.
substring
(
2
)))
{
areaId
=
areaId
.
substring
(
0
,
2
);
...
...
src/main/resources/mapper/RunLogMapper.xml
View file @
659e65a0
...
...
@@ -10,20 +10,23 @@
<result
column=
"learning_content_id"
property=
"learningContentId"
/>
<result
column=
"start_time"
property=
"startTime"
/>
<result
column=
"end_time"
property=
"endTime"
/>
<result
column=
"exhibition_board_id"
property=
"exhibitionBoardId"
/>
<result
column=
"org_name"
property=
"orgName"
/>
<result
column=
"learn_name"
property=
"learnName"
/>
<result
column=
"exhibition_board_name"
property=
"exhibitionBoardName"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, mac_addr, organ_id, learning_content_id, start_time, end_time
id, mac_addr, organ_id, learning_content_id, start_time, end_time
,exhibition_board_id
</sql>
<select
id=
"pageList"
resultMap=
"BaseResultMap"
>
SELECT r.*,o.name org_name,l.name learn_name
SELECT r.*,o.name org_name,l.name learn_name
,e.name exhibition_board_name
FROM run_log r
left join t_organ o on o.id = r.organ_id
left join learning_content l on l.id =r.learning_content_id
left join exhibition_board e on e.id =r.exhibition_board_id
where 1=1
<if
test=
" runLog.organId != null and runLog.organId != '' "
>
and r.organ_id = #{runLog.organId}
...
...
src/main/resources/mapper/TBoxOperationMapper.xml
View file @
659e65a0
...
...
@@ -19,6 +19,9 @@
<result
column=
"permanent"
property=
"permanent"
/>
<result
column=
"effective_date"
property=
"effectiveDate"
/>
<result
column=
"exired_date"
property=
"exiredDate"
/>
<result
column=
"num"
property=
"num"
/>
<result
column=
"begin_date"
property=
"beginDate"
/>
<result
column=
"end_date"
property=
"endDate"
/>
</resultMap>
<!-- 通用查询结果列 -->
...
...
@@ -43,11 +46,12 @@
<select
id=
"selectBoxPage"
resultMap=
"BaseResultMap"
>
select b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name organ_name,a.full_name
area_name,u.permanent permanent,
u.effective_date effective_date,u.exired_date exired_date
u.effective_date effective_date,u.exired_date exired_date
,count(r.mac_addr) num
from t_box_operation b
left join t_organ o on b.organ_id = o.id
left join t_user u on u.org_id = b.organ_id and u.type = '3' and u.is_deleted = false
left join t_area a on u.area_id = a.id
left join run_log r on r.mac_addr = b.mac
where 1=1
<if
test=
"user.orgId!= null and user.orgId != '' "
>
and b.organ_id =#{user.orgId}
...
...
@@ -61,6 +65,11 @@
<if
test=
"user.areaName != null and user.areaName != '' "
>
and b.area_id LIKE concat(#{user.areaName}, '%')
</if>
<if
test=
"user.beginDate != null and user.endDate != null "
>
and r.start_time between #{user.beginDate} and #{user.endDate}
</if>
group by r.mac_addr,b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name,a.full_name
,u.permanent,u.effective_date ,u.exired_date
order by b.create_time desc
</select>
...
...
@@ -88,4 +97,34 @@
order by b.create_time desc
</select>
<select
id=
"selectBoxList"
resultMap=
"BaseResultMap"
>
select b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name organ_name,a.full_name
area_name,u.permanent permanent,
u.effective_date effective_date,u.exired_date exired_date,count(r.mac_addr) num
from t_box_operation b
left join t_organ o on b.organ_id = o.id
left join t_user u on u.org_id = b.organ_id and u.type = '3' and u.is_deleted = false
left join t_area a on u.area_id = a.id
left join run_log r on r.mac_addr = b.mac
where 1=1
<if
test=
"user.orgId!= null and user.orgId != '' "
>
and b.organ_id =#{user.orgId}
</if>
<if
test=
"user.areaId!= null and user.areaId != '' "
>
and b.area_id =#{user.areaId}
</if>
<if
test=
"user.orgCode != null and user.orgCode != '' "
>
and o.code LIKE concat(#{user.orgCode}, '%')
</if>
<if
test=
"user.areaName != null and user.areaName != '' "
>
and b.area_id LIKE concat(#{user.areaName}, '%')
</if>
<if
test=
"user.beginDate != null and user.endDate != null "
>
and r.start_time between #{user.beginDate} and #{user.endDate}
</if>
group by r.mac_addr,b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name,a.full_name
,u.permanent,u.effective_date ,u.exired_date
order by b.create_time desc
</select>
</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