Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
75421801
Commit
75421801
authored
Nov 15, 2021
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、执行修改批处理优化
2、修改查询数据走索引
parent
f9fc005e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
3 deletions
+95
-3
src/main/java/cn/timer/api/controller/kqgl/AttController.java
+0
-0
src/main/java/cn/timer/api/service/KqglAssoDkjlService.java
+25
-0
src/main/java/cn/timer/api/service/impl/KqglAssoDkjlServiceImpl.java
+66
-0
src/main/resources/mapping/kqgl/PunchRecordMapper.xml
+4
-3
No files found.
src/main/java/cn/timer/api/controller/kqgl/AttController.java
View file @
75421801
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/service/KqglAssoDkjlService.java
0 → 100644
View file @
75421801
package
cn
.
timer
.
api
.
service
;
import
cn.timer.api.bean.kqgl.PunchCardDetails
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
java.util.List
;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/11/12
*/
public
interface
KqglAssoDkjlService
{
/**
* 打卡记录修改批处理
* @param entityList
* @return
*/
void
updateKqglAssoDkjlById
(
List
<
PunchRecord
>
entityList
);
/**
* 打卡明细修改批处理
* @param entityList
* @return
*/
void
updateKqglAssoDkmxById
(
List
<
PunchCardDetails
>
entityList
);
}
src/main/java/cn/timer/api/service/impl/KqglAssoDkjlServiceImpl.java
0 → 100644
View file @
75421801
package
cn
.
timer
.
api
.
service
.
impl
;
import
cn.timer.api.bean.kqgl.PunchCardDetails
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
cn.timer.api.bean.kqmk.KqglAssoDkjl
;
import
cn.timer.api.dao.kqgl.PunchCardDetailsMapper
;
import
cn.timer.api.dao.kqgl.PunchRecordMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoDkjlMapper
;
import
cn.timer.api.service.KqglAssoDkjlService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.session.ExecutorType
;
import
org.apache.ibatis.session.SqlSession
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Collection
;
import
java.util.List
;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2021/11/12
*/
@Slf4j
@Service
public
class
KqglAssoDkjlServiceImpl
implements
KqglAssoDkjlService
{
@Autowired
private
SqlSessionFactory
sqlSessionFactory
;
@Transactional
@Override
public
void
updateKqglAssoDkjlById
(
List
<
PunchRecord
>
entityList
)
{
SqlSession
session
=
sqlSessionFactory
.
openSession
(
ExecutorType
.
BATCH
,
false
);
PunchRecordMapper
mapper
=
session
.
getMapper
(
PunchRecordMapper
.
class
);
for
(
int
i
=
0
;
i
<
entityList
.
size
();
i
++)
{
mapper
.
updateByPrimaryKeySelective
(
entityList
.
get
(
i
));
//每100条提交一次
if
(
i
%
100
==
99
){
session
.
commit
();
session
.
clearCache
();
}
}
session
.
commit
();
session
.
clearCache
();
}
@Override
public
void
updateKqglAssoDkmxById
(
List
<
PunchCardDetails
>
entityList
)
{
SqlSession
session
=
sqlSessionFactory
.
openSession
(
ExecutorType
.
BATCH
,
false
);
PunchCardDetailsMapper
mapper
=
session
.
getMapper
(
PunchCardDetailsMapper
.
class
);
for
(
int
i
=
0
;
i
<
entityList
.
size
();
i
++)
{
mapper
.
updateByPrimaryKeySelective
(
entityList
.
get
(
i
));
//每100条提交一次
if
(
i
%
100
==
99
){
session
.
commit
();
session
.
clearCache
();
}
}
session
.
commit
();
session
.
clearCache
();
}
}
src/main/resources/mapping/kqgl/PunchRecordMapper.xml
View file @
75421801
...
@@ -410,10 +410,11 @@
...
@@ -410,10 +410,11 @@
where dkjl.attime
>
= #{start}
where dkjl.attime
>
= #{start}
and dkjl.attime
<
= #{end}
and dkjl.attime
<
= #{end}
and dkjl.user_id = #{userId,jdbcType=INTEGER}
and dkjl.user_id = #{userId,jdbcType=INTEGER}
and dkjl.`status`
!=
0
and dkjl.`status`
>
0
and dkjl.sort
!=
0
and dkjl.sort
>
0
and dkjl.qyid = #{qyid}
and dkjl.qyid = #{qyid}
and dkjl.dkmxid != 0
and dkjl.dkmxid > 0
and dkjl.id > 0
ORDER BY dkjl.id ASC
ORDER BY dkjl.id ASC
</select>
</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