Commit baf34d44 authored by fangxinjiang's avatar fangxinjiang

查询优化

parent 7fc1b5fa
......@@ -128,7 +128,7 @@ public class TCustomerInfo extends BaseEntity {
* 原ID(数据迁移)
*/
@Schema(description = "原ID(数据迁移)")
private Integer oldId;
private String oldId;
/**
* 客户标识
......
......@@ -93,7 +93,7 @@ public class TSettleDomain extends BaseEntity {
* 原ID
*/
@Schema(description = "原ID")
private Integer oldId;
private String oldId;
/**
* 合同主体
......
......@@ -161,7 +161,7 @@ public class TEmpBadRecordController {
}
/**
* 批量导出项目档案信息
* 批量导出不良记录信息
* @param searchVo
* @return R<List>
* @Author FXJ
......
......@@ -30,8 +30,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor;
......
......@@ -401,7 +401,6 @@
${tEmployeeContractInfo.authSql}
</if>
</where>
GROUP BY a.id
order by a.CREATE_TIME desc
</select>
......
......@@ -500,7 +500,6 @@
and b.DELETE_FLAG = '0'
${tEmployeeInfo.authSql}
</if>
GROUP BY a.id
order by a.CREATE_TIME desc
</select>
......
......@@ -46,6 +46,11 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
*/
IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, @Param("tSalaryAccount") TSalaryAccount tSalaryAccount);
List<TSalaryAccount> getTSalaryAccountPageDiy( @Param("tSalaryAccount") TSalaryAccount tSalaryAccount,@Param("page")Long page, @Param("size")Long size);
long getTSalaryAccountPageCountDiy( @Param("tSalaryAccount") TSalaryAccount tSalaryAccount);
/**
* @param settleId
* @param settleMonth
......
......@@ -64,7 +64,21 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
*/
@Override
public IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo tSalaryAccount) {
return baseMapper.getTSalaryAccountPage(page, tSalaryAccount);
long pageCount = baseMapper.getTSalaryAccountPageCountDiy(tSalaryAccount);
page.setTotal(pageCount);
if (pageCount > 0L) {
page.setPages((long) Math.ceil(pageCount / page.getSize()));
}
if (page.getCurrent() < 1) {
page.setCurrent(1L);
}
if (page.getSize() < 1) {
page.setSize(10L);
}
if (pageCount > ((page.getCurrent() - 1) * page.getSize())) {
page.setRecords(baseMapper.getTSalaryAccountPageDiy(tSalaryAccount, (page.getCurrent() - 1) * page.getSize(), page.getSize()));
}
return page;
}
/**
......
......@@ -359,6 +359,39 @@
order by a.CREATE_TIME desc
</select>
<!--tSalaryAccount简单分页查询-->
<select id="getTSalaryAccountPageDiy" resultMap="tSalaryAccountMap">
SELECT
<include refid="Base_Column_List"/>
FROM (select * from t_salary_account
<if test="null != page and null != size">
limit #{page},#{size}
</if>
) a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="tSalaryAccount_where"/>
<if test="tSalaryAccount.authSql != null and tSalaryAccount.authSql.trim() != ''">
${tSalaryAccount.authSql}
</if>
</where>
order by a.CREATE_TIME desc
</select>
<select id="getTSalaryAccountPageCountDiy" resultType="java.lang.Long">
SELECT
count(1)
FROM t_salary_account a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="tSalaryAccount_where"/>
<if test="tSalaryAccount.authSql != null and tSalaryAccount.authSql.trim() != ''">
${tSalaryAccount.authSql}
</if>
</where>
order by a.CREATE_TIME desc
</select>
<!-- 获取校验的报账明细 ### 格式:身份证号_工资月份_报表类型_应发金额 -->
<select id="getAccountCheckList" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo">
select
......
......@@ -574,6 +574,23 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("申请编码" )
private String applyNo;
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 50)
@Schema(description = "社保户名称" )
@ExcelProperty("社保户名称" )
private String socialHouseholdName;
/**
* 公积金户名称
*/
@ExcelAttribute(name = "公积金户名称", maxLength = 50)
@Schema(description = "公积金户名称" )
@ExcelProperty("公积金户名称" )
private String providentHouseholdName;
/**
* 首次购买时间(第一派单月份)
*/
......
......@@ -553,9 +553,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(dispatch)){
if (Common.isNotNull(social)){
dispatch.setSocialId(social.getId());
dispatch.setSocialHouseholdName(social.getSocialHouseholdName());
}
if (Common.isNotNull(fund)){
dispatch.setFundId(fund.getId());
dispatch.setProvidentHouseholdName(fund.getProvidentHouseholdName());
}
if (Common.isNotNull(contract)){
dispatch.setContractId(contract.getId());
......@@ -2490,6 +2492,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(excel.getSocialReduceDate())){
dispatch.setSocialHandleStatus(CommonConstants.ZERO_STRING);
dispatch.setSocialId(socialFund.getSocialId());
dispatch.setProvidentHouseholdName(socialFund.getProvidentHouseholdName());
dispatch.setSocialProvince(socialFund.getSocialProvince());
dispatch.setSocialCity(socialFund.getSocialCity());
dispatch.setSocialTown(socialFund.getSocialTown());
......@@ -2526,6 +2529,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
dispatch.setFundHandleStatus(CommonConstants.ZERO_STRING);
dispatch.setFundId(socialFund.getFundId());
dispatch.setFundId(socialFund.getProvidentHouseholdName());
dispatch.setFundProvince(socialFund.getFundProvince());
dispatch.setFundCity(socialFund.getFundCity());
dispatch.setFundTown(socialFund.getFundTown());
......
......@@ -406,10 +406,10 @@
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND s.SOCIAL_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.socialHouseholdName}), '%')
AND a.SOCIAL_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.socialHouseholdName}), '%')
</if>
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND f.PROVIDENT_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.providentHouseholdName}), '%')
AND a.PROVIDENT_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.providentHouseholdName}), '%')
</if>
<if test="tDispatchInfo.createTimeStart != null">
AND a.CREATE_TIME <![CDATA[ >= ]]> #{tDispatchInfo.createTimeStart}
......@@ -426,19 +426,19 @@
<select id="getTDispatchInfoPage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>,
s.SOCIAL_HOUSEHOLD_NAME,
f.PROVIDENT_HOUSEHOLD_NAME
a.SOCIAL_HOUSEHOLD_NAME,
a.PROVIDENT_HOUSEHOLD_NAME
FROM t_dispatch_info a
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
left join t_socialfund_house_res p on p.USER_ID = #{tDispatchInfo.createBy}
</if>
left join t_social_info s on s.id=a.SOCIAL_ID
left join t_provident_fund f on f.id=a.FUND_ID
<!--left join t_social_info s on s.id=a.SOCIAL_ID
left join t_provident_fund f on f.id=a.FUND_ID-->
<where>
1=1
<include refid="tDispatchInfo_where"/>
</where>
group by a.id
order by a.CREATE_TIME desc
</select>
......@@ -457,8 +457,8 @@
a.SETTLE_DOMAIN_CODE,
a.TYPE,
a.DISPATCH_ITEM,
s.SOCIAL_HOUSEHOLD_NAME,
f.PROVIDENT_HOUSEHOLD_NAME,
a.SOCIAL_HOUSEHOLD_NAME,
a.PROVIDENT_HOUSEHOLD_NAME,
a.STATUS,
a.SOCIAL_HANDLE_STATUS,
s.PENSION_HANDLE,
......@@ -583,7 +583,7 @@
a.CREATE_NAME,
s.RECORD_BASE,
s.PAYMENT_TYPE,
s.SOCIAL_HOUSEHOLD_NAME,
a.SOCIAL_HOUSEHOLD_NAME,
s.SOCIAL_PROVINCE,
s.SOCIAL_CITY,
s.SOCIAL_TOWN,
......@@ -620,14 +620,14 @@
<select id="getTDispatchSocialHandlePage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>,
s.SOCIAL_HOUSEHOLD_NAME
a.SOCIAL_HOUSEHOLD_NAME
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 公积金办理数据查询-->
<select id="getTDispatchFundHandlePage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>,
f.PROVIDENT_HOUSEHOLD_NAME
a.PROVIDENT_HOUSEHOLD_NAME
<include refid="where_getFundRecord"/>
</select>
......@@ -650,7 +650,7 @@
a.EMP_MOBILE,
a.CREATE_NAME,
f.PROVIDENT_HOUSEHOLD_NAME,
a.PROVIDENT_HOUSEHOLD_NAME,
f.PROVIDENT_START,
f.UNIT_PROVIDENG_CARDINAL,
f.PERSONAL_PROVIDENT_CARDINAL,
......@@ -771,7 +771,7 @@
AND a.CREATE_TIME <![CDATA[>=]]> #{tDispatchInfo.createTimeStart}
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND s.SOCIAL_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.socialHouseholdName}), '%')
AND a.SOCIAL_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.socialHouseholdName}), '%')
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
......@@ -875,7 +875,7 @@
AND a.CREATE_TIME <![CDATA[>=]]> #{tDispatchInfo.createTimeStart}
</if>
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND f.PROVIDENT_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.providentHouseholdName}), '%')
AND a.PROVIDENT_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.providentHouseholdName}), '%')
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
......
......@@ -889,7 +889,7 @@
1=1
<include refid="tSocialFundInfo_where"/>
</where>
group by a.id
<!--group by a.id-->
order by a.CREATE_TIME desc
</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