This commit is contained in:
管李杰 2024-08-08 16:51:09 +08:00
commit 82c4888693
6 changed files with 23 additions and 0 deletions

View File

@ -855,4 +855,10 @@ public class DisasterInfoController {
return R.data(disasterInfoService.getUserDisasterInfoListNew(Condition.getPage(query), params.get("userId"),params.get("roleId"))); return R.data(disasterInfoService.getUserDisasterInfoListNew(Condition.getPage(query), params.get("userId"),params.get("roleId")));
} }
//home页面 受影响国家统计
@GetMapping("/getAffectedCountryCount")
public R<Integer> getAffectedCountryCount() {
return R.data(disasterInfoService.getAffectedCountryCount());
}
} }

View File

@ -60,6 +60,9 @@ public class ToolController{
if(!StringUtils.isEmpty(tool.getRelatedDisasterType())) { if(!StringUtils.isEmpty(tool.getRelatedDisasterType())) {
queryWrapper.eq("related_disaster_type", tool.getRelatedDisasterType()); queryWrapper.eq("related_disaster_type", tool.getRelatedDisasterType());
} }
if(!StringUtils.isEmpty(tool.getDisasterType())) {
queryWrapper.like("disaster_type", tool.getDisasterType());
}
String checkd = tool.getChecked(); String checkd = tool.getChecked();
if(checkd != null && checkd.equals("1")){ if(checkd != null && checkd.equals("1")){
queryWrapper.isNull("review_time"); queryWrapper.isNull("review_time");

View File

@ -117,4 +117,6 @@ public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, @Param("userId") String userId); IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, @Param("userId") String userId);
void updateApplyForCount(@Param("id") Long id); void updateApplyForCount(@Param("id") Long id);
Integer getAffectedCountryCount();
} }

View File

@ -1750,4 +1750,9 @@
id=#{id} id=#{id}
</where> </where>
</update> </update>
<select id="getAffectedCountryCount" resultType="java.lang.Integer">
SELECT count(*) FROM
(SELECT disaster_country FROM `disaster_info` GROUP BY disaster_country) disaster
</select>
</mapper> </mapper>

View File

@ -98,4 +98,6 @@ public interface DisasterInfoService extends IService<DisasterInfo> {
IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, String userId, String roleId); IPage<DisasterInfo> getUserDisasterInfoListNew(IPage<Object> page, String userId, String roleId);
void updateApplyForCount(Long disasterId); void updateApplyForCount(Long disasterId);
Integer getAffectedCountryCount();
} }

View File

@ -626,4 +626,9 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
public void updateApplyForCount(Long disasterId) { public void updateApplyForCount(Long disasterId) {
baseMapper.updateApplyForCount(disasterId); baseMapper.updateApplyForCount(disasterId);
} }
@Override
public Integer getAffectedCountryCount() {
return baseMapper.getAffectedCountryCount();
}
} }