Commit 780fa0c6 authored by wangzb's avatar wangzb

feature-wzb :公积金表格修改

parent 8ef4a357
......@@ -17,4 +17,7 @@ public class TDispatchFundSumVo {
@ExcelAttribute(name = "合计补缴金额(大写)" )
@ExcelProperty("合计补缴金额(大写)")
private BigDecimal supplementaryAmountSum;
private String number;
}
......@@ -62,6 +62,7 @@ public class CustomCellStyleFourStrategy extends AbstractVerticalCellStyleStrate
headWriteCellStyle.setFillForegroundColor(IndexedColors.BLACK.getIndex());
headWriteCellStyle.setWriteFont(headWriteFont);
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
headWriteCellStyle.setBorderLeft(BorderStyle.THIN);
headWriteCellStyle.setBorderTop(BorderStyle.THIN);
headWriteCellStyle.setBorderRight(BorderStyle.THIN);
......
......@@ -164,6 +164,7 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
int getSocialDisRecordCount(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
int getFCount(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
/**
* @Author huyc
......@@ -239,11 +240,11 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
List<TDispatchFundPersionExportVo> getFundPersionExportVo(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
List<TDispatchFundSupplementaryExportVo> getFundSupplementarynExportVo(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
List<TDispatchFundSupplementaryExportVo> getFundSupplementarynExportVo(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,@Param("companyPro") Double companyPro);
TDispatchFundSumExportVo getFundSumExportVo(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
TDispatchFundSumVo getFundSumExportVoOne(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
TDispatchFundSumVo getFundSumExportVoOne(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,@Param("companyPro") Double companyPro);
CompanyProVo getFundPersionExportVoOne(@Param("houseName") String houseName);
......
......@@ -5428,22 +5428,25 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private long getSocialDisRecordCount(SocialHandleSearchVo searchVo) {
return baseMapper.getSocialDisRecordCount(searchVo);
}
private long getFCount(SocialHandleSearchVo searchVo) {
return baseMapper.getFCount(searchVo);
}
private List<TDispatchSocialExportVo> getSocialDisRecord(SocialHandleSearchVo searchVo) {
return baseMapper.getSocialDisRecord(searchVo);
}
private List<TDispatchFundPersionExportVo> getDispatchFundPersion(SocialHandleSearchVo searchVo) {
return baseMapper.getFundPersionExportVo(searchVo);
}
private List<TDispatchFundSupplementaryExportVo> getDispatchFundSupplementary(SocialHandleSearchVo searchVo) {
return baseMapper.getFundSupplementarynExportVo(searchVo);
private List<TDispatchFundSupplementaryExportVo> getDispatchFundSupplementary(SocialHandleSearchVo searchVo,Double companyPro) {
return baseMapper.getFundSupplementarynExportVo(searchVo,companyPro);
}
private TDispatchFundSumExportVo getFundSumExportVo(SocialHandleSearchVo searchVo) {
return baseMapper.getFundSumExportVo(searchVo);
}
private TDispatchFundSumVo getFundSumVo(SocialHandleSearchVo searchVo) {
return baseMapper.getFundSumExportVoOne(searchVo);
private TDispatchFundSumVo getFundSumVo(SocialHandleSearchVo searchVo,Double companyPro ) {
return baseMapper.getFundSumExportVoOne(searchVo,companyPro);
}
private CompanyProVo companyProVo(String houseName) {
return baseMapper.getFundPersionExportVoOne(houseName);
......@@ -6035,7 +6038,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
WriteTable writeTable3;
WriteTable writeTable4;
WriteTable writeTable5;
WriteTable writeTable6;
TDispatchFundPersionExportVo vo;
List<Integer> columnIndexes = Arrays.asList(0,7);
......@@ -6100,7 +6102,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)25,(short)20))
.build();
//派增的数据
long count = getSocialDisRecordCount(searchVo);
long count = getFCount(searchVo);
if (count > CommonConstants.ZERO_INT){
list = getDispatchFundPersion(searchVo);
if (Common.isNotNull(list)) {
......@@ -6126,8 +6128,26 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excelWriter.write(new ArrayList<>(), writeSheet, writeTable5);
}
} else {
writeSheet = EasyExcel.writerSheet("增员").build();
excelWriter.write(list,writeSheet);
list = getDispatchFundPersion(searchVo);
if (list.size() < 10) {
int size = 10 - list.size();
int num = list.size() + 1;
for (int i =1;i<= size;i++) {
vo = new TDispatchFundPersionExportVo();
vo.setNum(num);
num ++;
list.add(vo);
}
}
writeSheet = EasyExcel.writerSheet(searchVo.getDisMonth()).build();
// 第一次写入会创建头
excelWriter.write(new ArrayList<>(), writeSheet, writeTable0);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
// 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(list, writeSheet, writeTable2);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable3);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable4);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable5);
}
if (excelWriter!= null) {
excelWriter.finish();
......@@ -6140,7 +6160,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Override
public void doexportFundInfoOne(HttpServletResponse response, SocialHandleSearchVo searchVo) {
String fileName = DispatchConstants.FUND_SUPPLEMENTARY_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX;
String fileName = DispatchConstants.FUND_SUPPLEMENTARY_EXPORT + "_"+searchVo.getProvidentHouseholdName() + "_" + searchVo.getDisMonth() + CommonConstants.XLSX;
//获取要导出的列表
List<TDispatchFundSupplementaryExportVo> list = new ArrayList<>();
try (ServletOutputStream out = response.getOutputStream()){
......@@ -6169,7 +6189,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
writeTable0 = EasyExcel.writerTable(0).
head(headFisrtOne()).
registerWriteHandler(customCellStyleStrategy).
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)20,(short)25
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)40,(short)100
)).
build();
writeTable1 = EasyExcel.writerTable(1).
......@@ -6186,8 +6206,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (columnIndex == 2) {
//要求将当前列的列宽设置为33英寸,理论值应该是33×256=8448,
//但是这里的设值是8648,具体原因请看下面的计算逻辑
sheet.setColumnWidth(0, 2000);
sheet.setColumnWidth(2, 3000);
sheet.setColumnWidth(0, 1000);
sheet.setColumnWidth(2, 1000);
sheet.setColumnWidth(6, 2000);
sheet.setColumnWidth(4,1500);
}
......@@ -6259,7 +6279,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)20,(short)25)).
build();
writeTable5 = EasyExcel.writerTable(5).
head(headQFour()).
head(headQFour(searchVo)).
registerWriteHandler(customCellStyleStrategyThree).
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)20,(short)25)).
build();
......@@ -6274,9 +6294,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)25,(short)40)).
build();
//派增的数据
long count = getSocialDisRecordCount(searchVo);
long count = getFCount(searchVo);
if (count > CommonConstants.ZERO_INT){
list = getDispatchFundSupplementary(searchVo);
HouseNameConfigVo houseNameConfigVo=getFundSumExportVoTwo(searchVo.getProvidentHouseholdName());
Double companyPro=houseNameConfigVo.getCompanyPro();
list = getDispatchFundSupplementary(searchVo,companyPro);
if (Common.isNotNull(list)) {
//判断list的大小是否大于10
if (list.size() < 10) {
......@@ -6289,7 +6311,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
list.add(vo);
}
}
writeSheet = EasyExcel.writerSheet("增员").build();
writeSheet = EasyExcel.writerSheet(searchVo.getDisMonth()).build();
// 第一次写入会创建头
excelWriter.write(new ArrayList<>(), writeSheet, writeTable0);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
......@@ -6302,7 +6324,28 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excelWriter.write(new ArrayList<>(),writeSheet, writeTable7);
}
} else {
writeSheet = EasyExcel.writerSheet("增员").build();
if (list.size() < 10) {
int size = 10 - list.size();
int num = list.size() + 1;
for (int i =1;i<= size;i++) {
vo = new TDispatchFundSupplementaryExportVo();
vo.setNum(num);
num ++;
list.add(vo);
}
}
writeSheet = EasyExcel.writerSheet(searchVo.getDisMonth()).build();
// 第一次写入会创建头
excelWriter.write(new ArrayList<>(), writeSheet, writeTable0);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
// 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(new ArrayList<>(),writeSheet, writeTable2);
excelWriter.write(list, writeSheet, writeTable3);
excelWriter.write(new ArrayList<>(),writeSheet, writeTable4);
excelWriter.write(new ArrayList<>(),writeSheet, writeTable5);
excelWriter.write(new ArrayList<>(),writeSheet, writeTable6);
excelWriter.write(new ArrayList<>(),writeSheet, writeTable7);
excelWriter.write(list,writeSheet);
}
if (excelWriter!= null) {
......@@ -6704,72 +6747,52 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
public List<List<String>> headQ(SocialHandleSearchVo searchVo) {
List<List<String>> list = new ArrayList<>();
//表头数据
String a ="";
String b =" ";
String c =" ";
String d =" ";
String a = "";
String b = " ";
String c = " ";
String d = " ";
//第一列
TDispatchFundSumExportVo dispatchFundSumExportVo =getFundSumExportVo(searchVo);
if(Common.isNotNull(dispatchFundSumExportVo)) {
if(dispatchFundSumExportVo.getNumOne()!=null) {
TDispatchFundSumExportVo dispatchFundSumExportVo = getFundSumExportVo(searchVo);
if (Common.isNotNull(dispatchFundSumExportVo)) {
if (dispatchFundSumExportVo.getNumOne() != null) {
a = dispatchFundSumExportVo.getNumOne().toString();
}
if(dispatchFundSumExportVo.getNumTwo()!=null){
b = dispatchFundSumExportVo.getNumTwo().toString();
if (dispatchFundSumExportVo.getNumTwo() != null) {
b = dispatchFundSumExportVo.getNumTwo().toString();
}
if(dispatchFundSumExportVo.getMonenyOne()!=null) {
c = dispatchFundSumExportVo.getMonenyOne().toString();
if (dispatchFundSumExportVo.getMonenyOne() != null) {
c = dispatchFundSumExportVo.getMonenyOne().toString();
}
if(dispatchFundSumExportVo.getMonenyTwo()!=null) {
d = dispatchFundSumExportVo.getMonenyTwo().toString();
if (dispatchFundSumExportVo.getMonenyTwo() != null) {
d = dispatchFundSumExportVo.getMonenyTwo().toString();
}
if(dispatchFundSumExportVo.getNumOne()==0){
a="";
if (dispatchFundSumExportVo.getNumOne() == 0) {
a = "";
}
if(dispatchFundSumExportVo.getNumTwo()==0){
b=" ";
if (dispatchFundSumExportVo.getNumTwo() == 0) {
b = " ";
}
list.add(Lists.newArrayList("项目合计", "项目合计", "本月小计"));
//第二列
list.add(Lists.newArrayList("项目合计", "项目合计", "本月小计"));
//第三列
list.add(Lists.newArrayList("本月增加汇款", "人数", b));
list.add(Lists.newArrayList("本月增加汇款", "金额", c));
//第四列
list.add(Lists.newArrayList("本月减少汇款", "人数", a));
//第五列
list.add(Lists.newArrayList("本月减少汇款", "金额", d));
//第六列
list.add(Lists.newArrayList("本月汇款", "人数", ""));
//第七列
list.add(Lists.newArrayList("本月汇款", "金额", ""));
}
return list;
}
/**
* @return
* @Author wzb
* @Description 导出公积金派单花名册
* @Date 09:05 2023/7/21
*/
public List<List<String>> headE() {
List<List<String>> list = new ArrayList<>();
//表头数据
list.add(Lists.newArrayList("项目合计", "项目合计", "本月小计"));
//第二列
list.add(Lists.newArrayList("项目合计", "项目合计", "本月小计"));
//第三列
list.add(Lists.newArrayList("本月增加汇款", "人数", b));
//第一列
list.add(Lists.newArrayList("本月小计", "本月小计"));
list.add(Lists.newArrayList("本月增加汇款", "金额", c));
//第四列
list.add(Lists.newArrayList("本月减少汇款", "人数", a));
//第五列
list.add(Lists.newArrayList("本月减少汇款", "金额", d));
//第六列
list.add(Lists.newArrayList("本月汇款", "人数", ""));
//第七列
list.add(Lists.newArrayList("本月汇款", "金额", ""));
return list;
}
......@@ -6779,17 +6802,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Description 导出社保派单花名册
* @Date 11:12 2023/7/21
*/
public List<List<String>> FundHeadR() {
public List<List<String>> FundHeadT() {
List<List<String>> list = new ArrayList<>();
//表头数据
list.add(Lists.newArrayList("备注", "备注"));
list.add(Lists.newArrayList("备注", "备注"));
String a="1.新增人员必须填写身份证号码。\n"+
"2.本表只提供单位缴存人数变动使用。\n"+
"3.对于工资基数调整及个人补缴业务不得使用此表。\n"+
"4.单位封存人员启封时,如缴存基数发生变化须附基数调整清册\n"+"本单位承诺变更清册中所填内容均真实、合法、有效,如有不实之处,单位承担相应的法律责任及由此产生的一切后果。";
for (int i = 2; i <= 7; i++) {
list.add(Lists.newArrayList(a));
String b = "制表人: 电话: " + "制表时间: " + DateUtil.getYear(DateUtil.getCurrentDateTime()) + " 年" + " " + DateUtil.getMonth(DateUtil.getCurrentDateTime()) + " 月" + " " + DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日";
//第一列-第十八列
for (int i = 1; i <= 8; i++) {
list.add(Lists.newArrayList(b));
}
return list;
}
......@@ -6800,13 +6819,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Description 导出社保派单花名册
* @Date 11:12 2023/7/21
*/
public List<List<String>> FundHeadT() {
public List<List<String>> FundHeadR() {
List<List<String>> list = new ArrayList<>();
//表头数据
String b = "制表人: 电话: " + "制表时间: " + DateUtil.getYear(DateUtil.getCurrentDateTime()) + " 年" + " " + DateUtil.getMonth(DateUtil.getCurrentDateTime()) + " 月" + " " + DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日";
//第一列-第十八列
for (int i = 1; i <= 8; i++) {
list.add(Lists.newArrayList(b));
list.add(Lists.newArrayList(" 备注", " 备注"));
list.add(Lists.newArrayList(" 备注", " 备注"));
String a="1.新增人员必须填写身份证号码。\n"+
"2.本表只提供单位缴存人数变动使用。\n"+
"3.对于工资基数调整及个人补缴业务不得使用此表。\n"+
"4.单位封存人员启封时,如缴存基数发生变化须附基数调整清册\n"+"本单位承诺变更清册中所填内容均真实、合法、有效,如有不实之处,单位承担相应的法律责任及由此产生的一切后果。";
for (int i = 2; i <= 7; i++) {
list.add(Lists.newArrayList(a));
}
return list;
}
......@@ -6889,6 +6912,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
list.add(Lists.newArrayList("单位公积金账号", "单边缴存比例"));
if(houseNameConfigVo.getCustomerNo()==null){
houseNameConfigVo.setCustomerNo("");
}
list.add(Lists.newArrayList(houseNameConfigVo.getCustomerNo(), houseNameConfigVo.getCompanyPro().toString()+"%"));
list.add(Lists.newArrayList(houseNameConfigVo.getCustomerNo(), houseNameConfigVo.getCompanyPro().toString()+"%"));
......@@ -6921,7 +6948,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//第七列
list.add(Lists.newArrayList("补缴时间", "起始(年月日)"));
list.add(Lists.newArrayList(searchVo.getDisMonth(), "截至(年月日)"));
list.add(Lists.newArrayList("补缴时间", "截至(年月日)"));
//第八列
......@@ -6947,15 +6974,24 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
List<List<String>> list = new ArrayList<>();
//表头数据
//第一列
TDispatchFundSumVo tDispatchFundSumVo= getFundSumVo(searchVo);
String a=tDispatchFundSumVo.getSupplementaryAmountSum().toString();
String a="";
HouseNameConfigVo houseNameConfigVo=getFundSumExportVoTwo(searchVo.getProvidentHouseholdName());
if(houseNameConfigVo!=null) {
TDispatchFundSumVo tDispatchFundSumVo = getFundSumVo(searchVo, houseNameConfigVo.getCompanyPro());
if (tDispatchFundSumVo.getSupplementaryAmountSum()!= null&&tDispatchFundSumVo.getNumber()!="0") {
a = tDispatchFundSumVo.getSupplementaryAmountSum().toString();
} else {
a = "0";
}
}
list.add(Lists.newArrayList("", ""));
//第二列
list.add(Lists.newArrayList("合计补缴金额(大写):", "合计补缴金额(大写):"));
//第三列
//第四列
int b =Integer.parseInt(a);
String c=int2big(b).toString();
int b=Double.valueOf(a).intValue();
String c=int2big(b);
list.add(Lists.newArrayList(a, a));
//第五列
list.add(Lists.newArrayList(c, c));
......@@ -6970,10 +7006,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
public List<List<String>> headQFour() {
public List<List<String>> headQFour(SocialHandleSearchVo searchVo) {
List<List<String>> list = new ArrayList<>();
//表头数据
//第一列
HouseNameConfigVo houseNameConfigVo=getFundSumExportVoTwo(searchVo.getProvidentHouseholdName());
TDispatchFundSumVo dispatchFundSumVo=getFundSumVo(searchVo,houseNameConfigVo.getCompanyPro());
String F=dispatchFundSumVo.getNumber();
list.add(Lists.newArrayList("单位申请\n" +"补缴意见"));
list.add(Lists.newArrayList("单位申请\n" +"补缴意见"));
......@@ -6984,10 +7023,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
list.add(Lists.newArrayList("", "","","","","负责人:"," 年 月 日"));
//第三列
list.add(Lists.newArrayList("补缴合计", "此次申请补缴共有20人","49676","补缴原因","补缴原因","补缴原因"));
list.add(Lists.newArrayList("补缴合计", "补缴合计","补缴合计","补缴原因","补缴原因","补缴原因"));
list.add(Lists.newArrayList("", "",""));
list.add(Lists.newArrayList("", "",""));
list.add(Lists.newArrayList("此次申请补缴共有"+dispatchFundSumVo.getNumber()+"人", "补缴总额"+dispatchFundSumVo.getSupplementaryAmountSum().toString(),""));
list.add(Lists.newArrayList("此次申请补缴共有"+dispatchFundSumVo.getNumber()+"人", "补缴总额"+dispatchFundSumVo.getSupplementaryAmountSum().toString(),""));
//第四列
......
......@@ -209,7 +209,7 @@
<resultMap id="FundSupplementary" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchFundSumVo">
<result property="supplementaryAmountSum" column="SUPPLEMENTART_AMOUNT_SUM"/>
<result property="number" column="NUMBER"/>
</resultMap>
<resultMap id="FundSumExport" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchFundSumExportVo">
......@@ -1265,6 +1265,25 @@
group by a.EMP_IDCARD) h
</select>
<select id="getFCount" resultType="java.lang.Integer">
SELECT count(1) from (
SELECT 1
FROM t_dispatch_info a
<where>
<include refid="where_getFundDisRecord"/>
</where>
group by a.EMP_IDCARD ,a.TYPE) h
</select>
<select id="getSocialDisRecordCount" resultType="java.lang.Integer">
SELECT count(1) from (
SELECT 1
FROM t_dispatch_info a
<where>
<include refid="where_getSocialDisRecord"/>
</where>
group by a.EMP_IDCARD) h
</select>
<!--tDispatchInfo 社保医疗花名册派单数据-->
<select id="getSocialDisRecord" resultMap="socialDisExportMap">
......@@ -1954,6 +1973,30 @@
</if>
</if>
</sql>
<sql id="where_getFund">
a.DELETE_FLAG = 0
AND a.fund_id is not null
AND a.STATUS in ('2','4')
AND a.DISPATCH_ITEM like concat('%','公积金','%')
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND a.PROVIDENT_HOUSEHOLD_NAME = #{tDispatchInfo.providentHouseholdName}
</if>
<if test="tDispatchInfo.type != null and tDispatchInfo.type.trim() != ''">
AND a.TYPE = #{tDispatchInfo.type}
</if>
<if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''">
AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth}
</if>
<if test="tDispatchInfo.fundHandleStatus != null and tDispatchInfo.fundHandleStatus.trim() != ''">
AND a.FUND_HANDLE_STATUS = #{tDispatchInfo.fundHandleStatus}
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
</if>
</if>
</sql>
<sql id="where_getSocialPersionDisRecord">
......@@ -1999,41 +2042,62 @@
<!--tDispatchInfo 社保医疗花名册派单数据-->
<select id="getFundPersionExportVo" resultMap="FundExport">
SELECT
(@i :=@i+1) as NUM,
a.EMP_NAME,
a.EMP_IDCARD,
s.UNIT_PROVIDENG_CARDINAL AS DEPOSIT_BASE ,
IF(a.TYPE=0 ,s.UNIT_PROVIDENT_FEE*2,NULL) as MOTHLY_INCREASE,
IF(a.TYPE=1 ,s.UNIT_PROVIDENT_FEE*2,NULL) as MOTHLY_DECREASE,
case when a.TYPE=0 then "新增"
else "减少" end as CAUSE_CHANGE
FROM t_dispatch_info a
left join t_provident_fund s on s.id=a.FUND_ID
,(select @i:=0) as itable
( @i := @i + 1 ) AS NUM,
h.EMP_NAME,
h.EMP_IDCARD,
h.DEPOSIT_BASE,
h.MOTHLY_INCREASE,
h.MOTHLY_DECREASE,
h.CAUSE_CHANGE
FROM
(
SELECT
a.EMP_NAME,
a.EMP_IDCARD,
s.UNIT_PROVIDENG_CARDINAL AS DEPOSIT_BASE,
IF
( a.TYPE = 0, s.UNIT_PROVIDENT_FEE * 2, NULL ) AS MOTHLY_INCREASE,
IF
( a.TYPE = 1, s.UNIT_PROVIDENT_FEE * 2, NULL ) AS MOTHLY_DECREASE,
CASE
WHEN a.TYPE = 0 THEN
"新增" ELSE "减少"
END AS CAUSE_CHANGE
FROM
t_dispatch_info a
LEFT JOIN t_provident_fund s ON s.id = a.FUND_ID
<where>
<include refid="where_getFundDisRecord"/>
</where>
GROUP BY
a.EMP_IDCARD,
a.TYPE
ORDER BY
a.TYPE
) h,(select @i:=0) as itable
</select>
<!--tDispatchInfo 社保医疗花名册派单数据-->
<select id="getFundSupplementarynExportVo" resultMap="FundSupplementaryExport">
SELECT
(@i :=@i+1) as NUM,
( @i := @i + 1 ) AS NUM,
a.EMP_NAME,
a.EMP_IDCARD,
s.UNIT_PROVIDENG_CARDINAL AS DEPOSIT_BASE ,
replace( DATE_FORMAT(s.PROVIDENT_START,"%Y-%m"),'-','') as ORIGINATE,
replace( DATE_FORMAT(DATE(CURDATE()),"%Y-%m"),'-','') as END,
ROUND(SUM((abs(PERIOD_DIFF(replace(DATE_FORMAT(s.PROVIDENT_START,"%Y-%m"), '-', ''),
#{tDispatchInfo.disMonth})))*s.UNIT_PROVIDENT_PER*s.UNIT_PROVIDENG_CARDINAL )
)
AS SUPPLEMENTART_AMOUNT
FROM t_dispatch_info a
left join t_provident_fund s on s.id=a.FUND_ID
,(select @i:=0) as itable
s.UNIT_PROVIDENG_CARDINAL AS DEPOSIT_BASE,
REPLACE ( DATE_FORMAT( s.PROVIDENT_START, "%Y-%m" ), '-', '' ) AS ORIGINATE,
#{tDispatchInfo.disMonth} AS END,
ROUND((PERIOD_DIFF(#{tDispatchInfo.disMonth},REPLACE ( DATE_FORMAT( s.PROVIDENT_START, "%Y-%m" ), '-', '' )))*#{companyPro}*s.UNIT_PROVIDENG_CARDINAL*0.01 ) AS SUPPLEMENTART_AMOUNT
FROM
t_dispatch_info a
LEFT JOIN t_provident_fund s ON s.id = a.FUND_ID,(
SELECT
@i := 0
) AS itable
<where>
<include refid="where_getFundDisRecord"/>
<include refid="where_getFund"/>
</where>
</select>
<select id="getFundSumExportVo" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchFundSumExportVo">
......@@ -2050,13 +2114,12 @@
</select>
<select id="getFundSumExportVoOne" resultMap="FundSupplementary">
SELECT
ROUND(SUM((abs(PERIOD_DIFF(replace(DATE_FORMAT(s.PROVIDENT_START,"%Y-%m"), '-', ''),
#{tDispatchInfo.disMonth})))*0.1*s.UNIT_PROVIDENG_CARDINAL )
) AS SUPPLEMENTART_AMOUNT_SUM
count(a.EMP_IDCARD) as NUMBER,
SUM(ROUND((PERIOD_DIFF(#{tDispatchInfo.disMonth},REPLACE (DATE_FORMAT( DATE_ADD(s.PROVIDENT_START,INTERVAL 1 MONTH), "%Y-%m" ), '-', '' )))*#{companyPro}*s.UNIT_PROVIDENG_CARDINAL*0.01 )) AS SUPPLEMENTART_AMOUNT_SUM
FROM t_dispatch_info a
left join t_provident_fund s on s.id = a.FUND_ID
<where>
<include refid="where_getFundDisRecord"/>
<include refid="where_getFund"/>
</where>
</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