Commit 51afacdb authored by lixuan's avatar lixuan

feat: 新需求

parent 1b3cc8b0
Pipeline #146823 failed with stages
in 1 second
......@@ -111,4 +111,9 @@ public class HouseResourceController {
public AjaxResult getBusinessEntityInfo(@RequestParam("name") String name) {
return AjaxResult.success(houseResourceService.listByBusinessEntityInfoName(name));
}
@GetMapping("/dataCollection")
public AjaxResult getHouseResourceDataCollection(HouseResourceDataCollectionQuery query) {
return AjaxResult.success(houseResourceService.houseResourceDataCollection(query));
}
}
package com.ruoyi.system.domain.house.vo;
import lombok.Data;
import java.util.List;
@Data
public class HouseResourceDataCollection {
private List<HouseResourceDataCollectionSimpleObject> newObject;
private List<HouseResourceDataCollectionSimpleObject> editObject;
}
package com.ruoyi.system.domain.house.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class HouseResourceDataCollectionQuery {
private String two;
private String three;
private String four;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endDate;
}
package com.ruoyi.system.domain.house.vo;
import lombok.Data;
@Data
public class HouseResourceDataCollectionSimpleObject {
private int type;
private long count;
}
......@@ -2,10 +2,10 @@ package com.ruoyi.system.mapper.house;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.system.domain.house.HouseResource;
import com.ruoyi.system.domain.house.vo.HouseResourcePage;
import com.ruoyi.system.domain.house.vo.HouseResourcePageQuery;
import com.ruoyi.system.domain.house.vo.*;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface HouseResourceMapper {
......@@ -35,4 +35,8 @@ public interface HouseResourceMapper {
List<HouseResourcePage> selectForContrast(@Param("two") String two, @Param("name") String name);
List<HouseResourcePage> selectByIdList(@Param("idList") List<String> idList);
List<HouseResourceDataCollectionSimpleObject> selectHouseResourceByCreateTime(@Param("query")HouseResourceDataCollectionQuery query);
List<HouseResourceDataCollectionSimpleObject> selectHouseResourceByUpdateTime(@Param("query")HouseResourceDataCollectionQuery query);
}
......@@ -35,4 +35,6 @@ public interface HouseResourceService {
void saveYearTax(YearTaxSaveUpdateDto dto);
List<BusinessEntityDto> listByBusinessEntityInfoName(String name);
HouseResourceDataCollection houseResourceDataCollection(HouseResourceDataCollectionQuery query);
}
......@@ -640,6 +640,16 @@ public class HouseResourceServiceImpl implements HouseResourceService {
return result ;
}
@Override
public HouseResourceDataCollection houseResourceDataCollection(HouseResourceDataCollectionQuery query) {
HouseResourceDataCollection houseResourceDataCollection = new HouseResourceDataCollection();
List<HouseResourceDataCollectionSimpleObject> newObjectList = houseResourceMapper.selectHouseResourceByCreateTime(query);
houseResourceDataCollection.setNewObject(newObjectList);
List<HouseResourceDataCollectionSimpleObject> editObjectList = houseResourceMapper.selectHouseResourceByUpdateTime(query);
houseResourceDataCollection.setEditObject(editObjectList);
return houseResourceDataCollection;
}
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list, boolean houseNumberSortFlag) {
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
......
......@@ -837,4 +837,58 @@
#{item}
</foreach>
</select>
<select id="selectHouseResourceByCreateTime"
resultType="com.ruoyi.system.domain.house.vo.HouseResourceDataCollectionSimpleObject">
SELECT
type,
COUNT(*) AS count
FROM
house_resource
<where>
<if test="query.two != null and query.two != ''">
AND two = #{query.two}
</if>
<if test="query.three != null and query.three != ''">
AND three = #{query.three}
</if>
<if test="query.four != null and query.four != ''">
AND four = #{query.four}
</if>
<if test="query.startDate != null">
AND create_time <![CDATA[ >= ]]> #{query.startDate}
</if>
<if test="query.endDate != null">
AND create_time <![CDATA[ <= ]]> #{query.endDate}
</if>
</where>
GROUP BY
type
</select>
<select id="selectHouseResourceByUpdateTime"
resultType="com.ruoyi.system.domain.house.vo.HouseResourceDataCollectionSimpleObject">
SELECT
type,
COUNT(*) AS count
FROM
house_resource
<where>
<if test="query.two != null and query.two != ''">
AND two = #{query.two}
</if>
<if test="query.three != null and query.three != ''">
AND three = #{query.three}
</if>
<if test="query.four != null and query.four != ''">
AND four = #{query.four}
</if>
<if test="startDate != null">
AND update_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null">
AND update_time <![CDATA[ <= ]]> #{endDate}
</if>
</where>
GROUP BY
type
</select>
</mapper>
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