Browse Source

1.0.0 新增日历查询几棵藕

feature/v1.0.0
XB-20210411SXIT\Administrator 4 years ago
parent
commit
c938fb8837
  1. 19
      air/src/main/java/com/air/applets/controller/LandListedController.java
  2. 21
      air/src/main/java/com/air/land/mapper/LandListedMapper.java
  3. 10
      air/src/main/java/com/air/land/service/LandListedService.java
  4. 27
      air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java
  5. 3
      air/src/main/resources/application.yml
  6. 29
      air/src/main/resources/mapper/LandListedMapper.xml

19
air/src/main/java/com/air/applets/controller/LandListedController.java

@ -17,10 +17,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -111,6 +108,20 @@ public class LandListedController {
return landListedService.appletsStatistics(appletsVo);
}
/**
* 按日期统计地块数量(日历)
* @author peihao
* @param date 日期(yyyy-MM
* @param city 城市
* @date 2021/7/9
* @return
**/
@ApiOperation(value = "按日期统计地块数量(日历)", notes = "按日期统计地块数量(日历)")
@GetMapping("/calendar")
public R<List<LandListedStatisticsDto>> appletsCalendar(@RequestParam String date , String city) {
return landListedService.appletsCalendar(date,city);
}
}

21
air/src/main/java/com/air/land/mapper/LandListedMapper.java

@ -40,4 +40,25 @@ public interface LandListedMapper extends BaseMapper<LandListed> {
* @return
**/
List<LandDto> appletsLandListed(Page page , @Param("landVo")LandVo landVo);
/**
* 按挂牌日期统计地块数量(日历)
* @author peihao
* @param annoDate 挂牌日期(yyyy-MM
* @param city 城市
* @date 2021/7/9
* @return
**/
List<LandListedStatisticsDto> appletsCalendarToAnnoDate(@Param("annoDate") String annoDate , @Param("city") String city);
/**
* 按拍卖日期统计地块数量(日历)
* @author peihao
* @param auctionDate 拍卖日期(yyyy-MM
* @param city 城市
* @date 2021/7/9
* @return
**/
List<LandListedStatisticsDto> appletsCalendarToAuctionDate(@Param("auctionDate") String auctionDate , @Param("city") String city);
}

10
air/src/main/java/com/air/land/service/LandListedService.java

@ -33,6 +33,16 @@ public interface LandListedService extends IService<LandListed> {
**/
R<LandListedStatisticsDto> appletsStatistics(LandListedAppletsVo appletsVo);
/**
* 按日期统计地块数量
* @author peihao
* @param date 日期(yyyy-MM
* @param city 城市
* @date 2021/7/9
* @return
**/
R<List<LandListedStatisticsDto>> appletsCalendar(String date , String city);
/**
* 导入已挂牌地块信息
* @author peihao

27
air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java

@ -1,5 +1,6 @@
package com.air.land.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.air.applets.dto.LandDto;
import com.air.applets.vo.LandVo;
import com.air.land.dto.LandListedDto;
@ -61,6 +62,32 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
return R.ok(statisticsDto, "查询成功");
}
@Override
public R<List<LandListedStatisticsDto>> appletsCalendar(String date, String city) {
List<LandListedStatisticsDto> annoDateList = baseMapper.appletsCalendarToAnnoDate(date, city);
List<LandListedStatisticsDto> auctionDateList = baseMapper.appletsCalendarToAuctionDate(date, city);
if (CollectionUtil.isEmpty(annoDateList)){
return R.ok(auctionDateList);
}
if (CollectionUtil.isEmpty(auctionDateList)){
return R.ok(annoDateList);
}
List<LandListedStatisticsDto> indexs = new ArrayList<>();
for(LandListedStatisticsDto annoDateVo : annoDateList){
for(int i =0 ;i<auctionDateList.size();i++){
if (annoDateVo.getDate().equals(auctionDateList.get(i).getDate())){
annoDateVo.setAuctionCount(auctionDateList.get(i).getAuctionCount());
indexs.add(auctionDateList.get(i));
}
}
}
auctionDateList.removeAll(indexs);
if (CollectionUtil.isNotEmpty(auctionDateList)){
annoDateList.addAll(auctionDateList);
}
return R.ok(annoDateList);
}
@Override
public boolean importLandListExcel(MultipartFile file) {
List<LandListed> dataList;

3
air/src/main/resources/application.yml

@ -52,7 +52,7 @@ spring:
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
tenant-enable: ture
tenant-enable: true
mapper-locations: classpath*:/mapper/**/*Mapper.xml
global-config:
banner: false
@ -77,6 +77,7 @@ security:
scope: server
ignore-urls:
- /druid/**
# - /**
# 文件系统
minio:

29
air/src/main/resources/mapper/LandListedMapper.xml

@ -118,4 +118,33 @@
</select>
<select id="appletsCalendarToAnnoDate" resultType="com.air.land.dto.LandListedStatisticsDto">
SELECT
count( ll.land_listed_id ) listedCount,
DATE_FORMAT(ll.anno_date,'%Y-%m-%d') date
FROM
land_listed ll
where
DATE_FORMAT(ll.anno_date,'%Y-%m') = #{annoDate}
<if test="city != null and city != ''">
and city = #{city}
</if>
GROUP BY DATE_FORMAT(ll.anno_date,'%Y-%m-%d')
</select>
<select id="appletsCalendarToAuctionDate" resultType="com.air.land.dto.LandListedStatisticsDto">
SELECT
count( ll.land_listed_id ) auctionCount,
DATE_FORMAT(ll.auction_date,'%Y-%m-%d') date
FROM
land_listed ll
where
DATE_FORMAT(ll.auction_date,'%Y-%m') = #{auctionDate}
<if test="city != null and city != ''">
and city = #{city}
</if>
GROUP BY DATE_FORMAT(ll.auction_date,'%Y-%m-%d')
</select>
</mapper>

Loading…
Cancel
Save