Commit 758d59a6 authored by fangxinjiang's avatar fangxinjiang

查询优化

parent cab7a10d
...@@ -401,7 +401,6 @@ ...@@ -401,7 +401,6 @@
${tEmployeeContractInfo.authSql} ${tEmployeeContractInfo.authSql}
</if> </if>
</where> </where>
GROUP BY a.id
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </select>
......
...@@ -46,6 +46,11 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> { ...@@ -46,6 +46,11 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
*/ */
IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, @Param("tSalaryAccount") TSalaryAccount 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 settleId
* @param settleMonth * @param settleMonth
......
...@@ -64,6 +64,20 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper, ...@@ -64,6 +64,20 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
*/ */
@Override @Override
public IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo tSalaryAccount) { public IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo 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 baseMapper.getTSalaryAccountPage(page, tSalaryAccount); return baseMapper.getTSalaryAccountPage(page, tSalaryAccount);
} }
......
...@@ -359,6 +359,39 @@ ...@@ -359,6 +359,39 @@
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </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 id="getAccountCheckList" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo">
select 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