Commit 4ea96990 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.5.6' into MVP1.5.6

parents 9250eaab b4c28267
......@@ -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);
......
......@@ -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