Commit be3f3215 authored by huyuchen's avatar huyuchen

合并导出

parent 4b8b7c36
/*
* 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.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 缴费库导出参数
* @author huyc
* @date 2022-10-31 17:01:22
*/
@Data
public class TPaymentInfoExportVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" )
@Schema(description ="员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
@Size(max = 20, message = "员工姓名不可超过20位")
private String empName;
/**
* 员工编码
*/
@ExcelAttribute(name = "员工编码" )
@Schema(description ="员工编码")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工编码")
@Size(max = 32, message = "员工编码不可超过32位")
private String empNo;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" )
@Schema(description ="身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号")
@Size(max = 32, message = "身份证号不可超过32位")
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;
/**
* 项目编码
*/
@Length(max = 50, message = "项目编码不能超过50个字符" )
@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 socialSecurityNo;
/**
* 社保缴纳地
*/
@ExcelAttribute(name = "社保缴纳地" )
@Schema(description ="社保缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地")
private String socialPayAddr;
/**
* 社保缴纳月份
*/
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6,isInteger = true)
@Schema(description ="社保缴纳月份")
@Length(max = 6, message = "社保缴纳月份不能超过6个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
/**
* 社保生成月份
*/
@ExcelAttribute(name = "社保生成月份", maxLength = 6,isInteger = true)
@Length(max = 6, message = "社保生成月份不能超过6个字符")
@Schema(description ="社保生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
/**
* 总合计
*/
@ExcelAttribute(name = "总合计" )
@Schema(description ="总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("总合计")
private BigDecimal sumAll;
/**
* 公积金缴纳月份
*/
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6,isInteger = true)
@Length(max = 6, message = "公积金缴纳月份不能超过6个字符")
@Schema(description ="公积金缴纳月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳月份")
private String providentPayMonth;
/**
* 公积金生成月份
*/
@ExcelAttribute(name = "公积金生成月份", maxLength = 6,isInteger = true)
@Length(max = 6, message = "公积金生成月份不能超过6个字符")
@Schema(description ="公积金生成月份")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户" )
@Schema(description ="公积金户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金户")
private String providentHousehold;
/**
* 公积金缴纳地
*/
@ExcelAttribute(name = "公积金缴纳地" )
@Schema(description ="公积金缴纳地")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地")
private String providentPayAddr;
/**
* 公积金缴纳地-省
*/
@ExcelAttribute(name = "公积金缴纳地-省", isArea = true)
@Schema(description ="公积金缴纳地-省")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-省")
private String fundProvince;
/**
* 公积金缴纳地-市
*/
@ExcelAttribute(name = "公积金缴纳地-市",isArea = true, parentField = "fundProvince")
@Schema(description ="公积金缴纳地-市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-市")
private String fundCity;
/**
* 公积金缴纳地-县
*/
@ExcelAttribute(name = "公积金缴纳地-县",isArea = true, parentField = "fundCity")
@Schema(description ="公积金缴纳地-县")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-县")
private String fundTown;
/**
* 社保缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地-省",isArea = true)
@Schema(description ="社保缴纳地-省")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-省")
private String socialProvince;
/**
* 社保缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市", isArea = true, parentField = "socialProvince")
@Schema(description ="社保缴纳地-市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-市")
private String socialCity;
/**
* 社保缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县", isArea = true, parentField = "socialCity")
@Schema(description ="社保缴纳地-县")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-县")
private String socialTown;
/**
* 社保合计
*/
@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 = "公积金总合计" )
@Schema(description ="公积金总合计")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金总合计")
private BigDecimal providentSum;
/**
* 就职班组
*/
@ExcelAttribute(name = "就职班组" )
@Schema(description ="就职班组")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("就职班组")
private String inauguralTeam;
/**
* 单位社保补缴利息
*/
@ExcelAttribute(name = "单位社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位社保补缴利息")
private BigDecimal companyAccrual;
/**
* 个人社保补缴利息
*/
@ExcelAttribute(name = "个人社保补缴利息" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人社保补缴利息")
private BigDecimal personalAccrual;
/**
* 单位养老基数
*/
@ExcelAttribute(name = "养老基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老基数")
private BigDecimal unitPensionSet;
/**
* 单位医疗基数
*/
@ExcelAttribute(name = "医疗基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医疗基数")
private BigDecimal unitMedicalSet;
/**
* 单位失业基数
*/
@ExcelAttribute(name = "失业基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("失业基数")
private BigDecimal unitUnemploymentSet;
/**
* 单位工伤基数
*/
@ExcelAttribute(name = "工伤基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("工伤基数")
private BigDecimal unitInjurySet;
/**
* 单位生育基数
*/
@ExcelAttribute(name = "生育基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("生育基数")
private BigDecimal unitBirthSet;;
/**
* 单位养老金额
*/
@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 = "公积金编号", maxLength = 20)
@Size(max = 20, message = "公积金编号不可超过20位")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金编号")
private String providentNo;
/**
* 单位公积金基数
*/
@ExcelAttribute(name = "单位公积金基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金基数")
private BigDecimal unitProvidentSet;
/**
* 单位公积金比例
*/
@ExcelAttribute(name = "单位公积金比例")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金比例")
private BigDecimal providentPercent;
/**
* 单位公积金费用
*/
@ExcelAttribute(name = "单位公积金费用")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("单位公积金费用")
private BigDecimal unitProvidentSum;
/**
* 个人公积金基数
*/
@ExcelAttribute(name = "个人公积金基数", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("个人公积金基数")
private BigDecimal personalProidentSet;
/**
* 社保创建人姓名
*/
@ExcelAttribute(name = "社保创建人姓名", maxLength = 32)
@Schema(description = "社保创建人姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保创建人姓名")
private String socialCreateName;
/**
* 社保创建时间
*/
@Schema(description = "社保创建时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保创建时间")
private String socialCreateTime;
/**
* 公积金创建人姓名
*/
@ExcelAttribute(name = "公积金创建人姓名", maxLength = 32)
@Schema(description = "公积金创建人姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金创建人姓名")
private String fundCreateName;
/**
* 公积金创建时间
*/
@Schema(description = "公积金创建时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金创建时间")
private String fundCreateTime;
/**
* 分组键
*/
@ExcelAttribute(name = "分组键", isExport = false)
@Schema(description = "分组键")
private String keyGroup;
}
......@@ -195,6 +195,19 @@ public class TPaymentInfoController {
tPaymentInfoService.listExport(response, searchVo);
}
/**
* 缴费库合并导出
*
* @author huyc
* @date 2022-10-31
**/
@Operation(description = "合并导出缴费库 hasPermission('social_tpaymentinfo_export')")
@PostMapping("/sumExport")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
public void sumExport(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
tPaymentInfoService.listSumExport(response, searchVo);
}
/**
* 根据条件批量删除
*
......
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -59,6 +60,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
List<TPaymentInfo> getTPaymentInfoNoPage(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库合并导出查询
* @param searchVo 缴费库
* @return
*/
Integer selectCountSumPaymentInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
* @return
*/
List<TPaymentInfoExportVo> getTPaymentInfoSumNoPage(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 更新社保或者公积金
* @param tPaymentInfo 缴费库
......
......@@ -75,6 +75,13 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
*/
void listExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
/**
* 合并导出缴费库
* @param response
* @param searchVo
* @return
*/
void listSumExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
/**
* 删除缴费库数据 包括明细
......
......@@ -57,6 +57,7 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeService;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSendEkpErrorService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.extern.log4j.Log4j2;
......@@ -205,6 +206,71 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
/**
* 缴费库批量导出
*
* @param searchVo 缴费库
* @return
*/
@Override
public void listSumExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo) {
String fileName = "缴费库合并导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TPaymentInfoExportVo> list = new ArrayList<>();
Integer count = baseMapper.selectCountSumPaymentInfo(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfoExportVo.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTPaymentInfoSumNoPage(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TPaymentInfoExportVo> util = new ExcelUtil<>(TPaymentInfoExportVo.class);
for (TPaymentInfoExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("缴费库合并导出" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("缴费库合并导出" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public R<Boolean> removeInFoById(String id) {
YifuUser user = SecurityUtils.getUser();
......
......@@ -101,6 +101,62 @@
<result property="createTime" column="CREATE_TIME"/>
<result property="incomeStatus" column="INCOME_STATUS"/>
</resultMap>
<resultMap id="tPaymentInfoSumMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoExportVo">
<result property="empName" column="EMP_NAME"/>
<result property="empNo" column="EMP_NO"/>
<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="socialSecurityNo" column="SOCIAL_SECURITY_NO"/>
<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="providentPayMonth" column="PROVIDENT_PAY_MONTH"/>
<result property="providentCreateMonth" column="PROVIDENT_CREATE_MONTH"/>
<result property="providentHousehold" column="PROVIDENT_HOUSEHOLD"/>
<result property="providentPayAddr" column="PROVIDENT_PAY_ADDR"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="socialSum" column="SOCIAL_SUM"/>
<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
<result property="socialSecurityPersonalSum" column="SOCIAL_SECURITY_PERSONAL_SUM"/>
<result property="providentSum" column="PROVIDENT_SUM"/>
<result property="inauguralTeam" column="INAUGURAL_TEAM"/>
<result property="companyAccrual" column="COMPANY_ACCRUAL"/>
<result property="personalAccrual" column="PERSONAL_ACCRUAL"/>
<result property="unitPensionSet" column="UNIT_PENSION_SET"/>
<result property="unitMedicalSet" column="UNIT_MEDICAL_SET"/>
<result property="unitUnemploymentSet" column="UNIT_UNEMPLOYMENT_SET"/>
<result property="unitInjurySet" column="UNIT_INJURY_SET"/>
<result property="unitBirthSet" column="UNIT_BIRTH_SET"/>
<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"/>
<result property="providentNo" column="PROVIDENT_NO"/>
<result property="unitProvidentSet" column="UNIT_PROVIDENT_SET"/>
<result property="providentPercent" column="PROVIDENT_PERCENT"/>
<result property="unitProvidentSum" column="UNIT_PROVIDENT_SUM"/>
<result property="personalProidentSet" column="PERSONAL_PROIDENT_SET"/>
<result property="socialCreateName" column="SOCIAL_CREATE_NAME"/>
<result property="socialCreateTime" column="SOCIAL_CREATE_TIME"/>
<result property="fundCreateName" column="FUND_CREATE_NAME"/>
<result property="fundCreateTime" column="FUND_CREATE_TIME"/>
<result property="keyGroup" column="keyGroup"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
......@@ -178,83 +234,6 @@
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_TIME
</sql>
<sql id="base_column_list_all">
a.ID,
a.EMP_NAME,
a.EMP_NO,
a.EMP_ID,
a.EMP_IDCARD,
a.UNIT_ID,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SETTLE_DOMAIN_ID,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.CREATE_BY,
a.UPDATE_TIME,
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.LOCK_STATUS,
a.SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SOCIAL_ID,
a.FUND_ID,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_PER,
a.UNIT_MEDICAL_PER,
a.UNIT_UNEMPLOYMENT_PER,
a.UNIT_INJURY_PER,
a.UNIT_BIRTH_PER,
a.PERSONAL_PENSION_PER,
a.PERSONAL_MEDICAL_PER,
a.PERSONAL_UNEMPLOYMENT_PER,
a.UNIT_BIGAILMENT_PER,
a.PERSONAL_BIGAILMENT_PER,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.UNIT_PROVIDENT_SUM,
a.PERSONAL_PROIDENT_SET,
a.PERSONAL_PROVIDENT_SUM
</sql>
<sql id="tPaymentInfo_where">
<if test="tPaymentInfo != null">
......@@ -496,15 +475,9 @@
<if test="tPaymentInfo.empNo != null and tPaymentInfo.empNo.trim() != ''">
AND a.EMP_NO like CONCAT(#{tPaymentInfo.empNo},'%')
</if>
<if test="tPaymentInfo.empId != null and tPaymentInfo.empId.trim() != ''">
AND a.EMP_ID = #{tPaymentInfo.empId}
</if>
<if test="tPaymentInfo.empIdcard != null and tPaymentInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tPaymentInfo.empIdcard}
</if>
<if test="tPaymentInfo.unitId != null and tPaymentInfo.unitId.trim() != ''">
AND a.UNIT_ID = #{tPaymentInfo.unitId}
</if>
<if test="tPaymentInfo.settleDomainName != null and tPaymentInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME = #{tPaymentInfo.settleDomainName}
</if>
......@@ -532,12 +505,6 @@
<if test="tPaymentInfo.socialCreateMonth != null and tPaymentInfo.socialCreateMonth.trim() != ''">
AND (a.SOCIAL_CREATE_MONTH = '${tPaymentInfo.socialCreateMonth}' or a.PROVIDENT_CREATE_MONTH = '${tPaymentInfo.socialCreateMonth}')
</if>
<if test="tPaymentInfo.lockStatus != null and tPaymentInfo.lockStatus.trim() != ''">
AND a.LOCK_STATUS = #{tPaymentInfo.lockStatus}
</if>
<if test="tPaymentInfo.sumAll != null">
AND a.SUM_ALL = #{tPaymentInfo.sumAll}
</if>
<if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != ''">
AND a.PROVIDENT_HOUSEHOLD like CONCAT(#{tPaymentInfo.providentHousehold},'%')
</if>
......@@ -572,144 +539,9 @@
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
</if>
<if test="tPaymentInfo.socialId != null and tPaymentInfo.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tPaymentInfo.socialId}
</if>
<if test="tPaymentInfo.fundId != null and tPaymentInfo.fundId.trim() != ''">
AND a.FUND_ID = #{tPaymentInfo.fundId}
</if>
<if test="tPaymentInfo.socialSum != null">
AND a.SOCIAL_SUM = #{tPaymentInfo.socialSum}
</if>
<if test="tPaymentInfo.unitSocialSum != null">
AND a.UNIT_SOCIAL_SUM = #{tPaymentInfo.unitSocialSum}
</if>
<if test="tPaymentInfo.socialSecurityPersonalSum != null">
AND a.SOCIAL_SECURITY_PERSONAL_SUM = #{tPaymentInfo.socialSecurityPersonalSum}
</if>
<if test="tPaymentInfo.providentSum != null">
AND a.PROVIDENT_SUM = #{tPaymentInfo.providentSum}
</if>
<if test="tPaymentInfo.inauguralTeam != null and tPaymentInfo.inauguralTeam.trim() != ''">
AND a.INAUGURAL_TEAM = #{tPaymentInfo.inauguralTeam}
</if>
<if test="tPaymentInfo.sortTime != null and tPaymentInfo.sortTime.trim() != ''">
AND a.SORT_TIME = #{tPaymentInfo.sortTime}
</if>
<if test="tPaymentInfo.companyAccrual != null">
AND a.COMPANY_ACCRUAL = #{tPaymentInfo.companyAccrual}
</if>
<if test="tPaymentInfo.personalAccrual != null">
AND a.PERSONAL_ACCRUAL = #{tPaymentInfo.personalAccrual}
</if>
<if test="tPaymentInfo.unitPensionSet != null">
AND a.UNIT_PENSION_SET = #{tPaymentInfo.unitPensionSet}
</if>
<if test="tPaymentInfo.unitMedicalSet != null">
AND a.UNIT_MEDICAL_SET = #{tPaymentInfo.unitMedicalSet}
</if>
<if test="tPaymentInfo.unitUnemploymentSet != null">
AND a.UNIT_UNEMPLOYMENT_SET = #{tPaymentInfo.unitUnemploymentSet}
</if>
<if test="tPaymentInfo.unitInjurySet != null">
AND a.UNIT_INJURY_SET = #{tPaymentInfo.unitInjurySet}
</if>
<if test="tPaymentInfo.unitBirthSet != null">
AND a.UNIT_BIRTH_SET = #{tPaymentInfo.unitBirthSet}
</if>
<if test="tPaymentInfo.unitPensionPer != null">
AND a.UNIT_PENSION_PER = #{tPaymentInfo.unitPensionPer}
</if>
<if test="tPaymentInfo.unitMedicalPer != null">
AND a.UNIT_MEDICAL_PER = #{tPaymentInfo.unitMedicalPer}
</if>
<if test="tPaymentInfo.unitUnemploymentPer != null">
AND a.UNIT_UNEMPLOYMENT_PER = #{tPaymentInfo.unitUnemploymentPer}
</if>
<if test="tPaymentInfo.unitInjuryPer != null">
AND a.UNIT_INJURY_PER = #{tPaymentInfo.unitInjuryPer}
</if>
<if test="tPaymentInfo.unitBirthPer != null">
AND a.UNIT_BIRTH_PER = #{tPaymentInfo.unitBirthPer}
</if>
<if test="tPaymentInfo.personalPensionPer != null">
AND a.PERSONAL_PENSION_PER = #{tPaymentInfo.personalPensionPer}
</if>
<if test="tPaymentInfo.personalMedicalPer != null">
AND a.PERSONAL_MEDICAL_PER = #{tPaymentInfo.personalMedicalPer}
</if>
<if test="tPaymentInfo.personalUnemploymentPer != null">
AND a.PERSONAL_UNEMPLOYMENT_PER = #{tPaymentInfo.personalUnemploymentPer}
</if>
<if test="tPaymentInfo.unitBigailmentPer != null">
AND a.UNIT_BIGAILMENT_PER = #{tPaymentInfo.unitBigailmentPer}
</if>
<if test="tPaymentInfo.personalBigailmentPer != null">
AND a.PERSONAL_BIGAILMENT_PER = #{tPaymentInfo.personalBigailmentPer}
</if>
<if test="tPaymentInfo.unitPensionMoney != null">
AND a.UNIT_PENSION_MONEY = #{tPaymentInfo.unitPensionMoney}
</if>
<if test="tPaymentInfo.unitMedicalMoney != null">
AND a.UNIT_MEDICAL_MONEY = #{tPaymentInfo.unitMedicalMoney}
</if>
<if test="tPaymentInfo.unitUnemploymentMoney != null">
AND a.UNIT_UNEMPLOYMENT_MONEY = #{tPaymentInfo.unitUnemploymentMoney}
</if>
<if test="tPaymentInfo.unitInjuryMoney != null">
AND a.UNIT_INJURY_MONEY = #{tPaymentInfo.unitInjuryMoney}
</if>
<if test="tPaymentInfo.unitBirthMoney != null">
AND a.UNIT_BIRTH_MONEY = #{tPaymentInfo.unitBirthMoney}
</if>
<if test="tPaymentInfo.unitBigmailmentMoney != null">
AND a.UNIT_BIGMAILMENT_MONEY = #{tPaymentInfo.unitBigmailmentMoney}
</if>
<if test="tPaymentInfo.personalPensionMoney != null">
AND a.PERSONAL_PENSION_MONEY = #{tPaymentInfo.personalPensionMoney}
</if>
<if test="tPaymentInfo.personalMedicalMoney != null">
AND a.PERSONAL_MEDICAL_MONEY = #{tPaymentInfo.personalMedicalMoney}
</if>
<if test="tPaymentInfo.personalUnemploymentMoney != null">
AND a.PERSONAL_UNEMPLOYMENT_MONEY = #{tPaymentInfo.personalUnemploymentMoney}
</if>
<if test="tPaymentInfo.personalBigmailmentMoney != null">
AND a.PERSONAL_BIGMAILMENT_MONEY = #{tPaymentInfo.personalBigmailmentMoney}
</if>
<if test="tPaymentInfo.providentNo != null and tPaymentInfo.providentNo.trim() != ''">
AND a.PROVIDENT_NO = #{tPaymentInfo.providentNo}
</if>
<if test="tPaymentInfo.unitProvidentSet != null">
AND a.UNIT_PROVIDENT_SET = #{tPaymentInfo.unitProvidentSet}
</if>
<if test="tPaymentInfo.providentPercent != null">
AND a.PROVIDENT_PERCENT = #{tPaymentInfo.providentPercent}
</if>
<if test="tPaymentInfo.unitProvidentSum != null">
AND a.UNIT_PROVIDENT_SUM = #{tPaymentInfo.unitProvidentSum}
</if>
<if test="tPaymentInfo.personalProidentSet != null">
AND a.PERSONAL_PROIDENT_SET = #{tPaymentInfo.personalProidentSet}
</if>
<if test="tPaymentInfo.personalProvidentSum != null">
AND a.PERSONAL_PROVIDENT_SUM = #{tPaymentInfo.personalProvidentSum}
</if>
<if test="tPaymentInfo.createBy != null and tPaymentInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tPaymentInfo.createBy}
</if>
<if test="tPaymentInfo.updateTime != null">
AND a.UPDATE_TIME = #{tPaymentInfo.updateTime}
</if>
<if test="tPaymentInfo.updateBy != null and tPaymentInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tPaymentInfo.updateBy}
</if>
<if test="tPaymentInfo.createName != null and tPaymentInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tPaymentInfo.createName}
</if>
<if test="tPaymentInfo.createTime != null">
AND a.CREATE_TIME = #{tPaymentInfo.createTime}
</if>
</if>
</if>
</sql>
......@@ -831,6 +663,324 @@
</where>
</select>
<!--tPaymentInfo合并查询-->
<select id="getTPaymentInfoSumNoPage" resultMap="tPaymentInfoSumMap">
SELECT
w.keyGroup,
w.EMP_IDCARD,
w.EMP_NAME,
w.UNIT_NAME,
w.SETTLE_DOMAIN_CODE,
w.SETTLE_DOMAIN_NAME,
w.SOCIAL_HOUSEHOLD,
w.SOCIAL_SECURITY_NO,
w.SOCIAL_PAY_ADDR,
w.SOCIAL_PAY_MONTH,
w.SOCIAL_CREATE_MONTH,
SUM( w.SUM_ALL ) AS SUM_ALL,
SUM( w.PROVIDENT_PAY_MONTH ) AS PROVIDENT_PAY_MONTH,
SUM( w.PROVIDENT_CREATE_MONTH ) AS PROVIDENT_CREATE_MONTH,
SUM( w.PROVIDENT_HOUSEHOLD ) AS PROVIDENT_HOUSEHOLD,
SUM( w.PROVIDENT_PAY_ADDR ) AS PROVIDENT_PAY_ADDR,
SUM( w.FUND_PROVINCE ) AS FUND_PROVINCE,
SUM( w.FUND_CITY ) AS FUND_CITY,
SUM( w.FUND_TOWN ) AS FUND_TOWN,
w.SOCIAL_PROVINCE,
w.SOCIAL_CITY,
w.SOCIAL_TOWN,
w.SOCIAL_SUM,
w.UNIT_SOCIAL_SUM,
w.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( w.PROVIDENT_SUM ) AS PROVIDENT_SUM,
w.INAUGURAL_TEAM,
w.COMPANY_ACCRUAL,
w.PERSONAL_ACCRUAL,
w.UNIT_PENSION_SET,
w.UNIT_MEDICAL_SET,
w.UNIT_UNEMPLOYMENT_SET,
w.UNIT_INJURY_SET,
w.UNIT_BIRTH_SET,
w.UNIT_PENSION_MONEY,
w.UNIT_MEDICAL_MONEY,
w.UNIT_UNEMPLOYMENT_MONEY,
w.UNIT_INJURY_MONEY,
w.UNIT_BIRTH_MONEY,
w.UNIT_BIGMAILMENT_MONEY,
w.PERSONAL_PENSION_MONEY,
w.PERSONAL_MEDICAL_MONEY,
w.PERSONAL_UNEMPLOYMENT_MONEY,
w.PERSONAL_BIGMAILMENT_MONEY,
SUM( w.PROVIDENT_NO ) AS PROVIDENT_NO,
SUM( w.UNIT_PROVIDENT_SET ) AS UNIT_PROVIDENT_SET,
SUM( w.PROVIDENT_PERCENT ) AS PROVIDENT_PERCENT,
w.SOCIAL_CREATE_NAME,
w.SOCIAL_CREATE_TIME,
MAX( w.FUND_CREATE_NAME ) AS FUND_CREATE_NAME,
MAX( w.FUND_CREATE_TIME ) AS FUND_CREATE_TIME,
SUM( w.UNIT_PROVIDENT_SUM ) AS UNIT_PROVIDENT_SUM
FROM (
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
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,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
SUM( a.COMPANY_ACCRUAL ) AS COMPANY_ACCRUAL,
SUM( a.PERSONAL_ACCRUAL ) AS PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
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.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
a.CREATE_NAME AS SOCIAL_CREATE_NAME,
DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') AS SOCIAL_CREATE_TIME,
NULL AS FUND_CREATE_NAME,
NULL AS FUND_CREATE_TIME,
a.UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
a.SOCIAL_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH
)
union all
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.PROVIDENT_PAY_MONTH, '_', a.PROVIDENT_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( a.PROVIDENT_SUM ) AS PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
NULL AS SOCIAL_CREATE_NAME,
NULL AS SOCIAL_CREATE_TIME,
a.CREATE_NAME AS FUND_CREATE_NAME,
DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') AS FUND_CREATE_TIME,
a.UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
a.FUND_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH
)
) w
GROUP BY w.keyGroup
ORDER BY w.SOCIAL_CREATE_TIME desc
limit #{tPaymentInfo.limitStart},#{tPaymentInfo.limitEnd}
</select>
<!--tPaymentInfo数量查询-->
<select id="selectCountSumPaymentInfo" resultType="java.lang.Integer">
SELECT
count(1)
FROM (
select * from (
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
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,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
SUM( a.COMPANY_ACCRUAL ) AS COMPANY_ACCRUAL,
SUM( a.PERSONAL_ACCRUAL ) AS PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
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.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
a.CREATE_NAME AS SOCIAL_CREATE_NAME,
a.CREATE_TIME AS SOCIAL_CREATE_TIME,
NULL AS FUND_CREATE_NAME,
NULL AS FUND_CREATE_TIME,
a.UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
a.SOCIAL_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH
)
union all
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.PROVIDENT_PAY_MONTH, '_', a.PROVIDENT_CREATE_MONTH ) AS keyGroup,
a.EMP_NAME,
a.EMP_IDCARD,
a.UNIT_NAME,
a.SETTLE_DOMAIN_CODE,
a.SETTLE_DOMAIN_NAME,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
SUM( a.SUM_ALL ) AS SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
SUM( a.PROVIDENT_SUM ) AS PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.PERSONAL_PROIDENT_SET,
NULL AS SOCIAL_CREATE_NAME,
NULL AS SOCIAL_CREATE_TIME,
a.CREATE_NAME AS FUND_CREATE_NAME,
a.CREATE_TIME AS FUND_CREATE_TIME,
a.UNIT_PROVIDENT_SUM
FROM t_payment_info a
<where>
a.FUND_ID is not null
<include refid="tPaymentInfo_export_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH
)
) w
GROUP BY w.keyGroup) c
</select>
<update id="updateDeleteInfo">
update t_payment_info
<trim prefix="SET" suffixOverrides=",">
......
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