Merge remote-tracking branch 'origin/upgrade' into upgrade
This commit is contained in:
commit
e0821a8715
@ -124,4 +124,6 @@ public interface IHouseDao {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PopulationDTO> findPopulation(Map<String, Object> params);
|
List<PopulationDTO> findPopulation(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<HouseDTO> listForAll(Map<String, Object> params);
|
||||||
}
|
}
|
@ -129,6 +129,8 @@ public class HouseDTO {
|
|||||||
private String houseType;
|
private String houseType;
|
||||||
@ApiModelProperty(name = "populationVOList", value = "同住人信息")
|
@ApiModelProperty(name = "populationVOList", value = "同住人信息")
|
||||||
private List<PopulationDTO> populationDTOList;
|
private List<PopulationDTO> populationDTOList;
|
||||||
|
@ApiModelProperty(name = "count", value = "房屋人员")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
public String getHouseId() {
|
public String getHouseId() {
|
||||||
return houseId;
|
return houseId;
|
||||||
@ -577,4 +579,12 @@ public class HouseDTO {
|
|||||||
public void setPopulationDTOList(List<PopulationDTO> populationDTOList) {
|
public void setPopulationDTOList(List<PopulationDTO> populationDTOList) {
|
||||||
this.populationDTOList = populationDTOList;
|
this.populationDTOList = populationDTOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCount(Integer count) {
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,12 @@ import java.sql.DriverManager;
|
|||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: HouseServiceImpl
|
* @ClassName: HouseServiceImpl
|
||||||
@ -247,6 +249,7 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BatchHouseDTO getAllHouse(Map<String, Object> params) {
|
public BatchHouseDTO getAllHouse(Map<String, Object> params) {
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
// 获取当前登陆人ID
|
// 获取当前登陆人ID
|
||||||
UserInfoBO userInfoBO = this.securityComponent.getCurrentUser();
|
UserInfoBO userInfoBO = this.securityComponent.getCurrentUser();
|
||||||
String userId = userInfoBO.getUserId();
|
String userId = userInfoBO.getUserId();
|
||||||
@ -262,9 +265,10 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
|
|||||||
batchHouseDTO.setUnitCount(unitNum.toString());
|
batchHouseDTO.setUnitCount(unitNum.toString());
|
||||||
|
|
||||||
// 获取当前楼栋下的所有房屋信息
|
// 获取当前楼栋下的所有房屋信息
|
||||||
List<HouseDTO> houseDTOList = houseDao.list(params);
|
List<HouseDTO> houseDTOList = houseDao.listForAll(params);
|
||||||
|
|
||||||
List<BatchHouseDTO.Floor> floorList = new ArrayList<>();
|
List<BatchHouseDTO.Floor> floorList = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 1; i <= floorsNum; i++) {
|
for (int i = 1; i <= floorsNum; i++) {
|
||||||
BatchHouseDTO.Floor floor = new BatchHouseDTO.Floor();
|
BatchHouseDTO.Floor floor = new BatchHouseDTO.Floor();
|
||||||
floor.setName(i + "层");
|
floor.setName(i + "层");
|
||||||
@ -281,7 +285,7 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
|
|||||||
BatchHouseDTO.House house = new BatchHouseDTO.House();
|
BatchHouseDTO.House house = new BatchHouseDTO.House();
|
||||||
if (null != houseDTO.getAffiliationFloors()) {
|
if (null != houseDTO.getAffiliationFloors()) {
|
||||||
if (i == Integer.valueOf(houseDTO.getAffiliationFloors())) {
|
if (i == Integer.valueOf(houseDTO.getAffiliationFloors())) {
|
||||||
if (null != houseDTO.getAffiliatedUnit()) {
|
if (null != houseDTO.getAffiliationUnit()) {
|
||||||
if (j == Integer.valueOf(houseDTO.getAffiliationUnit())) {
|
if (j == Integer.valueOf(houseDTO.getAffiliationUnit())) {
|
||||||
house.setIsCreator(0);
|
house.setIsCreator(0);
|
||||||
house.setPopulationCount(0);
|
house.setPopulationCount(0);
|
||||||
@ -291,9 +295,9 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
|
|||||||
if (userId.equals(houseDTO.getCreator()) || isAdmin()) {
|
if (userId.equals(houseDTO.getCreator()) || isAdmin()) {
|
||||||
house.setIsCreator(1);
|
house.setIsCreator(1);
|
||||||
// 获取当前房屋内的人数
|
// 获取当前房屋内的人数
|
||||||
params.put("houseId", houseDTO.getHouseId());
|
/*params.put("houseId", houseDTO.getHouseId());
|
||||||
Integer count = populationService.count(params);
|
Integer count = populationService.count(params);*/
|
||||||
house.setPopulationCount(count);
|
house.setPopulationCount(houseDTO.getCount());
|
||||||
}
|
}
|
||||||
houseList.add(house);
|
houseList.add(house);
|
||||||
}
|
}
|
||||||
@ -329,7 +333,10 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
|
|||||||
floor.setUnits(new ArrayList<>());
|
floor.setUnits(new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
long executeTime = endTime - startTime;
|
||||||
|
|
||||||
|
System.out.println("代码执行时间:" + executeTime + "毫秒");
|
||||||
return batchHouseDTO;
|
return batchHouseDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
|
|||||||
|
|
||||||
// 获取人员
|
// 获取人员
|
||||||
PopulationInfoBaseDTO base = populationInfoService.getBase(populationDTO.getPopulationInfoId());
|
PopulationInfoBaseDTO base = populationInfoService.getBase(populationDTO.getPopulationInfoId());
|
||||||
populationInfoService.getTuoMin(base);
|
// populationInfoService.getTuoMin(base);
|
||||||
populationInfoHouseDTO.setPopulationInfoBaseDTO(base);
|
populationInfoHouseDTO.setPopulationInfoBaseDTO(base);
|
||||||
|
|
||||||
populationDTO.setPopulationInfoHouseDTO(populationInfoHouseDTO);
|
populationDTO.setPopulationInfoHouseDTO(populationInfoHouseDTO);
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
<result column="is_delete" property="isDelete"/>
|
<result column="is_delete" property="isDelete"/>
|
||||||
<result column="street" property="street"/>
|
<result column="street" property="street"/>
|
||||||
<result column="street_name" property="streetName"/>
|
<result column="street_name" property="streetName"/>
|
||||||
|
<result column="count" property="count"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="houseBO" type="com.cm.population.pojo.bos.house.HouseBO">
|
<resultMap id="houseBO" type="com.cm.population.pojo.bos.house.HouseBO">
|
||||||
@ -186,8 +187,7 @@
|
|||||||
|
|
||||||
<!-- 新增房院管理 -->
|
<!-- 新增房院管理 -->
|
||||||
<insert id="save" parameterType="map">
|
<insert id="save" parameterType="map">
|
||||||
INSERT INTO house_house(
|
INSERT INTO house_house(house_id,
|
||||||
house_id,
|
|
||||||
street,
|
street,
|
||||||
street_name,
|
street_name,
|
||||||
community,
|
community,
|
||||||
@ -238,9 +238,8 @@
|
|||||||
gmt_create,
|
gmt_create,
|
||||||
modifier,
|
modifier,
|
||||||
gmt_modified,
|
gmt_modified,
|
||||||
is_delete
|
is_delete)
|
||||||
) VALUES(
|
VALUES (#{houseId},
|
||||||
#{houseId},
|
|
||||||
#{street},
|
#{street},
|
||||||
#{streetName},
|
#{streetName},
|
||||||
#{community},
|
#{community},
|
||||||
@ -291,8 +290,7 @@
|
|||||||
#{gmtCreate},
|
#{gmtCreate},
|
||||||
#{modifier},
|
#{modifier},
|
||||||
#{gmtModified},
|
#{gmtModified},
|
||||||
#{isDelete}
|
#{isDelete})
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 删除房院管理 -->
|
<!-- 删除房院管理 -->
|
||||||
@ -795,7 +793,7 @@
|
|||||||
hp.population_info_id = #{populationInfoId}
|
hp.population_info_id = #{populationInfoId}
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
ORDER BY house_num ASC
|
ORDER BY (affiliation_unit + 0), (affiliation_floors + 0), (house_num + 0) ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 房院管理列表 -->
|
<!-- 房院管理列表 -->
|
||||||
@ -964,12 +962,9 @@
|
|||||||
|
|
||||||
<!-- 房院管理统计 -->
|
<!-- 房院管理统计 -->
|
||||||
<select id="count" parameterType="map" resultType="Integer">
|
<select id="count" parameterType="map" resultType="Integer">
|
||||||
SELECT
|
SELECT COUNT(*)
|
||||||
COUNT(*)
|
FROM house_house t1
|
||||||
FROM
|
WHERE t1.is_delete = 0
|
||||||
house_house t1
|
|
||||||
WHERE
|
|
||||||
t1.is_delete = 0
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 以房找人列表 -->
|
<!-- 以房找人列表 -->
|
||||||
@ -1054,4 +1049,33 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listForAll" parameterType="map" resultMap="houseDTO">
|
||||||
|
SELECT
|
||||||
|
t1.house_id,
|
||||||
|
t1.building_id,
|
||||||
|
t1.affiliation_unit,
|
||||||
|
t1.affiliation_floors,
|
||||||
|
t1.house_num,
|
||||||
|
t1.creator,
|
||||||
|
t1.gmt_create,
|
||||||
|
COUNT(t2.house_id) as count,
|
||||||
|
1
|
||||||
|
FROM
|
||||||
|
house_house t1 LEFT JOIN house_population t2 ON t1.house_id = t2.house_id
|
||||||
|
WHERE
|
||||||
|
t1.is_delete = 0
|
||||||
|
<if test="buildingId != null and buildingId != ''">
|
||||||
|
AND building_id = #{buildingId}
|
||||||
|
</if>
|
||||||
|
GROUP BY t1.house_id,
|
||||||
|
t1.building_id,
|
||||||
|
t1.affiliation_unit,
|
||||||
|
t1.affiliation_floors,
|
||||||
|
t1.house_num,
|
||||||
|
t1.creator,
|
||||||
|
t1.gmt_create
|
||||||
|
ORDER BY
|
||||||
|
(t1.affiliation_unit + 0), (t1.affiliation_floors + 0), (t1.house_num + 0) ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user