feat:当不是指定查询某个企业数据的时候,查询自己企业的数据
parent
e6cd88d54a
commit
1dfefd6cd3
|
|
@ -3,6 +3,7 @@ package com.zcloud.accident.persistence.repository.impl;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import com.zcloud.accident.domain.model.AccidentCountStat;
|
||||
|
|
@ -11,6 +12,7 @@ import com.zcloud.accident.persistence.mapper.AccidentMapper;
|
|||
import com.zcloud.accident.persistence.repository.AccidentRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -30,6 +32,9 @@ public class AccidentRepositoryImpl extends BaseRepositoryImpl<AccidentMapper, A
|
|||
|
||||
@Override
|
||||
public PageResponse<AccidentDO> listPage(Map<String, Object> params,String menuPerms) {
|
||||
if (Tools.isEmpty(params.getOrDefault("eqCorpinfoId",""))) {
|
||||
params.put("localCorpId", AuthContext.getTenantId());
|
||||
}
|
||||
IPage<AccidentDO> iPage = new Query<AccidentDO>().getPage(params);
|
||||
IPage<AccidentDO> result = accidentMapper.listPage(iPage, params,menuPerms);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
<if test="params.eqCorpinfoId != null">
|
||||
and tenant_id = #{params.eqCorpinfoId}
|
||||
</if>
|
||||
<if test="params.localCorpId != null">
|
||||
and tenant_id = #{params.localCorpId}
|
||||
</if>
|
||||
<if test="params.likeIncidentName != null and params.likeIncidentName != ''" >
|
||||
and incident_name like concat('%',#{params.likeIncidentName},'%')
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue