Commit 9b16d009 authored by huyuchen's avatar huyuchen

优化修改

parent 145e3bf9
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 缴费库合并推送参数
* @author huyc
* @date 2023-2-10 10:01:22
*/
@Data
public class TPaymentInfoPushVo implements Serializable {
/**
* 主键
*/
@Schema(description ="主键")
private String id;
/**
* 主键拼接
*/
@Schema(description ="主键拼接")
private String ids;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" )
@Schema(description ="员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称" )
@Schema(description ="客户名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("客户名称")
private String unitName;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称" )
@Schema(description ="项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目名称")
private String settleDomainName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Schema(description = "项目编码" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("项目编码" )
private String settleDomainCode;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户" )
@Schema(description ="社保户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保户")
private String socialHousehold;
/**
* 社保缴纳地
*/
@ExcelAttribute(name = "社保缴纳地" )
@Schema(description ="社保缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地")
private String socialPayAddr;
/**
* 社保缴纳月份
*/
@ExcelAttribute(name = "社保缴纳月份")
@Schema(description ="社保缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
/**
* 社保生成月份
*/
@ExcelAttribute(name = "社保生成月份")
@Schema(description ="社保生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
/**
* 总合计
*/
@ExcelAttribute(name = "总合计" )
@Schema(description ="总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("总合计")
private BigDecimal sumAll;
/**
* 社保合计
*/
@ExcelAttribute(name = "社保合计" )
@Schema(description ="社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保合计")
private BigDecimal socialSum;
/**
* 单位社保合计
*/
@ExcelAttribute(name = "单位社保合计" )
@Schema(description ="单位社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位社保合计")
private BigDecimal unitSocialSum;
/**
* 个人社保合计
*/
@ExcelAttribute(name = "个人社保合计" )
@Schema(description ="个人社保合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保合计")
private BigDecimal socialSecurityPersonalSum;
/**
* 单位社保补缴利息
*/
@ExcelAttribute(name = "单位社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位社保补缴利息")
private BigDecimal companyAccrual;
/**
* 个人社保补缴利息
*/
@ExcelAttribute(name = "个人社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保补缴利息")
private BigDecimal personalAccrual;
/**
* 单位养老金额
*/
@ExcelAttribute(name = "单位养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位养老金额")
private BigDecimal unitPensionMoney;
/**
* 单位医疗金额
*/
@ExcelAttribute(name = "单位医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位医疗金额")
private BigDecimal unitMedicalMoney;
/**
* 单位失业金额
*/
@ExcelAttribute(name = "单位失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位失业金额")
private BigDecimal unitUnemploymentMoney;
/**
* 单位工伤金额
*/
@ExcelAttribute(name = "单位工伤金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位工伤金额")
private BigDecimal unitInjuryMoney;
/**
* 单位生育金额
*/
@ExcelAttribute(name = "单位生育金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位生育金额")
private BigDecimal unitBirthMoney;
/**
* 单位大病金额
*/
@ExcelAttribute(name = "单位大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位大病金额")
private BigDecimal unitBigmailmentMoney;
/**
* 个人养老金额
*/
@ExcelAttribute(name = "个人养老金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人养老金额")
private BigDecimal personalPensionMoney;
/**
* 个人医疗金额
*/
@ExcelAttribute(name = "个人医疗金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人医疗金额")
private BigDecimal personalMedicalMoney;
/**
* 个人失业金额
*/
@ExcelAttribute(name = "个人失业金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人失业金额")
private BigDecimal personalUnemploymentMoney;
/**
* 个人大病金额
*/
@ExcelAttribute(name = "个人大病金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人大病金额")
private BigDecimal personalBigmailmentMoney;
/**
* 社保创建人姓名
*/
@ExcelAttribute(name = "社保创建人姓名")
@Schema(description = "社保创建人姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保创建人姓名")
private String createName;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}
......@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccountItem;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
......@@ -67,6 +69,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
Integer selectCountSumPaymentInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
* @return
*/
List<TPaymentInfoPushVo> getTPaymentInfoSumPushList(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库合并导出查询
* @param searchVo 缴费库
* @return
*/
Integer getTPaymentInfoSumPushCount(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
......@@ -95,6 +111,8 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
**/
TPaymentInfoVo getAllInfoById(String id);
List<TPaymentInfo> getAllPushInfoById(@Param("idStr") String idStr);
/*
* 已存在社保缴费库数据 非删除状态
* @param months
......@@ -168,14 +186,6 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
List<String> getTPaymentInfoList(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库社保推送查询
* @param searchVo 缴费库
* @return
*/
List<TPaymentInfo> getTPaymentSocialPushInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/**
* 缴费库公积金推送查询
* @param searchVo 缴费库
......@@ -206,14 +216,6 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
void updateBySocialIncomeFlag(@Param("id")String id);
/**
* 缴费库社保推送查询
* @param searchVo 缴费库
* @return
*/
long getTPaymentSocialPushCount(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/**
* 缴费库公积金推送查询
* @param searchVo 缴费库
......
......@@ -132,6 +132,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Autowired
private DoJointSocialTask doJointSocialTask;
@Autowired
private TPaymentSocialPushMapper pushMapper;
/**
* 缴费库简单分页查询
*
......@@ -2746,19 +2749,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public void createPaymentSocialInfo() {
//获取所有未推送的社保实缴明细数据
long count = baseMapper.selectCount(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getSocialId));
long count = baseMapper.getTPaymentInfoSumPushCount(null);
if (count > 0) {
List<TPaymentInfo> unPushs;
List<TPaymentInfoPushVo> unPushs;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
for (int j = 0; j < i; j++) {
unPushs = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getSocialId).last(" limit 0,10000"));
unPushs = baseMapper.getTPaymentInfoSumPushList(null);
synchronized (this) {
if (Common.isNotNull(unPushs)) {
//推送数据封装并推送
......@@ -2952,13 +2949,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void createPaymentSocialInfoReal(YifuUser user, TPaymentInfoSearchVo searchVo,
Map<String, TSettleDomainSelectVo> mapSelectVo) {
//获取所有未推送的社保实缴明细数据
searchVo.setLockStatus(CommonConstants.ONE_STRING);
long count = baseMapper.getTPaymentSocialPushCount(searchVo, user.getId());
searchVo.setCreateBy(user.getId());
long count = baseMapper.getTPaymentInfoSumPushCount(searchVo);
if (count > 0) {
List<TPaymentInfo> unPushInfo;
List<TPaymentInfoPushVo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
for (int j = 0; j < i; j++) {
unPushInfo = baseMapper.getTPaymentSocialPushInfo(searchVo, user.getId());
unPushInfo = baseMapper.getTPaymentInfoSumPushList(searchVo);
synchronized (this) {
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
......@@ -3349,12 +3346,36 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public Boolean updateSocialSettleStatus(List<EkpSocialViewVo> viewVoList) {
if (!viewVoList.isEmpty()) {
TPaymentInfo paymentInfo;
TForecastLibrary library;
List<TPaymentInfo> sUpdateList = new ArrayList<>();
List<TPaymentInfo> zSpdateList = new ArrayList<>();
TPaymentSocialPush socialPush;
TPaymentInfo paymentInfo;
try {
for (EkpSocialViewVo viewVo : viewVoList) {
//判断预估还是实缴
if (viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_THR)) {
socialPush = pushMapper.selectById(viewVo.getId());
//根据明细id更新结算状态
if (null != socialPush) {
List<TPaymentInfo> paymentList = baseMapper.getAllPushInfoById(socialPush.getPaymentIds());
if (!paymentList.isEmpty()) {
for (TPaymentInfo tPaymentInfo : paymentList) {
//判断是收入还是支出结算单号
if (CommonConstants.ZERO_STRING.equals(viewVo.getPayFlag())) {
tPaymentInfo.setIncomeSettleFlag(viewVo.getIncomeSettleFlag());
tPaymentInfo.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
sUpdateList.add(tPaymentInfo);
} else {
tPaymentInfo.setPaySettleFlag(viewVo.getPaySettleFlag());
tPaymentInfo.setPayCollectFlag(viewVo.getPayCollectFlag());
zSpdateList.add(tPaymentInfo);
}
log.info("缴费库实缴费用状态更新");
}
}
} else {
//根据明细id更新结算状态
paymentInfo = baseMapper.selectById(viewVo.getId());
if (Common.isNotNull(paymentInfo)) {
......@@ -3369,6 +3390,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
baseMapper.updateStatusById(paymentInfo);
log.info("缴费库实缴费用状态更新");
}
}
} else if (viewVo.getSettleFlag().contains(SocialConstants.DIFF_TYPE_ONE)) {
//根据明细id更新结算状态
library = tForecastLibraryMapper.selectById(viewVo.getId());
......@@ -3385,6 +3407,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
if (!sUpdateList.isEmpty()) {
this.updateBatchById(sUpdateList);
}
if (!zSpdateList.isEmpty()) {
this.updateBatchById(zSpdateList);
}
} catch (Exception e) {
log.error("更新社保结算状态失败", e);
return false;
......
......@@ -14,23 +14,19 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TForecastLibrary;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TForecastLibraryMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentSocialPushMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoPushVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 主要执行人员档案的员工类型同步更新
......@@ -63,6 +59,9 @@ public class DoJointSocialTask {
@Autowired
private TForecastLibraryMapper forecastLibraryMapper;
@Autowired
private TPaymentSocialPushMapper socialPushMapper;
@Autowired
private RedisUtil redisUtil;
......@@ -428,12 +427,14 @@ public class DoJointSocialTask {
* @return: void
**/
@Async
public void asynchronousEkpPaymentSocial(List<TPaymentInfo> unPushInfo, Map<String, TSettleDomainSelectVo> mapSelectVo) {
public void asynchronousEkpPaymentSocial(List<TPaymentInfoPushVo> unPushInfo, Map<String, TSettleDomainSelectVo> mapSelectVo) {
log.info("推送社保实缴费用到EKP-线程开始");
TSettleDomain settleDomain;
EkpPushSocialParam socialParam;
TPaymentSocialPush a;
List<EkpPushSocialParam> paramList = new ArrayList<>();
for (TPaymentInfo library : unPushInfo) {
Map<String,String> idMap = new HashMap<>();
for (TPaymentInfoPushVo library : unPushInfo) {
try {
//获取项目信息
if (Common.isNotNull(mapSelectVo)) {
......@@ -668,9 +669,14 @@ public class DoJointSocialTask {
String body = ekpSocialUtil.sendToEKP(socialParam);
if (Common.isEmpty(body) || body.length() != 32) {
paramList.add(socialParam);
idMap.put(library.getId(), library.getIds());
}
if (Common.isNotNull(body) && body.length() == 32) {
paymentInfoMapper.updateBySocialPayment(library.getId());
a = new TPaymentSocialPush();
a.setId(library.getId());
a.setPaymentIds(library.getIds());
socialPushMapper.insert(a);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
......@@ -702,6 +708,10 @@ public class DoJointSocialTask {
String body = ekpSocialUtil.sendToEKP(s);
if (Common.isNotNull(body) && body.length() == 32) {
paymentInfoMapper.updateBySocialPayment(s.getFd_3b0afbe1f94a08());
a = new TPaymentSocialPush();
a.setId(s.getFd_3b0afbe1f94a08());
a.setPaymentIds(idMap.get(s.getFd_3b0afbe1f94a08()));
socialPushMapper.insert(a);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
......@@ -727,6 +737,7 @@ public class DoJointSocialTask {
}
}
}
idMap.clear();
log.info("推送社保实缴费用到EKP结束");
}
......
......@@ -158,6 +158,36 @@
<result property="keyGroup" column="keyGroup"/>
</resultMap>
<resultMap id="tPaymentInfoSumPushMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoPushVo">
<result property="ids" column="ids"/>
<result property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
<result property="socialPayAddr" column="SOCIAL_PAY_ADDR"/>
<result property="socialPayMonth" column="SOCIAL_PAY_MONTH"/>
<result property="socialCreateMonth" column="SOCIAL_CREATE_MONTH"/>
<result property="sumAll" column="SUM_ALL"/>
<result property="socialSum" column="SOCIAL_SUM"/>
<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
<result property="socialSecurityPersonalSum" column="SOCIAL_SECURITY_PERSONAL_SUM"/>
<result property="companyAccrual" column="COMPANY_ACCRUAL"/>
<result property="personalAccrual" column="PERSONAL_ACCRUAL"/>
<result property="unitPensionMoney" column="UNIT_PENSION_MONEY"/>
<result property="unitMedicalMoney" column="UNIT_MEDICAL_MONEY"/>
<result property="unitUnemploymentMoney" column="UNIT_UNEMPLOYMENT_MONEY"/>
<result property="unitInjuryMoney" column="UNIT_INJURY_MONEY"/>
<result property="unitBirthMoney" column="UNIT_BIRTH_MONEY"/>
<result property="unitBigmailmentMoney" column="UNIT_BIGMAILMENT_MONEY"/>
<result property="personalPensionMoney" column="PERSONAL_PENSION_MONEY"/>
<result property="personalMedicalMoney" column="PERSONAL_MEDICAL_MONEY"/>
<result property="personalUnemploymentMoney" column="PERSONAL_UNEMPLOYMENT_MONEY"/>
<result property="personalBigmailmentMoney" column="PERSONAL_BIGMAILMENT_MONEY"/>
</resultMap>
<resultMap id="tPaymentInfoBatchMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoBatchVo">
<result property="empName" column="EMP_NAME"/>
<result property="empNo" column="EMP_NO"/>
......@@ -612,6 +642,9 @@
<if test="tPaymentInfo.lockStatus != null and tPaymentInfo.lockStatus.trim() != ''">
AND a.LOCK_STATUS = #{tPaymentInfo.lockStatus}
</if>
<if test="tPaymentInfo.createBy != null and tPaymentInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tPaymentInfo.createBy}
</if>
</if>
</if>
</sql>
......@@ -796,7 +829,7 @@
a.ID
FROM t_payment_info a
<where>
a.LOCK_STATUS = '0' AND a.CREATE_BY = #{tPaymentInfo.createBy}
a.LOCK_STATUS = '0'
<include refid="tPaymentInfo_export_where"/>
</where>
</select>
......@@ -1015,6 +1048,59 @@
GROUP BY w.keyGroup) c
</select>
<!--tPaymentInfo合并查询-->
<select id="getTPaymentInfoSumPushList" resultMap="tPaymentInfoSumPushMap">
SELECT
a.ID,
GROUP_CONCAT("'",a.ID,"'") as ids,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM( a.SUM_ALL ) AS SUM_ALL,
SUM( a.SOCIAL_SUM ) AS SOCIAL_SUM,
SUM( a.UNIT_SOCIAL_SUM ) AS UNIT_SOCIAL_SUM,
SUM( a.SOCIAL_SECURITY_PERSONAL_SUM ) AS SOCIAL_SECURITY_PERSONAL_SUM,
SUM( a.COMPANY_ACCRUAL ) AS COMPANY_ACCRUAL,
SUM( a.PERSONAL_ACCRUAL ) AS PERSONAL_ACCRUAL,
SUM( a.UNIT_PENSION_MONEY ) AS UNIT_PENSION_MONEY,
SUM( a.UNIT_MEDICAL_MONEY ) AS UNIT_MEDICAL_MONEY,
SUM( a.UNIT_UNEMPLOYMENT_MONEY ) AS UNIT_UNEMPLOYMENT_MONEY,
SUM( a.UNIT_INJURY_MONEY ) AS UNIT_INJURY_MONEY,
SUM( a.UNIT_BIRTH_MONEY ) AS UNIT_BIRTH_MONEY,
SUM( a.UNIT_BIGMAILMENT_MONEY ) AS UNIT_BIGMAILMENT_MONEY,
SUM( a.PERSONAL_PENSION_MONEY ) AS PERSONAL_PENSION_MONEY,
SUM( a.PERSONAL_MEDICAL_MONEY ) AS PERSONAL_MEDICAL_MONEY,
SUM( a.PERSONAL_UNEMPLOYMENT_MONEY ) AS PERSONAL_UNEMPLOYMENT_MONEY,
SUM( a.PERSONAL_BIGMAILMENT_MONEY ) AS PERSONAL_BIGMAILMENT_MONEY,
a.CREATE_NAME,
a.CREATE_TIME
FROM t_payment_info a
<where>
IFNULL(a.SOCIAL_ID,'1') != '1' and a.PUSH_STATUS = '1' and a.LOCK_STAUTS = '1'
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH
limit 0,10000
</select>
<!--tPaymentInfo合并查询-->
<select id="getTPaymentInfoSumPushCount" resultType="java.lang.Integer">
SELECT
count (1)
FROM t_payment_info a
<where>
IFNULL(a.SOCIAL_ID,'1') != '1' and a.PUSH_STATUS = '1' and a.LOCK_STAUTS = '1'
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH
</select>
<update id="updateDeleteInfo">
update t_payment_info
<trim prefix="SET" suffixOverrides=",">
......@@ -1091,6 +1177,14 @@
where a.ID = #{id}
</select>
<!--tPaymentInfo 按ID查收缴费库包含社保和公积金明细的数据查询-->
<select id="getAllPushInfoById" resultMap="tPaymentInfoMap">
SELECT
*
FROM t_payment_info a
where a.ID in (${idStr})
</select>
<select id="selectListForPaymentImport" resultMap="tPaymentInfoMap">
SELECT
<include refid="Base_Column_List"/>
......@@ -1265,18 +1359,6 @@
</foreach>
</update>
<!--tPaymentInfo社保推送查询-->
<select id="getTPaymentSocialPushInfo" resultMap="tPaymentInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_payment_info a
<where>
a.PUSH_STATUS = '1' AND a.SOCIAL_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/>
</where>
limit 0,10000
</select>
<!--tPaymentInfo公积金推送查询-->
<select id="getTPaymentFundPushInfo" resultMap="tPaymentInfoMap">
SELECT
......
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