Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
3465fe80
Commit
3465fe80
authored
Feb 24, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出标签
parent
d832aad3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
741 additions
and
118 deletions
+741
-118
DataStatisticsController.java
.../cement/business/controller/DataStatisticsController.java
+12
-0
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+190
-15
NormProductionController.java
.../cement/business/controller/NormProductionController.java
+1
-0
DataStatisticsMapper.java
.../wise/sc/cement/business/mapper/DataStatisticsMapper.java
+6
-0
SampleDistributionMapper.java
...e/sc/cement/business/mapper/SampleDistributionMapper.java
+4
-0
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+26
-13
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+41
-26
SampleDistributionMapper.xml
...c/cement/business/mapper/xml/SampleDistributionMapper.xml
+13
-1
SampleDistributionTeamVo.java
...sc/cement/business/model/vo/SampleDistributionTeamVo.java
+6
-0
SampleFlowVo.java
...ava/cn/wise/sc/cement/business/model/vo/SampleFlowVo.java
+49
-0
SampleHandleVo.java
...a/cn/wise/sc/cement/business/model/vo/SampleHandleVo.java
+3
-0
SampleVo.java
...in/java/cn/wise/sc/cement/business/model/vo/SampleVo.java
+4
-0
IDataStatisticsService.java
...se/sc/cement/business/service/IDataStatisticsService.java
+2
-0
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+27
-2
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+96
-19
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+180
-17
PrecipriceServiceImpl.java
...c/cement/business/service/impl/PrecipriceServiceImpl.java
+2
-10
application.yml
cement-business/src/main/resources/application.yml
+2
-2
checkTeam.ftl
cement-business/src/main/resources/templates/checkTeam.ftl
+17
-0
handleSample.ftl
...nt-business/src/main/resources/templates/handleSample.ftl
+14
-0
sampleFlow.ftl
cement-business/src/main/resources/templates/sampleFlow.ftl
+20
-0
设备维修计划.ftl
cement-business/src/main/resources/templates/设备维修计划.ftl
+0
-0
DataStatisticsMapper.xml
...n/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
+26
-13
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/DataStatisticsController.java
View file @
3465fe80
...
...
@@ -199,6 +199,18 @@ public class DataStatisticsController {
}
@ApiOperation
(
"列表导出-检测元素含量分布情况统计"
)
@PostMapping
(
"/exportItemDistribution"
)
public
void
exportItemDistribution
(
@RequestBody
CountItemDistributionQuery
query
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
dataStatisticsService
.
exportItemDistribution
(
query
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"列表导出-检测元素含量分布情况统计{}"
,
e
);
}
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
3465fe80
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NormProductionController.java
View file @
3465fe80
...
...
@@ -157,6 +157,7 @@ public class NormProductionController {
//todo 人员工作统计导出
@GetMapping
(
"/statistics/detail"
)
@ApiOperation
(
"标准产值详情"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.java
View file @
3465fe80
...
...
@@ -71,4 +71,10 @@ public interface DataStatisticsMapper {
ItemDistributionSample
countItemDistributionSample
(
@Param
(
"start"
)
String
startTime
,
@Param
(
"end"
)
String
endTime
,
@Param
(
"origin"
)
String
origin
,
@Param
(
"teamId"
)
Long
teamId
);
List
<
Map
<
String
,
Object
>>
exporItemDistributionList
(
@Param
(
"start"
)
String
startTime
,
@Param
(
"end"
)
String
endTime
,
@Param
(
"origins"
)
List
<
String
>
origins
,
@Param
(
"itemId"
)
Long
itemId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleDistributionMapper.java
View file @
3465fe80
...
...
@@ -37,6 +37,10 @@ public interface SampleDistributionMapper extends BaseMapper<SampleDistribution>
List
<
EntrustSample
>
getSampleDistribution
(
@Param
(
"params"
)
Map
<
String
,
Object
>
param
);
//查询样品流转单 导出
List
<
SampleFlowVo
>
getSampleFlowList
(
Integer
entrustId
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
View file @
3465fe80
...
...
@@ -384,18 +384,6 @@
</select>
<select
id=
"countItemDistributionSample"
resultType=
"cn.wise.sc.cement.business.entity.ItemDistributionSample"
>
SELECT COUNT(sd.team_id) as `count`,t.`name` FROM sample_distribution sd
...
...
@@ -435,7 +423,32 @@
) a GROUP BY a.`key`
</select>
<select
id=
"exporItemDistributionList"
resultType=
"java.util.HashMap"
>
SELECT (@i:=@i+1) as 序号,
COUNT(a.sample_id) as `count`,
`key`
from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
,(select @i:=0)t
WHERE 1=1
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
<if
test=
"origins != null and origins.size()>0"
>
AND s.origin in
<foreach
collection=
"origins"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"itemId != null"
>
AND sd.team_id = #{itemId}
</if>
) a GROUP BY a.`key`
order by 序号
</select>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
3465fe80
...
...
@@ -282,6 +282,46 @@
<include
refid=
"checkWhere"
/>
order by e.update_time desc
</select>
<sql
id=
"checkWhere"
>
<where>
and e.is_delete = 1 and e.status >= 0
<if
test=
"params.entrustCode != null and params.entrustCode != ''"
>
and e.entrust_code like concat('%', #{params.entrustCode}, '%')
</if>
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if
test=
"params.clientId != null"
>
and e.client_id = #{params.clientId}
</if>
<if
test=
"params.clientName != null and params.clientName != ''"
>
and c.name like concat('%', #{params.clientName}, '%')
</if>
<if
test=
"params.status != null"
>
and e.status = #{params.status}
</if>
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(e.entrust_date)
>
= #{params.startDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.entrust_date)
<
= #{params.endDate}
</if>
<if
test=
"params.isUrgent != null"
>
and e.is_urgent = #{params.isUrgent}
</if>
<if
test=
"params.userId != null"
>
and e.user_id = #{params.userId}
</if>
<if
test=
"params.projectType != null and params.projectType != ''"
>
and e.project_type = #{params.projectType}
</if>
</where>
</sql>
<select
id=
"getReportDetail"
resultType=
"cn.wise.sc.cement.business.entity.EntrustReport"
>
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
...
...
@@ -313,32 +353,7 @@
ON esscct.sample_id = s.id
</select>
<sql
id=
"checkWhere"
>
<where>
and e.is_delete = 1 and e.status >= 0
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(e.entrust_date)
>
= #{params.startDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.entrust_date)
<
= #{params.endDate}
</if>
<if
test=
"params.status != null"
>
and e.status = #{params.status}
</if>
<if
test=
"params.clientId != null"
>
and e.client_id = #{params.clientId}
</if>
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if
test=
"params.userId != null"
>
and e.user_id = #{params.userId}
</if>
</where>
</sql>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleDistributionMapper.xml
View file @
3465fe80
...
...
@@ -127,5 +127,17 @@
<include
refid=
"sampleDisWhere"
/>
</select>
<select
id=
"getSampleFlowList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleFlowVo"
>
select
sd.entrust_id as entrustId, e.project_name as projectName, e.project_code as projectCode,
sd.sample_id as sampleId, s.name as sampleName, s.sample_form as sampleForm, s.parallel_code as parallelCode,
sd.user_id as userId, su.name as userName,
DATE(sd.create_time) as createDate
from sample_distribution sd
left join entrust e on e.id = sd.entrust_id
left join sys_user su on su.id = sd.user_id
left join sample s on s.id = sd.sample_id
where sd.entrust_id = #{entrustId}
group by sd.sample_id,sd.user_id
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleDistributionTeamVo.java
View file @
3465fe80
...
...
@@ -19,6 +19,12 @@ public class SampleDistributionTeamVo {
@ApiModelProperty
(
"派发表id"
)
private
Integer
distributionId
;
@ApiModelProperty
(
"检测组id"
)
private
Integer
teamGroupId
;
@ApiModelProperty
(
"检测组名称"
)
private
String
teamGroupName
;
@ApiModelProperty
(
"检测项id"
)
private
Integer
teamId
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleFlowVo.java
0 → 100644
View file @
3465fe80
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDate
;
/**
* @description:
* @author: ztw
* @create: 2021-2-24 14:58
**/
@Data
@ApiModel
(
"委托-样品流转单Vo"
)
public
class
SampleFlowVo
{
@ApiModelProperty
(
"委托表Id"
)
private
Integer
entrustId
;
@ApiModelProperty
(
"项目名称"
)
private
String
projectName
;
@ApiModelProperty
(
"项目编号"
)
private
String
projectCode
;
@ApiModelProperty
(
"样品表Id"
)
private
Integer
sampleId
;
@ApiModelProperty
(
"样品名"
)
private
String
sampleName
;
@ApiModelProperty
(
"样品状态(粉、块状)"
)
private
String
sampleForm
;
@ApiModelProperty
(
"平行样编号"
)
private
String
parallelCode
;
@ApiModelProperty
(
"检测人员id"
)
private
Integer
userId
;
@ApiModelProperty
(
"检测人员姓名"
)
private
String
userName
;
@ApiModelProperty
(
"日期"
)
private
String
createDate
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleHandleVo.java
View file @
3465fe80
...
...
@@ -72,4 +72,7 @@ public class SampleHandleVo {
@ApiModelProperty
(
" 状态值(0未接受,1接受,2完成)"
)
private
String
statusValue
;
@ApiModelProperty
(
" 状态值(0未接受,1接受,2完成)"
)
private
LocalDateTime
createTime
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleVo.java
View file @
3465fe80
...
...
@@ -69,6 +69,10 @@ public class SampleVo {
@ApiModelProperty
(
"检测组列表"
)
private
List
<
SampleTeamGroupVo
>
sampleTeamGroupVoList
;
@ApiModelProperty
(
"检测项目列表-委托派发详情使用"
)
private
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
;
//样品管理列表信息
@ApiModelProperty
(
"样品登记操作人id"
)
private
Integer
operatorId
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IDataStatisticsService.java
View file @
3465fe80
...
...
@@ -58,4 +58,6 @@ public interface IDataStatisticsService {
* @return 返回的统计
*/
BaseResponse
<
Page
<
ItemDistributionVo
>>
countItemDistribution
(
CountItemDistributionQuery
query
,
HttpServletResponse
response
);
void
exportItemDistribution
(
CountItemDistributionQuery
query
,
String
fileName
,
HttpServletResponse
response
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
3465fe80
...
...
@@ -87,8 +87,10 @@ public interface IEntrustService extends IService<Entrust> {
//校核
BaseResponse
<
IPage
<
EntrustVo
>>
getCheckPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
);
BaseResponse
<
IPage
<
EntrustVo
>>
getCheckPage
(
PageQuery
pageQuery
,
String
entrustCode
,
String
projectName
,
String
projectCode
,
Integer
clientId
,
String
clientName
,
Integer
status
,
String
startDate
,
String
endDate
,
Integer
isUrgent
);
BaseResponse
<
CheckVo
>
getCheckList
(
Integer
id
);
...
...
@@ -146,6 +148,8 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
List
<
SampleHandleVo
>>
getSampleHandleDtail
(
Integer
id
);
BaseResponse
<
List
<
SampleVo
>>
getSampleCheckDetail
(
Integer
id
);
BaseResponse
<
List
<
SampleVo
>>
getSampleCheckDtail
(
Integer
id
);
/**
...
...
@@ -163,4 +167,25 @@ public interface IEntrustService extends IService<Entrust> {
* @return 工业特征
*/
List
<
IndustrialReport
>
getSampleIndustrialCheck
(
Integer
entrustId
);
/**
* 导出样品流转单
* @param entrustId
* @return
*/
BaseResponse
<
Map
<
String
,
Object
>>
getSampleFlowList
(
Integer
entrustId
);
/**
* 查看样品标签
* @param entrustId
* @return
*/
BaseResponse
<
Map
<
String
,
Object
>>
getSampleLabelList
(
Integer
entrustId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
3465fe80
...
...
@@ -354,21 +354,6 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
/**
* 进行中任务数量统计
* @return
...
...
@@ -627,10 +612,6 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
.
countItemDistribution
(
page
,
startTime
,
endTime
,
origins
,
itemId
);
List
<
ItemDistribution
>
records
=
list
.
getRecords
();
if
(
records
.
size
()
==
0
)
{
return
BaseResponse
.
errorMsg
(
"没找到数据~"
);
}
List
<
ItemDistributionVo
>
rtsRecords
=
new
ArrayList
<>(
records
.
size
());
//组装检查项统计和按照样品统计
...
...
@@ -665,4 +646,100 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
return
BaseResponse
.
okData
(
rts
);
}
/**
* 元素含量分布统计-列表导出
* @param query
* @param fileName
* @param response
*/
@Override
public
void
exportItemDistribution
(
CountItemDistributionQuery
query
,
String
fileName
,
HttpServletResponse
response
){
String
startTime
=
query
.
getStartTime
();
String
endTime
=
query
.
getEndTime
();
Long
itemId
=
query
.
getItemId
();
List
<
String
>
origins
=
query
.
getOrigins
();
List
<
Map
<
String
,
Object
>>
list
=
dataStatisticsMapper
.
exporItemDistributionList
(
startTime
,
endTime
,
origins
,
itemId
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
String
[]
headers
=
new
String
[
5
];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"检测元素"
;
headers
[
2
]
=
"地区"
;
headers
[
3
]
=
"元素含量"
;
headers
[
4
]
=
"样品数量"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
String
objj
=
m
.
get
(
"key"
).
toString
();
String
[]
split
=
objj
.
split
(
","
);
String
teamId
=
split
[
0
];
String
origin
=
split
[
1
];
//检测项按样品分布统计
ItemDistributionSample
sample
=
dataStatisticsMapper
.
countItemDistributionSample
(
startTime
,
endTime
,
origin
,
Long
.
parseLong
(
teamId
));
ItemDistributionVo
vo
=
new
ItemDistributionVo
();
vo
.
setOrigin
(
origin
);
vo
.
setItemName
(
sample
.
getName
());
vo
.
setSampleCount
(
sample
.
getCount
());
vo
.
setItemCount
(
Integer
.
valueOf
(
m
.
get
(
"count"
).
toString
()));
if
(
StringUtils
.
isEmpty
(
startTime
)
||
StringUtils
.
isEmpty
(
endTime
)){
vo
.
setTime
(
null
);
}
else
{
vo
.
setTime
(
startTime
+
"_"
+
endTime
);
}
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
""
;
if
(
j
==
1
){
objects
[
1
]
=
vo
.
getItemName
();
}
else
if
(
j
==
2
){
objects
[
2
]
=
vo
.
getOrigin
();
}
else
if
(
j
==
3
){
objects
[
3
]
=
vo
.
getItemCount
();
}
else
if
(
j
==
4
){
objects
[
4
]
=
vo
.
getSampleCount
();
}
else
{
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
)
{
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"元素含量分布统计-列表导出"
:
fileName
,
headers
,
datas
,
response
);
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
3465fe80
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PrecipriceServiceImpl.java
View file @
3465fe80
...
...
@@ -614,16 +614,8 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
rts
.
setCementCode
(
sample
.
getCementCode
());
}
}
//增加项目信息
if
(
preciprice
.
getEntrustId
()
!=
null
){
Entrust
entrust
=
entrustMapper
.
selectById
(
preciprice
.
getEntrustId
());
if
(
entrust
!=
null
&&
entrust
.
getProjectId
()
!=
null
){
Project
project
=
projectMapper
.
selectById
(
entrust
.
getProjectId
());
if
(
project
!=
null
&&
project
.
getName
()
!=
null
){
rts
.
setProjectName
(
project
.
getName
());
}
}
}
//todo 增加项目信息
rts
.
setProjectName
(
preciprice
.
getEntrustName
());
rts
.
setAssessId
(
preciprice
.
getTargetId
());
rts
.
setWorkTimeCoefficient
(
preciprice
.
getPreciprice
());
rts
.
setCheckTime
(
getDateTimeOfTimestamp
(
preciprice
.
getCreateTime
()));
...
...
cement-business/src/main/resources/application.yml
View file @
3465fe80
...
...
@@ -7,8 +7,8 @@ spring:
profiles
:
active
:
dev
datasource
:
# 192.168.110.85 admin!@#123
url
:
jdbc:mysql://192.168.110.85:3306/sinoma_
tcdri
?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
# 192.168.110.85 admin!@#123
sinoma_zhengshiData
url
:
jdbc:mysql://192.168.110.85:3306/sinoma_
zhengshiData
?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
# url: jdbc:mysql://192.168.110.85:3306/sinoma_bangye?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
# url: jdbc:mysql://47.93.148.213:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username
:
root
...
...
cement-business/src/main/resources/templates/checkTeam.ftl
0 → 100644
View file @
3465fe80
This diff is collapsed.
Click to expand it.
cement-business/src/main/resources/templates/handleSample.ftl
0 → 100644
View file @
3465fe80
This diff is collapsed.
Click to expand it.
cement-business/src/main/resources/templates/sampleFlow.ftl
0 → 100644
View file @
3465fe80
This diff is collapsed.
Click to expand it.
cement-business/src/main/resources/templates/设备维修计划.ftl
View file @
3465fe80
This diff is collapsed.
Click to expand it.
cement-business/target/classes/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
View file @
3465fe80
...
...
@@ -384,18 +384,6 @@
</select>
<select
id=
"countItemDistributionSample"
resultType=
"cn.wise.sc.cement.business.entity.ItemDistributionSample"
>
SELECT COUNT(sd.team_id) as `count`,t.`name` FROM sample_distribution sd
...
...
@@ -435,7 +423,32 @@
) a GROUP BY a.`key`
</select>
<select
id=
"exporItemDistributionList"
resultType=
"java.util.HashMap"
>
SELECT (@i:=@i+1) as 序号,
COUNT(a.sample_id) as `count`,
`key`
from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
,(select @i:=0)t
WHERE 1=1
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
<if
test=
"origins != null and origins.size()>0"
>
AND s.origin in
<foreach
collection=
"origins"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"itemId != null"
>
AND sd.team_id = #{itemId}
</if>
) a GROUP BY a.`key`
order by 序号
</select>
...
...
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