Commit 344af6bf authored by fangxinjiang's avatar fangxinjiang

实缴查询&实缴导入count查询优化-fxj

parent 0987d6e9
...@@ -135,13 +135,10 @@ public class CustomerBusinessContoller { ...@@ -135,13 +135,10 @@ public class CustomerBusinessContoller {
if(mSetttleCustomerUserService.saveBatch(mSetttleCustomerUser.getList())){ if(mSetttleCustomerUserService.saveBatch(mSetttleCustomerUser.getList())){
//清除用户缓存 //清除用户缓存
R<SysUser> simpleUser = upmsDaprUtils.getSimpleUser(userId); R<SysUser> simpleUser = upmsDaprUtils.getSimpleUser(userId);
log.info("清除b端结算主体缓存开始");
if(null != simpleUser && null != simpleUser.getData()){ if(null != simpleUser && null != simpleUser.getData()){
SysUser user = simpleUser.getData(); SysUser user = simpleUser.getData();
log.info("清除b端结算主体缓存: "+ ServiceNameConstants.UMPS_SERVICE + "_user_details::" + user.getUsername());
redisUtil.remove(ServiceNameConstants.UMPS_SERVICE + "_user_details::" + user.getUsername()); redisUtil.remove(ServiceNameConstants.UMPS_SERVICE + "_user_details::" + user.getUsername());
if( Common.isNotNull(user.getPhone())){ if( Common.isNotNull(user.getPhone())){
log.info("清除b端结算主体缓存: "+ ServiceNameConstants.UMPS_SERVICE + "_user_details_phone::" + user.getPhone());
redisUtil.remove(ServiceNameConstants.UMPS_SERVICE + "_user_details_phone::" + user.getPhone()); redisUtil.remove(ServiceNameConstants.UMPS_SERVICE + "_user_details_phone::" + user.getPhone());
} }
// 清空userinfo // 清空userinfo
......
...@@ -174,7 +174,6 @@ public class FileUploadServiceImpl implements FileUploadService { ...@@ -174,7 +174,6 @@ public class FileUploadServiceImpl implements FileUploadService {
TAttaInfo attaInfo; TAttaInfo attaInfo;
URL url; URL url;
if (flag) { if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
attaInfo = initUnitAttaForInsert(fileName, key, 0); attaInfo = initUnitAttaForInsert(fileName, key, 0);
attaInfo.setRelationType(String.valueOf(type)); attaInfo.setRelationType(String.valueOf(type));
try { try {
......
...@@ -108,7 +108,7 @@ public class TPaymentInfoController { ...@@ -108,7 +108,7 @@ public class TPaymentInfoController {
if (null != res){ if (null != res){
return res; return res;
} }
return new R<>(tPaymentInfoService.getTPaymentInfoNewPage(page, tPaymentInfo)); return tPaymentInfoService.getTPaymentInfoNewPage(page, tPaymentInfo);
} }
/** /**
* 实缴查询详情 * 实缴查询详情
......
...@@ -50,7 +50,7 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> { ...@@ -50,7 +50,7 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
* @param tPaymentInfo 缴费库 * @param tPaymentInfo 缴费库
* @return * @return
*/ */
IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo); R<IPage<TPaymentInfoNewVo>> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
/** /**
* 缴费库查询详情 * 缴费库查询详情
......
...@@ -188,10 +188,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -188,10 +188,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @return * @return
*/ */
@Override @Override
public IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) { public R<IPage<TPaymentInfoNewVo>> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
//如果是含身份证查询直接查询走索引,无需走特殊处理逻辑,身份证查询量不会大 //如果是含身份证查询直接查询走索引,无需走特殊处理逻辑,身份证查询量不会大
if (Common.isNotNull(tPaymentInfo.getEmpIdcard())){ if (Common.isNotNull(tPaymentInfo.getEmpIdcard())){
return baseMapper.getTPaymentInfoNewPage(page, tPaymentInfo); return R.ok(baseMapper.getTPaymentInfoNewPage(page, tPaymentInfo));
} }
Page<TPaymentInfoNewVo> pageNew = new Page<>(); Page<TPaymentInfoNewVo> pageNew = new Page<>();
pageNew.setSize(page.getSize()); pageNew.setSize(page.getSize());
...@@ -210,7 +210,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -210,7 +210,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (totalCount > ((page.getCurrent() - 1) * page.getSize())) { if (totalCount > ((page.getCurrent() - 1) * page.getSize())) {
pageNew.setRecords(getPageData(tPaymentInfo,pageNew,totalCount)); pageNew.setRecords(getPageData(tPaymentInfo,pageNew,totalCount));
} }
return pageNew; return R.ok(pageNew);
} }
/** /**
* @Author fxj * @Author fxj
...@@ -5425,7 +5425,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -5425,7 +5425,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
requestId = RedisDistributedLock.getLock(keyTemp,"120"); requestId = RedisDistributedLock.getLock(keyTemp,"120");
if (Common.isNotNull(requestId)) { if (Common.isNotNull(requestId)) {
//查询数据 //查询数据
return new R<>(this.getTPaymentInfoNewPage(page, tPaymentInfo)); return this.getTPaymentInfoNewPage(page, tPaymentInfo);
} else { } else {
return R.failed(ResultConstants.NO_GETLOCK_DATA_SEARCH); return R.failed(ResultConstants.NO_GETLOCK_DATA_SEARCH);
} }
......
...@@ -3881,57 +3881,48 @@ ...@@ -3881,57 +3881,48 @@
) z GROUP BY z.EMP_ID ) z GROUP BY z.EMP_ID
</select> </select>
<select id="selectCountPaymentSearchInfoSocial" resultType="java.lang.Integer"> <select id="selectCountPaymentSearchInfoSocial" resultType="java.lang.Integer">
select count(1) as 'count' from (
SELECT SELECT
<!--<if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != '' and tPaymentInfo.socialHousehold == null"> count(1)
distinct a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
</if>
<if test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''">
distinct a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
</if>-->
<choose>
<when test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != '' and tPaymentInfo.socialHousehold == null">
COUNT(DISTINCT CONCAT(a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH)) as 'count'
</when>
<when test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''">
COUNT(DISTINCT CONCAT(a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH)) as 'count'
</when>
<otherwise>
COUNT(DISTINCT CONCAT(a.EMP_IDCARD,IFNULL(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH),IFNULL(a.SOCIAL_CREATE_MONTH,a.PROVIDENT_CREATE_MONTH))) as 'count'
</otherwise>
</choose>
FROM t_payment_info a FROM t_payment_info a
<where> <where>
<include refid="tPaymentInfo_export_count_where"/> <include refid="tPaymentInfo_export_count_where"/>
</where> </where>
</select> group by
<select id="selectCountPaymentSearchInfoSocialByLimit" resultType="java.lang.Integer">
SELECT
<!--<if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != '' and tPaymentInfo.socialHousehold == null">
distinct a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH
</if>
<if test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''">
distinct a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH
</if>-->
<choose> <choose>
<when test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != '' and tPaymentInfo.socialHousehold == null"> <when test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != '' and tPaymentInfo.socialHousehold == null">
COUNT(DISTINCT CONCAT(a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH)) as 'count' CONCAT(a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH)
</when> </when>
<when test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''"> <when test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''">
COUNT(DISTINCT CONCAT(a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH)) as 'count' CONCAT(a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH)
</when> </when>
<otherwise> <otherwise>
COUNT(DISTINCT CONCAT(a.EMP_IDCARD,IFNULL(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH),IFNULL(a.SOCIAL_CREATE_MONTH,a.PROVIDENT_CREATE_MONTH))) as 'count' CONCAT(a.EMP_IDCARD,IFNULL(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH),IFNULL(a.SOCIAL_CREATE_MONTH,a.PROVIDENT_CREATE_MONTH))
</otherwise> </otherwise>
</choose> </choose>
) g
</select>
<select id="selectCountPaymentSearchInfoSocialByLimit" resultType="java.lang.Integer">
select count(1) as 'count' from (
SELECT
count(1)
FROM t_payment_info a FROM t_payment_info a
<where> <where>
<include refid="tPaymentInfo_export_count_where"/> <include refid="tPaymentInfo_export_count_where"/>
</where> </where>
group by
<choose>
<when test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != '' and tPaymentInfo.socialHousehold == null">
CONCAT(a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH)
</when>
<when test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''">
CONCAT(a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH)
</when>
<otherwise>
CONCAT(a.EMP_IDCARD,IFNULL(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH),IFNULL(a.SOCIAL_CREATE_MONTH,a.PROVIDENT_CREATE_MONTH))
</otherwise>
</choose>
) g
limit 20001 limit 20001
</select> </select>
<select id="selectCountPaymentSearchInfoFund" resultType="java.lang.Integer"> <select id="selectCountPaymentSearchInfoFund" resultType="java.lang.Integer">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment