按条件出条件总数

This commit is contained in:
wangliwen 2022-06-27 19:58:24 +08:00
parent 7288012bf6
commit 99bb41556d
3 changed files with 50 additions and 8 deletions

View File

@ -37,6 +37,8 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
@Param("orderField") String orderField,
@Param("orderType") String orderType);
Long selectDTOPageCount(@Param("dto") ResourceDTO resourceDTO);
List<Map> selectApplyArea(Long userId);
/**
@ -49,6 +51,7 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
/**
* 介入部门数目
*
* @return
*/
Long countAllDept();
@ -113,13 +116,21 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
List<Map> selectResourceNumAsType(Map<String, Object> params);
Integer selectResourceCarNum(Map params);
Integer selectResourceCollectionNum(Map params);
Integer selectResourceBrowseNum(Map params);
Integer selectResourceRelNum(Map params);
Integer selectResourceShare(Map params);
// List<Map<String,Object>> selectDeptList(Map params);
List<Map<String,Object>> selectResurceCarDetails(Map params);
List<Map<String,Object>> applicationAreaCapabilityList(Map params);
List<Map<String,Object>> applicationUsedAreaCapabilityList(Map params);
List<Map<String,Object>> applicationAreaCapabilityUseList(Map params);
// List<Map<String,Object>> selectDeptList(Map params);
List<Map<String, Object>> selectResurceCarDetails(Map params);
List<Map<String, Object>> applicationAreaCapabilityList(Map params);
List<Map<String, Object>> applicationUsedAreaCapabilityList(Map params);
List<Map<String, Object>> applicationAreaCapabilityUseList(Map params);
}

View File

@ -247,7 +247,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
if (resourceDTO.getInfoList().isEmpty()) {
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
resultPage.setRecords(resourceDTOS);
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
resultPage.setTotal(resourceDao.selectDTOPageCount(resourceDTO));
} else {
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType);
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
@ -313,7 +313,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
if (resourceDTO.getInfoList().isEmpty()) {
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
resultPage.setRecords(resourceDTOS);
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
resultPage.setTotal(resourceDao.selectDTOPageCount(resourceDTO));
} else {
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType);
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
@ -750,7 +750,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}
@Override
public List<Map<String, Object>> applicationAreaCapabilityUseList(Map params){
public List<Map<String, Object>> applicationAreaCapabilityUseList(Map params) {
return resourceDao.applicationAreaCapabilityUseList(params);
}

View File

@ -458,6 +458,37 @@
ORDER BY ${orderField} ${orderType}
LIMIT ${pageNum}, ${pageSize}
</select>
<select id="selectDTOPageCount" resultType="java.lang.Long">
SELECT
COUNT(DISTINCT tdr.id)
FROM
tb_data_resource tdr
WHERE
1 = 1
AND tdr.del_flag = 0
<if test="dto.name != null and dto.name != ''">
AND MATCH (tdr.name) AGAINST ( #{dto.name} IN BOOLEAN MODE)
<!--AND tdr.name LIKE CONCAT('%',#{dto.name},'%') -->
</if>
<if test="dto.type != null and dto.type != ''">
AND tdr.type = #{dto.type}
</if>
<if test="dto.districtId != null and dto.districtId != ''">
AND tdr.district_id = #{dto.districtId}
</if>
<if test="null != dto.deptIds and dto.deptIds.size > 0">
AND tdr.dept_id IN
<foreach collection="dto.deptIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.shareCondition != null and dto.shareCondition != ''">
AND tdr.share_condition = #{dto.shareCondition}
</if>
<if test="dto.deptId != null and dto.deptId != ''">
AND tdr.dept_id = #{dto.deptId}
</if>
</select>
<select id="selectApplyArea" resultType="java.util.Map">
SELECT