Commit cc40bdb8 authored by huyuchen's avatar huyuchen

花名册修改

parent b54ed2c1
......@@ -1216,18 +1216,33 @@
<!--tDispatchInfo 社保花名册派单数据count-->
<select id="getSocialDisRecordCount" resultType="java.lang.Integer">
SELECT
count(1)
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">
SELECT
(@i :=@i+1) as NUM,
h.EMP_NAME,
h.IDCARD_TYPE,
h.EMP_IDCARD,
h.DIS_MONTH,
h.MEDICAL_CARDINAL,
h.CHANGE_TYPE_ONE,
h.CHANGE_TYPE_TWO,
h.CHANGE_TYPE_THREE,
h.CHANGE_TYPE_FOUR,
h.EMP_MOBILE,
h.EDUCATION_NAME,
h.REMARK
from (
select
a.EMP_NAME,
'身份证' as IDCARD_TYPE,
a.EMP_IDCARD,
......@@ -1242,16 +1257,30 @@
a.EMP_MOBILE as REMARK
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where>
<include refid="where_getSocialDisRecord"/>
</where>
group by a.EMP_IDCARD) h,(select @i:=0) as itable
</select>
<!--tDispatchInfo 社保医疗花名册派单数据-->
<select id="getSocialReduceDisRecord" resultMap="socialDisExportMap">
SELECT
(@i :=@i+1) as NUM,
h.EMP_NAME,
h.IDCARD_TYPE,
h.EMP_IDCARD,
h.DIS_MONTH,
h.MEDICAL_CARDINAL,
h.CHANGE_TYPE_ONE,
h.CHANGE_TYPE_TWO,
h.CHANGE_TYPE_THREE,
h.CHANGE_TYPE_FOUR,
h.EMP_MOBILE,
h.EDUCATION_NAME,
h.REMARK
from (
select
a.EMP_NAME,
'身份证' as IDCARD_TYPE,
a.EMP_IDCARD,
......@@ -1266,25 +1295,47 @@
a.EMP_MOBILE as REMARK
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where>
<include refid="where_getSocialDisRecord"/>
</where>
group by a.EMP_IDCARD) h,(select @i:=0) as itable
</select>
<!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionDisCount" resultType="java.lang.Integer">
SELECT count(1)
SELECT count(1) from (
select 1
FROM t_dispatch_info a
<where>
<include refid="where_getSocialPersionDisRecord"/>
</where>
group by a.EMP_IDCARD) h
</select>
<!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionDisRecord" resultMap="socialPersionDisExportMap">
SELECT
(@i :=@i+1) as num,
h.EMP_NAME,
h.EMP_NO,
h.EMP_IDCARD,
h.sex,
h.EMP_NATIONAL,
h.WORK_DATE,
h.type,
h.SIGNLE_TYPE,
h.INSURANCE_TYPE_ONE,
h.INSURANCE_TYPE_TWO,
h.INSURANCE_TYPE_THREE,
h.INSURANCE_TYPE_FOUR,
h.INSURANCE_TYPE_FIVE,
h.PERSION_CARDINAL,
h.MEDICAL_CARDINAL,
h.DATE_ONE,
h.CONTRACT_ADRESS,
h.REMARK
FROM (
SELECT
a.EMP_NAME,
'' as EMP_NO,
a.EMP_IDCARD,
......@@ -1322,25 +1373,52 @@
a.EMP_MOBILE as REMARK
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where>
<include refid="where_getSocialPersionDisRecord"/>
</where>
group by a.EMP_IDCARD)h,(select @i:=0) as itable
</select>
<!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionReduceDisCount" resultType="java.lang.Integer">
SELECT count(1)
SELECT count(1) from (
SELECT 1
FROM t_dispatch_info a
<where>
<include refid="where_getSocialPersionDisRecord"/>
</where>
group by a.EMP_IDCARD) h
</select>
<!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionReduceDisRecord" resultMap="socialPersionReduceDisExportMap">
SELECT
(@i :=@i+1) as num,
h.EMP_NO,
h.EMP_NAME,
h.EMP_IDCARD,
h.WORK_DATE,
h.typeA,
h.typeB,
h.typeC,
h.typeD,
h.typeE,
h.typeW,
h.typeF,
h.typeG,
h.typeH,
h.typeZ,
h.typeJ,
h.typeK,
h.typeL,
h.typeM,
h.typeN,
h.typeO,
h.typeP,
h.typeQ,
h.REMARK
FROM (
SELECT
'' as EMP_NO,
a.EMP_NAME,
a.EMP_IDCARD,
......@@ -1366,10 +1444,10 @@
a.EMP_MOBILE as REMARK
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where>
<include refid="where_getSocialPersionDisRecord"/>
</where>
group by a.EMP_IDCARD) h,(select @i:=0) as itable
</select>
<!--tDispatchInfo 公积金变更清册查询-->
......@@ -1812,8 +1890,8 @@
<sql id="where_getSocialPersionDisRecord">
a.DELETE_FLAG = 0
AND a.social_id is not null
AND a.STATUS = "2"
AND (a.DISPATCH_ITEM like concat('%','工伤','%') or a.DISPATCH_ITEM like concat('%','养老','%'))
AND a.STATUS in ('2','4')
AND (a.DISPATCH_ITEM like concat('%','工伤','%') or a.DISPATCH_ITEM like concat('%','养老','%') or a.DISPATCH_ITEM like concat('%','失业','%'))
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
......@@ -1824,9 +1902,12 @@
<if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''">
AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''">
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != '' and tDispatchInfo.socialHandleStatus != 1">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != '' and tDispatchInfo.socialHandleStatus == 1">
AND a.SOCIAL_HANDLE_STATUS in ('1','3')
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
</if>
......
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