Merge remote-tracking branch 'origin/upgrade' into upgrade

# Conflicts:
#	src/main/java/com/cm/population/dao/populationinfo/IPopulationInfoDao.java
This commit is contained in:
java_cuibaocheng@163.com 2023-11-25 13:48:15 +08:00
commit 94b4744d4c
16 changed files with 512 additions and 94 deletions

View File

@ -139,13 +139,13 @@ public class PopulationController extends AbstractController {
@GetMapping("findHouse") @GetMapping("findHouse")
public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) { public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) {
Map<String, Object> params = requestParams(); Map<String, Object> params = requestParams();
if(null == params.get("keywords")) { // if(null == params.get("keywords")) {
try { // try {
throw new SearchException("身份证号/手机号/姓名不能为空"); // throw new SearchException("身份证号/手机号/姓名不能为空");
} catch (SearchException e) { // } catch (SearchException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
page.setParams(params); page.setParams(params);
return populationService.findHouse(page); return populationService.findHouse(page);
} }

View File

@ -126,4 +126,6 @@ public interface IHouseDao {
List<PopulationDTO> findPopulation(Map<String, Object> params); List<PopulationDTO> findPopulation(Map<String, Object> params);
List<HouseDTO> listForAll(Map<String, Object> params); List<HouseDTO> listForAll(Map<String, Object> params);
List<HouseDTO> getBatch(Map<String, Object> params);
} }

View File

@ -134,4 +134,6 @@ public interface IPopulationDao {
List<PopulationDTO> listAll(Map<String, Object> params); List<PopulationDTO> listAll(Map<String, Object> params);
void updateBindTime(Map<String, Object> params); void updateBindTime(Map<String, Object> params);
List<PopulationDTO> listBatch(Map<String, Object> params);
} }

View File

@ -122,5 +122,7 @@ public interface IPopulationInfoDao {
void updateCreator(Map<String, Object> params); void updateCreator(Map<String, Object> params);
List<PopulationInfoDTO> getBatch(Map<String, Object> params);
PopulationInfoAreaDTO getCreatorArea(String creator); PopulationInfoAreaDTO getCreatorArea(String creator);
} }

View File

@ -1,6 +1,7 @@
package com.cm.population.pojo.dtos.population; package com.cm.population.pojo.dtos.population;
import com.cm.population.pojo.dtos.house.HouseDTO; import com.cm.population.pojo.dtos.house.HouseDTO;
import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO;
import com.cm.population.pojo.dtos.populationinfo.PopulationInfoDTO; import com.cm.population.pojo.dtos.populationinfo.PopulationInfoDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -44,10 +45,10 @@ public class PopulationDTO {
private Integer isDelete; private Integer isDelete;
@ApiModelProperty(name = "houseDTO", value = "房屋详情") @ApiModelProperty(name = "houseDTO", value = "房屋详情")
private HouseDTO houseDTO; private HouseDTO houseDTO;
@ApiModelProperty(name = "populationInfoHouseDTO", value = "人口详情") @ApiModelProperty(name = "populationInfoDTO", value = "人员基本信息")
private PopulationInfoHouseDTO populationInfoHouseDTO;
@ApiModelProperty(name = "populationInfoDTO", value = "人口详情")
private PopulationInfoDTO populationInfoDTO; private PopulationInfoDTO populationInfoDTO;
@ApiModelProperty(name = "populationInfoBaseDTO", value = "人员基本信息")
private PopulationInfoBaseDTO populationInfoBaseDTO;
public String getPopulationId() { public String getPopulationId() {
return populationId == null ? "" : populationId.trim(); return populationId == null ? "" : populationId.trim();
@ -161,14 +162,6 @@ public class PopulationDTO {
this.houseDTO = houseDTO; this.houseDTO = houseDTO;
} }
public PopulationInfoHouseDTO getPopulationInfoHouseDTO() {
return populationInfoHouseDTO;
}
public void setPopulationInfoHouseDTO(PopulationInfoHouseDTO populationInfoHouseDTO) {
this.populationInfoHouseDTO = populationInfoHouseDTO;
}
public PopulationInfoDTO getPopulationInfoDTO() { public PopulationInfoDTO getPopulationInfoDTO() {
return populationInfoDTO; return populationInfoDTO;
} }
@ -176,4 +169,12 @@ public class PopulationDTO {
public void setPopulationInfoDTO(PopulationInfoDTO populationInfoDTO) { public void setPopulationInfoDTO(PopulationInfoDTO populationInfoDTO) {
this.populationInfoDTO = populationInfoDTO; this.populationInfoDTO = populationInfoDTO;
} }
public PopulationInfoBaseDTO getPopulationInfoBaseDTO() {
return populationInfoBaseDTO;
}
public void setPopulationInfoBaseDTO(PopulationInfoBaseDTO populationInfoBaseDTO) {
this.populationInfoBaseDTO = populationInfoBaseDTO;
}
} }

View File

@ -105,7 +105,7 @@ public class PopulationInfoBaseDTO {
} }
public String getHealthStatus() { public String getHealthStatus() {
return healthStatus; return healthStatus == null ? "" : healthStatus;
} }
public void setHealthStatus(String healthStatus) { public void setHealthStatus(String healthStatus) {
@ -135,6 +135,9 @@ public class PopulationInfoBaseDTO {
} }
public Integer getAge() { public Integer getAge() {
if (StringUtils.isBlank(this.getBirthday())) {
return 0;
}
LocalDate birthDate = LocalDate.parse(this.birthday); LocalDate birthDate = LocalDate.parse(this.birthday);
Period period = Period.between(birthDate, LocalDate.now()); Period period = Period.between(birthDate, LocalDate.now());
return period.getYears(); return period.getYears();

View File

@ -232,4 +232,6 @@ public interface IHouseService {
* @param autoHouseDTO * @param autoHouseDTO
*/ */
void saveAuto(String token, AutoHouseDTO autoHouseDTO); void saveAuto(String token, AutoHouseDTO autoHouseDTO);
List<HouseDTO> getBatch(List<String> houseIds);
} }

View File

@ -19,7 +19,6 @@ import com.cm.population.pojo.dtos.residential.ResidentialDTO;
import com.cm.population.pojo.pos.house.HousePO; import com.cm.population.pojo.pos.house.HousePO;
import com.cm.population.pojo.vos.building.BuildingBatchVO; import com.cm.population.pojo.vos.building.BuildingBatchVO;
import com.cm.population.pojo.vos.house.HouseVO; import com.cm.population.pojo.vos.house.HouseVO;
import com.cm.population.pojo.vos.population.PopulationVO;
import com.cm.population.service.building.IBuildingService; import com.cm.population.service.building.IBuildingService;
import com.cm.population.service.house.IHouseService; import com.cm.population.service.house.IHouseService;
import com.cm.population.service.population.IPopulationService; import com.cm.population.service.population.IPopulationService;
@ -29,19 +28,12 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
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
@ -603,4 +595,11 @@ public class HouseServiceImpl extends AbstractService implements IHouseService {
} }
} }
@Override
public List<HouseDTO> getBatch(List<String> houseIds) {
Map<String, Object> params = getHashMap(2);
params.put("houseIds", houseIds);
return houseDao.getBatch(params);
}
} }

View File

@ -10,7 +10,6 @@ import com.cm.population.dao.house.IHouseDao;
import com.cm.population.dao.population.IPopulationDao; import com.cm.population.dao.population.IPopulationDao;
import com.cm.population.pojo.bos.population.PopulationBO; import com.cm.population.pojo.bos.population.PopulationBO;
import com.cm.population.pojo.dtos.house.HouseDTO; import com.cm.population.pojo.dtos.house.HouseDTO;
import com.cm.population.pojo.dtos.population.HouseUserDTO;
import com.cm.population.pojo.dtos.population.PopulationDTO; import com.cm.population.pojo.dtos.population.PopulationDTO;
import com.cm.population.pojo.dtos.population.PopulationInfoHouseDTO; import com.cm.population.pojo.dtos.population.PopulationInfoHouseDTO;
import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO; import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO;
@ -20,7 +19,6 @@ import com.cm.population.pojo.vos.population.PopulationVO;
import com.cm.population.service.house.IHouseService; import com.cm.population.service.house.IHouseService;
import com.cm.population.service.population.IPopulationService; import com.cm.population.service.population.IPopulationService;
import com.cm.population.service.populationinfo.IPopulationInfoService; import com.cm.population.service.populationinfo.IPopulationInfoService;
import com.cm.population.service.populationinfo.impl.PopulationInfoServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -28,10 +26,11 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import sun.security.krb5.internal.PAData;
import javax.mail.search.SearchException; import javax.mail.search.SearchException;
import java.util.*; import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
/** /**
* @ClassName: PopulationServiceImpl * @ClassName: PopulationServiceImpl
@ -312,7 +311,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
return false; return false;
} }
@Override /*@Override
public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) { public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
List<PopulationDTO> populationDTOList = list(page.getParams()); List<PopulationDTO> populationDTOList = list(page.getParams());
@ -345,6 +344,106 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
} }
PageInfo<PopulationDTO> pageInfo = new PageInfo<>(populationDTOList); PageInfo<PopulationDTO> pageInfo = new PageInfo<>(populationDTOList);
return new SuccessResultList<>(populationDTOList, pageInfo.getPageNum(), pageInfo.getTotal()); return new SuccessResultList<>(populationDTOList, pageInfo.getPageNum(), pageInfo.getTotal());
}*/
@Override
public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
// List<PopulationDTO> populationDTOList = list(page.getParams());
List<PopulationDTO> populationDTOList = listBatch(page.getParams());
List<String> populationInfoIds = new ArrayList<>();
List<String> houseIds = new ArrayList<>();
for (PopulationDTO populationDTO : populationDTOList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
populationInfoIds.add(populationDTO.getPopulationInfoId());
}
if (StringUtils.isNotEmpty(populationDTO.getHouseId())) {
houseIds.add(populationDTO.getHouseId());
}
}
// 一次性获取所有的人口信息
List<PopulationInfoDTO> populationInfoDTOs = populationInfoService.getBatch(populationInfoIds);
// 一次性获取所有的房屋信息
List<HouseDTO> houseDTOs = houseService.getBatch(houseIds);
Map<String, PopulationInfoDTO> populationInfoMap = null;
Map<String, HouseDTO> houseMap = null;
if (!CollectionUtils.isEmpty(populationInfoDTOs)) {
populationInfoMap = populationInfoDTOs.stream()
.collect(Collectors.toMap(PopulationInfoDTO::getPopulationInfoId,
populationInfoDTO -> populationInfoDTO));
}
if (!CollectionUtils.isEmpty(houseDTOs)) {
houseMap = houseDTOs.stream()
.collect(Collectors.toMap(HouseDTO::getHouseId,
houseDTO -> houseDTO));
}
for (PopulationDTO populationDTO : populationDTOList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
PopulationInfoDTO populationInfoDTO;
if (null != populationInfoMap) {
populationInfoDTO = populationInfoMap
.get(populationDTO.getPopulationInfoId());
if (null != populationInfoDTO) {
populationInfoService.getTuoMin(populationInfoDTO);
}
} else {
populationInfoDTO = setPopulationInfo(populationDTO);
}
populationDTO.setPopulationInfoDTO(populationInfoDTO);
} else {
PopulationInfoDTO populationInfoDTO = setPopulationInfo(populationDTO);
populationDTO.setPopulationInfoDTO(populationInfoDTO);
}
if (null != houseMap) {
HouseDTO houseDTO = houseMap.get(populationDTO.getHouseId());
if (null != houseDTO) {
if (1 == houseDTO.getIsRental()) {
houseDTO.setHouseType("出租房");
}
if (1 == houseDTO.getIsVacant()) {
houseDTO.setHouseType("空置房");
}
if (0 == houseDTO.getIsRental() && 0 == houseDTO.getIsVacant()) {
houseDTO.setHouseType("自住房");
}
populationDTO.setHouseDTO(houseDTO);
}
}
}
PageInfo<PopulationDTO> pageInfo = new PageInfo<>(populationDTOList);
return new SuccessResultList<>(populationDTOList, pageInfo.getPageNum(), pageInfo.getTotal());
}
private PopulationInfoDTO setPopulationInfo(PopulationDTO populationDTO) {
PopulationInfoDTO populationInfoDTO = new PopulationInfoDTO();
populationInfoDTO.setIdcard(populationDTO.getCardNum());
populationInfoDTO.setName(populationDTO.getName());
populationInfoDTO.setPhone(populationDTO.getPhone());
populationInfoDTO.setIdcardType("身份证");
populationInfoService.getTuoMin(populationInfoDTO);
return populationInfoDTO;
}
private PopulationInfoBaseDTO setPopulationBaseInfo(PopulationDTO populationDTO) {
PopulationInfoBaseDTO populationInfoDTO = new PopulationInfoBaseDTO();
populationInfoDTO.setIdcard(populationDTO.getCardNum());
populationInfoDTO.setName(populationDTO.getName());
populationInfoDTO.setPhone(populationDTO.getPhone());
populationInfoDTO.setIdcardType("身份证");
populationInfoService.getTuoMin(populationInfoDTO);
return populationInfoDTO;
}
private List<PopulationDTO> listBatch(Map<String, Object> params) {
List<PopulationDTO> list = populationDao.listBatch(params);
return list;
} }
@Override @Override
@ -352,8 +451,93 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
PageHelper.startPage(page.getPage(), page.getRows()); PageHelper.startPage(page.getPage(), page.getRows());
List<PopulationDTO> overList = houseDao.findPopulation(page.getParams()); List<PopulationDTO> overList = houseDao.findPopulation(page.getParams());
// 获取人口详情 List<String> populationInfoIds = new ArrayList<>();
List<String> houseIds = new ArrayList<>();
for (PopulationDTO populationDTO : overList) { for (PopulationDTO populationDTO : overList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
populationInfoIds.add(populationDTO.getPopulationInfoId());
}
if (StringUtils.isNotEmpty(populationDTO.getHouseId())) {
houseIds.add(populationDTO.getHouseId());
}
}
// 一次性获取所有的人口信息
List<PopulationInfoDTO> populationInfoDTOs = populationInfoService.getBatch(populationInfoIds);
// 一次性获取所有的房屋信息
List<HouseDTO> houseDTOs = houseService.getBatch(houseIds);
// 获取base
List<PopulationInfoBaseDTO> populationInfoBaseDTOs = new ArrayList<>();
int size = populationInfoIds.size();
int numThreads = size / 2 + (size % 2 == 0 ? 0 : 1); // 计算需要的线程数
ExecutorService executorService = Executors.newFixedThreadPool(numThreads);
Callable<List<PopulationInfoBaseDTO>> task = () -> {
List<PopulationInfoBaseDTO> output = new ArrayList<>();
for (String str : populationInfoIds) {
PopulationInfoBaseDTO base = populationInfoService.getBase(str);
output.add(base);
}
return output;
};
Future<List<PopulationInfoBaseDTO>> futureResult = executorService.submit(task);
try {
List<PopulationInfoBaseDTO> result = futureResult.get();
populationInfoBaseDTOs.addAll(result);
executorService.shutdown();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
Map<String, PopulationInfoDTO> populationInfoMap = null;
Map<String, HouseDTO> houseMap = null;
Map<String, PopulationInfoBaseDTO> baseMap = null;
if (!CollectionUtils.isEmpty(populationInfoDTOs)) {
populationInfoMap = populationInfoDTOs.stream()
.collect(Collectors.toMap(PopulationInfoDTO::getPopulationInfoId,
populationInfoDTO -> populationInfoDTO));
}
if (!CollectionUtils.isEmpty(houseDTOs)) {
houseMap = houseDTOs.stream()
.collect(Collectors.toMap(HouseDTO::getHouseId,
houseDTO -> houseDTO));
}
if (!CollectionUtils.isEmpty(populationInfoBaseDTOs)) {
baseMap = populationInfoBaseDTOs.stream()
.collect(Collectors.toMap(PopulationInfoBaseDTO::getPopulationInfoId,
baseDTO -> baseDTO));
}
for (PopulationDTO populationDTO : overList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
PopulationInfoBaseDTO populationInfoBaseDTO = null;
if (null != baseMap) {
// 获取人员
populationInfoBaseDTO = baseMap.get(populationDTO.getPopulationInfoId());
} else {
populationInfoBaseDTO = setPopulationBaseInfo(populationDTO);
}
// populationInfoService.getTuoMin(populationInfoBaseDTO);
populationDTO.setPopulationInfoBaseDTO(populationInfoBaseDTO);
} else {
PopulationInfoBaseDTO populationInfoBaseDTO = setPopulationBaseInfo(populationDTO);
populationDTO.setPopulationInfoBaseDTO(populationInfoBaseDTO);
}
if (null != houseMap) {
HouseDTO houseDTO = houseMap.get(populationDTO.getHouseId());
populationDTO.setHouseDTO(houseDTO);
}
}
// 获取人口详情
/*for (PopulationDTO populationDTO : overList) {
if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) { if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) {
PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId());
PopulationInfoHouseDTO populationInfoHouseDTO = new PopulationInfoHouseDTO(); PopulationInfoHouseDTO populationInfoHouseDTO = new PopulationInfoHouseDTO();
@ -372,7 +556,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
if (null != houseDTO) { if (null != houseDTO) {
populationDTO.setHouseDTO(houseDTO); populationDTO.setHouseDTO(houseDTO);
} }
} }*/
PageInfo<PopulationDTO> pageInfo = new PageInfo<>(overList); PageInfo<PopulationDTO> pageInfo = new PageInfo<>(overList);
return new SuccessResultList<>(overList, pageInfo.getPageNum(), pageInfo.getTotal()); return new SuccessResultList<>(overList, pageInfo.getPageNum(), pageInfo.getTotal());
@ -398,4 +582,22 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio
return new SuccessResultList<>(populationDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); return new SuccessResultList<>(populationDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
} }
public class getBase implements Runnable {
private List<String> dataList;
private List<PopulationInfoBaseDTO> baseDTOList;
public getBase(List<String> dataList, List<PopulationInfoBaseDTO> baseDTOList) {
this.dataList = dataList;
this.baseDTOList = baseDTOList;
}
@Override
public void run() {
for (String s : dataList) {
PopulationInfoBaseDTO base = populationInfoService.getBase(s);
baseDTOList.add(base);
}
}
}
} }

View File

@ -219,4 +219,5 @@ public interface IPopulationInfoService {
void updateCreator(String populationInfoId, String creator); void updateCreator(String populationInfoId, String creator);
List<PopulationInfoDTO> getBatch(List<String> populationInfoIds);
} }

View File

@ -594,4 +594,11 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul
populationInfoDao.updateCreator(params); populationInfoDao.updateCreator(params);
} }
@Override
public List<PopulationInfoDTO> getBatch(List<String> populationInfoIds) {
Map<String, Object> params = getHashMap(2);
params.put("populationInfoIds", populationInfoIds);
return populationInfoDao.getBatch(params);
}
} }

View File

@ -31,6 +31,7 @@ public class AreaUtils {
@PostConstruct @PostConstruct
public void init() { public void init() {
new Thread(() -> {
PopulationInfoStaticService = PopulationInfoService; PopulationInfoStaticService = PopulationInfoService;
initArea0(); initArea0();
initArea1(); initArea1();
@ -42,6 +43,7 @@ public class AreaUtils {
aree.put(2, area2); aree.put(2, area2);
aree.put(3, area3); aree.put(3, area3);
aree.put(4, area4); aree.put(4, area4);
}).start();
} }
public List<AreaZtreeDTO> getList(String id) { public List<AreaZtreeDTO> getList(String id) {

View File

@ -1027,19 +1027,6 @@
<if test="isVacant != null"> <if test="isVacant != null">
AND is_vacant = #{isVacant} AND is_vacant = #{isVacant}
</if> </if>
<if test="keywords != null and keywords != ''">
AND (
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="houseIds != null and houseIds.size > 0"> <if test="houseIds != null and houseIds.size > 0">
AND AND
t1.house_id IN t1.house_id IN
@ -1078,4 +1065,68 @@
(t1.affiliation_unit + 0), (t1.affiliation_floors + 0), (t1.house_num + 0) ASC (t1.affiliation_unit + 0), (t1.affiliation_floors + 0), (t1.house_num + 0) ASC
</select> </select>
<!-- 房院管理详情 -->
<select id="getBatch" parameterType="map" resultMap="houseDTO">
SELECT
t1.street,
t1.street_name,
t1.community,
t1.community_name,
t1.residential_id,
t1.residential_name,
t1.building_id,
t1.building_name,
t1.affiliation_unit,
t1.affiliation_floors,
t1.house_num,
t1.category_id,
t1.category_name,
t1.nature_id,
t1.nature_name,
t1.type_id,
t1.type_name,
t1.structure_id,
t1.structure_name,
t1.building_purpose_id,
t1.building_purpose_name,
t1.room_num,
t1.room_area,
t1.room_use_id,
t1.room_use_name,
t1.danger_id,
t1.danger_name,
t1.certificate_num,
t1.registration_date,
t1.affiliated_unit,
t1.is_rental,
t1.is_vacant,
t1.lodge_type_id,
t1.lodge_type_name,
t1.rental_purposes,
t1.homeowner,
t1.document_id,
t1.document_name,
t1.document_num,
t1.phone,
t1.custodian,
t1.custodian_document_id,
t1.custodian_document_name,
t1.custodian_document_num,
t1.custodian_phone,
t1.relationship_homeowner,
t1.house_id,
t1.creator
FROM
house_house t1
WHERE
t1.is_delete = 0
<if test="houseIds != null and houseIds.size > 0">
AND
house_id IN
<foreach collection="houseIds" index="index" open="(" separator="," close=")">
#{houseIds[${index}]}
</foreach>
</if>
</select>
</mapper> </mapper>

View File

@ -444,4 +444,50 @@
</if> </if>
</select> </select>
<select id="listBatch" parameterType="map" resultMap="populationDTO">
SELECT
t1.population_id,
t1.house_id,
t1.population_info_id,
t1.name,
t1.card_num,
t1.phone,
t1.bind_time,
t1.out_house,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
house_population t1
LEFT JOIN house_house t2 ON t1.house_id = t2.house_id
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
AND (t1.out_house = 0
OR t1.out_house IS NULL)
<if test="keywords != null and keywords != ''">
AND (
t1.card_num LIKE CONCAT('%', #{keywords}, '%')
OR t1.phone LIKE CONCAT('%', #{keywords}, '%')
OR t1.name LIKE CONCAT('%', #{keywords}, '%')
OR t1.house_id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="houseId != null and houseId != ''">
AND t1.house_id = #{houseId}
</if>
<if test="outHouse != null and outHouse != ''">
AND t1.out_house = #{outHouse}
</if>
<if test="populationIds != null and populationIds.size > 0">
AND
t1.population_id IN
<foreach collection="populationIds" index="index" open="(" separator="," close=")">
#{populationIds[${index}]}
</foreach>
</if>
</select>
</mapper> </mapper>

View File

@ -1343,4 +1343,98 @@
1 = 1 1 = 1
</select> </select>
<!-- 批量获取基础人口信息详情——renpc -->
<select id="getBatch" parameterType="map" resultMap="populationInfoDTO">
SELECT
t1.population_info_id,
t1.name,
t1.label,
t1.idcard,
t1.idcard_type,
t1.birthday,
t1.sex,
t1.nation,
t1.education,
t1.description,
t1.organization,
t1.religion,
t1.marriage_status,
t1.marriage_change_time,
t1.marriage_first_time,
t1.social_security,
t1.health_status,
t1.department_type,
t1.department,
t1.pastion,
t1.pastion_title,
t1.expertise,
t1.phone,
t1.father_id,
t1.father_name,
t1.father_idcard,
t1.father_phone,
t1.mother_id,
t1.mother_name,
t1.mother_idcard,
t1.mother_phone,
t1.relationship,
t1.domicile_address,
t1.domicile_address_type,
t1.domicile_area_code,
t1.domicile_area_name,
t1.origin_address,
t1.origin_area_code,
t1.origin_area_name,
t1.flow_time,
t1.flow_reason,
t1.flow_reasontext,
t1.is_oldage,
t1.oldage_type,
t1.oldage_department,
t1.oldage_lift,
t1.oldage_health_status,
t1.oldage_selfcare,
t1.oldage_live,
t1.is_disability,
t1.disability_type,
t1.disability_level,
t1.disability_number,
t1.disability_carnumber,
t1.disability_address,
t1.disability_area_code,
t1.disability_area_name,
t1.disability_income,
t1.disability_house,
t1.disability_time,
t1.disability_guardian,
t1.disability_guardian_phone,
t1.disability_guardian_relation,
t1.is_military,
t1.military_time,
t1.military_position,
t1.is_succour,
t1.succour_dibao,
t1.succour_help,
t1.succour_difficulty,
t1.succour_subsidy,
t1.is_party,
t1.party_organization,
t1.party_time,
t1.othertext,
t1.population_info_id,
t1.creator
FROM
population_population_info t1
WHERE
t1.is_delete = 0
<if test="populationInfoIds != null and populationInfoIds.size > 0">
AND
t1.population_info_id IN
<foreach collection="populationInfoIds" index="index" open="(" separator="," close=")">
#{populationInfoIds[${index}]}
</foreach>
</if>
</select>
</mapper> </mapper>

View File

@ -407,12 +407,16 @@
var renderMain = function() { var renderMain = function() {
var main = ''; var main = '';
$.each(data.floors, function(index, item) { $.each(data.floors, function(index, item) {
var units = '';
$.each(item.units, function(jndex, jtem) { $.each(item.units, function(jndex, jtem) {
var houses = '';
if(jtem.houses.length > data.units[jndex].maxHouseCount) { if(jtem.houses.length > data.units[jndex].maxHouseCount) {
data.units[jndex].maxHouseCount = jtem.houses.length; data.units[jndex].maxHouseCount = jtem.houses.length;
} }
});
});
$.each(data.floors, function(index, item) {
var units = '';
$.each(item.units, function(jndex, jtem) {
var houses = '';
$.each(jtem.houses, function(kndex, ktem) { $.each(jtem.houses, function(kndex, ktem) {
var option = ktem.isCreator === 1 ? ` var option = ktem.isCreator === 1 ? `
<div class="option"> <div class="option">