Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
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
bd8d78b9
Commit
bd8d78b9
authored
Jan 19, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2222
parent
9b5cffe2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
467 additions
and
15 deletions
+467
-15
ChinastdController.java
...ise/sc/cement/business/controller/ChinastdController.java
+1
-0
DataStatisticsController.java
.../cement/business/controller/DataStatisticsController.java
+48
-3
NormProduction.java
...ava/cn/wise/sc/cement/business/entity/NormProduction.java
+2
-0
DataStatisticsMapper.java
.../wise/sc/cement/business/mapper/DataStatisticsMapper.java
+10
-1
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+105
-1
DataStatisticsTeamVo.java
...ise/sc/cement/business/model/vo/DataStatisticsTeamVo.java
+35
-0
IDataStatisticsService.java
...se/sc/cement/business/service/IDataStatisticsService.java
+7
-1
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+73
-5
PrecipriceServiceImpl.java
...c/cement/business/service/impl/PrecipriceServiceImpl.java
+12
-0
DataStatisticsMapper.xml
...n/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
+174
-4
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ChinastdController.java
View file @
bd8d78b9
...
...
@@ -120,6 +120,7 @@ public class ChinastdController {
@PostMapping
(
"/run/sh"
)
@ApiOperation
(
"手动触发更新"
)
public
void
run
()
throws
IOException
{
System
.
out
.
println
(
"************标准查新************"
);
final
String
shUrl
=
"/usr/bin/python3 /opt/chinastd_spider.py"
;
Runtime
.
getRuntime
().
exec
(
shUrl
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/DataStatisticsController.java
View file @
bd8d78b9
...
...
@@ -71,10 +71,15 @@ public class DataStatisticsController {
}
@ApiOperation
(
value
=
"统计概览-项目进展统计"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"cycle"
,
value
=
"统计周期1:本周 2:本月 3:本年"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/countEntrustStatus"
)
public
BaseResponse
countEntrustStatus
()
{
public
BaseResponse
countEntrustStatus
(
Integer
cycle
,
String
startDate
,
String
endDate
)
{
try
{
return
dataStatisticsService
.
countEntrustStatus
();
return
dataStatisticsService
.
countEntrustStatus
(
cycle
,
startDate
,
endDate
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"统计概览-项目进展统计{}"
,
e
);
}
...
...
@@ -82,6 +87,23 @@ public class DataStatisticsController {
}
@ApiOperation
(
value
=
"项目进展统计-列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"type"
,
value
=
"类型1:按时间 2:按地区"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"cycle"
,
value
=
"统计周期1:本周 2:本月 3:本年"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/countEntrustPage"
)
public
BaseResponse
countEntrustPage
(
PageQuery
pageQuery
)
{
try
{
return
dataStatisticsService
.
countEntrustPage
(
pageQuery
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"项目进展统计-列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"统计概览-进行中任务数量统计"
)
@GetMapping
(
"/countTaskIng"
)
public
BaseResponse
countTaskIng
(
PageQuery
pageQuery
)
{
...
...
@@ -106,7 +128,30 @@ public class DataStatisticsController {
}
@ApiOperation
(
"导出检测项分布统计"
)
@ApiOperation
(
value
=
"检测项数量统计-检测项数量统计"
)
@GetMapping
(
"/countTeamDetail"
)
public
BaseResponse
countTeamDetail
(
Integer
cycle
,
String
startDate
,
String
endDate
)
{
try
{
return
dataStatisticsService
.
countTeamDetail
(
cycle
,
startDate
,
endDate
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测项数量统计-检测项数量统计{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"检测项数量统计-列表"
)
@GetMapping
(
"/countTeamList"
)
public
BaseResponse
countTeamList
()
{
try
{
return
dataStatisticsService
.
countTeamList
();
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测项数量统计-列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"检测项分布统计"
)
@PostMapping
(
"/item/download"
)
public
BaseResponse
<
Page
<
ItemDistributionVo
>>
downloadItemDistribution
(
@RequestBody
CountItemDistributionQuery
query
,
HttpServletResponse
response
)
{
return
dataStatisticsService
.
countItemDistribution
(
query
,
response
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/NormProduction.java
View file @
bd8d78b9
...
...
@@ -122,6 +122,8 @@ public class NormProduction implements Serializable {
private
BigDecimal
workTimeCoefficient
;
private
Integer
type
;
private
String
groupTeamName
;
private
String
cementCode
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.java
View file @
bd8d78b9
...
...
@@ -4,6 +4,7 @@ import cn.wise.sc.cement.business.entity.Client;
import
cn.wise.sc.cement.business.entity.ItemDistribution
;
import
cn.wise.sc.cement.business.entity.ItemDistributionSample
;
import
cn.wise.sc.cement.business.model.vo.ClientVo
;
import
cn.wise.sc.cement.business.model.vo.DataStatisticsTeamVo
;
import
cn.wise.sc.cement.business.model.vo.DataStatisticsVo
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
...
@@ -29,7 +30,11 @@ public interface DataStatisticsMapper {
List
<
DataStatisticsVo
>
countTeamByOrigin
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
DataStatisticsVo
>
countEntrustStatus
();
List
<
DataStatisticsVo
>
countEntrustStatus
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
DataStatisticsVo
>
countEntrustType
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
IPage
<
EntrustVo
>
countEntrustPage
(
@Param
(
"page"
)
Page
page
);
IPage
<
DataStatisticsVo
>
countHandlePage
(
@Param
(
"page"
)
Page
page
);
...
...
@@ -37,6 +42,10 @@ public interface DataStatisticsMapper {
List
<
DataStatisticsVo
>
countTeamIng
();
List
<
DataStatisticsVo
>
countTeam
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
DataStatisticsTeamVo
>
countTeamList
();
IPage
<
ItemDistribution
>
countItemDistribution
(
@Param
(
"page"
)
Page
<
ItemDistribution
>
page
,
@Param
(
"start"
)
Date
startTime
,
@Param
(
"end"
)
Date
endTime
,
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
View file @
bd8d78b9
...
...
@@ -65,9 +65,76 @@
) as name,
count(*) as value
FROM entrust e
group by e.status
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( e.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(e.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
group by e.status
</select>
<select
id=
"countEntrustType"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
select e.project_type, count(*)
from entrust e
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( e.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(e.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
group by e.project_type
</select>
<select
id=
"countEntrustPage"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.*, c.name as clientName, su.name as userName,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as statusValue
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
where e.status != 0 and e.project_type is not null
order by create_time desc
</select>
<select
id=
"countHandlePage"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT su.name as name, count(*) as value FROM sample_handle sh
left join sys_user su on su.id = sh.user_id
...
...
@@ -89,6 +156,43 @@
group by sd.team_id
</select>
<select
id=
"countTeam"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT t.name as name, count(*) as value FROM sample_distribution sd
left join team t on t.id = sd.team_id
where 1=1
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
group by sd.team_id
</select>
<select
id=
"countTeamList"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsTeamVo"
>
SELECT DISTINCT t.name as teamName, e.project_code as projectCode,
e.entrust_code as entrustCode, e.entrust_date as entrustDate,
e.sample_num as sampleNum
FROM sample_distribution sd
left join sample s on s.id = sd.sample_id
left join entrust e on e.id = s.entrust_id
left join team t on t.id = sd.team_id
</select>
<select
id=
"countItemDistributionSample"
resultType=
"cn.wise.sc.cement.business.entity.ItemDistributionSample"
>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/DataStatisticsTeamVo.java
0 → 100644
View file @
bd8d78b9
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-01-08
**/
@Data
@ApiModel
(
"数据统计-检测项数量统计列表"
)
public
class
DataStatisticsTeamVo
{
@ApiModelProperty
(
"检测项目"
)
private
String
teamName
;
@ApiModelProperty
(
"项目编号"
)
private
String
projectCode
;
@ApiModelProperty
(
"委托编号"
)
private
String
entrustCode
;
@ApiModelProperty
(
"委托日期"
)
private
LocalDate
entrustDate
;
@ApiModelProperty
(
"样品数量"
)
private
String
sampleNum
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IDataStatisticsService.java
View file @
bd8d78b9
...
...
@@ -32,12 +32,18 @@ public interface IDataStatisticsService {
BaseResponse
<
List
<
DataStatisticsVo
>>
countTeamByOrigin
(
Integer
cycle
,
String
startDate
,
String
endDate
);
BaseResponse
<
Map
<
String
,
Object
>>
countEntrustStatus
();
BaseResponse
<
Map
<
String
,
Object
>>
countEntrustStatus
(
Integer
cycle
,
String
startDate
,
String
endDate
);
BaseResponse
<
IPage
<
EntrustVo
>>
countEntrustPage
(
PageQuery
pageQuery
);
BaseResponse
<
Map
<
String
,
Object
>>
countTaskIng
(
PageQuery
pageQuery
);
BaseResponse
<
List
<
DataStatisticsVo
>>
countTeamIng
();
BaseResponse
<
List
<
DataStatisticsVo
>>
countTeamDetail
(
Integer
cycle
,
String
startDate
,
String
endDate
);
BaseResponse
<
List
<
DataStatisticsTeamVo
>>
countTeamList
();
/**
* 导出检查项分布统计
* @param query 请求参数
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
bd8d78b9
...
...
@@ -156,6 +156,25 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
return
BaseResponse
.
okData
(
listResult
);
}
/**
* 检测项统计-列表
* @param cycle
* @param startDate
* @param endDate
* @return
*/
/*public BaseResponse<List<Object>> countTeamByTime(Integer cycle, String startDate, String endDate){
}*/
/**
* 检测项数量统计-按地区
*
...
...
@@ -178,22 +197,42 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
* @return
*/
@Override
public
BaseResponse
<
Map
<
String
,
Object
>>
countEntrustStatus
(){
public
BaseResponse
<
Map
<
String
,
Object
>>
countEntrustStatus
(
Integer
cycle
,
String
startDate
,
String
endDate
){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"cycle"
,
cycle
);
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
QueryWrapper
<
Entrust
>
entrustQw
=
new
QueryWrapper
<>();
Integer
sum_counts
=
entrustService
.
count
(
entrustQw
);
if
(
sum_counts
==
null
){
map
.
put
(
"sumCounts"
,
"0"
);
map
.
put
(
"list"
,
null
);
map
.
put
(
"statusList"
,
null
);
map
.
put
(
"typeList"
,
null
);
}
else
{
List
<
DataStatisticsVo
>
list
=
dataStatisticsMapper
.
countEntrustStatus
();
List
<
DataStatisticsVo
>
statusList
=
dataStatisticsMapper
.
countEntrustStatus
(
params
);
List
<
DataStatisticsVo
>
typeList
=
dataStatisticsMapper
.
countEntrustStatus
(
params
);
map
.
put
(
"sumCounts"
,
sum_counts
);
map
.
put
(
"list"
,
list
);
map
.
put
(
"statusList"
,
statusList
);
map
.
put
(
"typeList"
,
typeList
);
}
return
BaseResponse
.
okData
(
map
);
}
/**
* 项目进展统计-列表
* @param pageQuery
* @return
*/
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
countEntrustPage
(
PageQuery
pageQuery
){
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
dataStatisticsMapper
.
countEntrustPage
(
page
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 进行中任务数量统计
...
...
@@ -232,6 +271,35 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
return
BaseResponse
.
okData
(
list
);
}
/**
* 检测项数量统计
* @return
*/
@Override
public
BaseResponse
<
List
<
DataStatisticsVo
>>
countTeamDetail
(
Integer
cycle
,
String
startDate
,
String
endDate
){
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"cycle"
,
cycle
);
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
List
<
DataStatisticsVo
>
list
=
dataStatisticsMapper
.
countTeam
(
params
);
return
BaseResponse
.
okData
(
list
);
}
/**
* 检测项目数量统计-列表
* @return
*/
@Override
public
BaseResponse
<
List
<
DataStatisticsTeamVo
>>
countTeamList
(){
List
<
DataStatisticsTeamVo
>
list
=
dataStatisticsMapper
.
countTeamList
();
return
BaseResponse
.
okData
(
list
);
}
@Override
public
BaseResponse
<
Page
<
ItemDistributionVo
>>
countItemDistribution
(
CountItemDistributionQuery
query
,
HttpServletResponse
response
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PrecipriceServiceImpl.java
View file @
bd8d78b9
...
...
@@ -20,6 +20,7 @@ import cn.wise.sc.cement.business.entity.SysUser;
import
cn.wise.sc.cement.business.entity.TeamGroup
;
import
cn.wise.sc.cement.business.mapper.EntrustMapper
;
import
cn.wise.sc.cement.business.mapper.PrecipriceMapper
;
import
cn.wise.sc.cement.business.mapper.SampleMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
...
...
@@ -41,6 +42,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -100,6 +102,9 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
ISampleDistributionService
iSampleDistributionService
;
@Resource
PrecipriceMapper
precipriceMapper
;
@Resource
private
SampleMapper
sampleMapper
;
public
PrecipriceServiceImpl
(
EntrustMapper
iEntrustService
,
ISampleService
iSampleService
,
...
...
@@ -605,10 +610,17 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
}
private
NormProduction
.
NormProductionDetail
preciprice2NormDetail
(
Preciprice
preciprice
)
{
NormProduction
.
NormProductionDetail
rts
=
new
NormProduction
.
NormProductionDetail
();
BeanUtil
.
copyProperties
(
preciprice
,
rts
);
if
(
rts
.
getSampleId
()
!=
null
){
Sample
sample
=
sampleMapper
.
selectById
(
rts
.
getSampleId
());
if
(
sample
!=
null
){
rts
.
setCementCode
(
sample
.
getCementCode
());
}
}
rts
.
setAssessId
(
preciprice
.
getTargetId
());
rts
.
setWorkTimeCoefficient
(
preciprice
.
getPreciprice
());
rts
.
setCheckTime
(
getDateTimeOfTimestamp
(
preciprice
.
getCreateTime
()));
...
...
cement-business/target/classes/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
View file @
bd8d78b9
...
...
@@ -3,9 +3,18 @@
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.DataStatisticsMapper"
>
<select
id=
"countTeamByTime"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT DATE_FORMAT(sd.create_time,'%Y-%m') as name, count(sd.id) as value
SELECT
DATE_FORMAT(sd.create_time,'%Y-%m') as name, count(sd.id) as value
FROM sample_distribution sd
where sd.finish_time is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle = 3 "
>
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(sd.create_time)
>
= #{params.startDate}
</if>
...
...
@@ -20,14 +29,171 @@
FROM sample_distribution sd
left join sample s on s.id = sd.sample_id
where sd.finish_time is not null
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(sd.create_time)
>
= #{params.startDate}
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
group by s.origin
</select>
<select
id=
"countEntrustStatus"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT (
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as name,
count(*) as value
FROM entrust e
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( e.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(e.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
group by e.status
</select>
<select
id=
"countEntrustType"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
select e.project_type, count(*)
from entrust e
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( e.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(e.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
group by e.project_type
</select>
<select
id=
"countEntrustPage"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.*, c.name as clientName, su.name as userName,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as statusValue
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
where e.status != 0 and e.project_type is not null
order by create_time desc
</select>
<select
id=
"countHandlePage"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT su.name as name, count(*) as value FROM sample_handle sh
left join sys_user su on su.id = sh.user_id
where sh.status != 2
group by sh.user_id
</select>
<select
id=
"countDistributionPage"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT su.name as name, count(*) as value FROM sample_distribution sd
left join sys_user su on su.id = sd.user_id
where sd.status != 2
group by sd.user_id
</select>
<select
id=
"countTeamIng"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT t.name as name, count(*) as value FROM sample_distribution sd
left join team t on t.id = sd.team_id
where sd.status != 2
group by sd.team_id
</select>
<select
id=
"countTeam"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT t.name as name, count(*) as value FROM sample_distribution sd
left join team t on t.id = sd.team_id
where 1=1
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
group by sd.team_id
</select>
<select
id=
"countTeamList"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsTeamVo"
>
SELECT DISTINCT t.name as teamName, e.project_code as projectCode,
e.entrust_code as entrustCode, e.entrust_date as entrustDate,
e.sample_num as sampleNum
FROM sample_distribution sd
left join sample s on s.id = sd.sample_id
left join entrust e on e.id = s.entrust_id
left join team t on t.id = sd.team_id
</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
...
...
@@ -38,10 +204,11 @@
<if
test=
"origin != null and origin != '' "
>
AND s.origin = #{origin}
</if>
<if
test=
"teamId != '' and teamId != null"
>
<if
test=
"teamId != '' and teamId != null
"
>
AND sd.team_id = #{teamId}
</if>
</select>
<select
id=
"countItemDistribution"
resultType=
"cn.wise.sc.cement.business.entity.ItemDistribution"
>
SELECT 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
...
...
@@ -62,4 +229,7 @@
</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