Browse Source

居民信息采集-人口信息列表

feature/syp_points
songyunpeng 5 years ago
parent
commit
0ca2306d7f
  1. 13
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java
  2. 6
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PopulationInformationController.java
  3. 20
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java
  4. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java
  5. 14
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java
  6. 52
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml

13
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PopulationInformationDTO.java

@ -21,6 +21,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -240,10 +241,20 @@ public class PopulationInformationDTO implements Serializable {
/**
* 房屋ID
*/
private String houseId;
private String houseId;
/**
* 户主编辑是否确认提交字段
*/
private String isSubmit;
//人口信息显示字段
List<HousingInformationDTO> housingInformationList;
/**
* 所属部门名字 ,隔开
*/
private String gridNames;
}

6
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PopulationInformationController.java

@ -52,14 +52,14 @@ public class PopulationInformationController {
@GetMapping("page")
public Result<PageData<PopulationInformationDTO>> page(@RequestParam Map<String, Object> params){
PageData<PopulationInformationDTO> page = populationInformationService.page(params);
PageData<PopulationInformationDTO> page = populationInformationService.listPage(params);
return new Result<PageData<PopulationInformationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PopulationInformationDTO> get(@PathVariable("id") String id){
PopulationInformationDTO data = populationInformationService.get(id);
return new Result<PopulationInformationDTO>().ok(data);
PopulationInformationDTO populationInformationDTOS = populationInformationService.get(id);
return new Result<PopulationInformationDTO>().ok(populationInformationDTOS);
}
@GetMapping("getHouseHeadInfo")
public Result<PopulationInformationDTO> getHouseHeadInfo(String id){

20
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PopulationInformationDao.java

@ -23,6 +23,9 @@ import com.elink.esua.epdc.entity.PopulationInformationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 人口信息表
*
@ -47,4 +50,21 @@ public interface PopulationInformationDao extends BaseDao<PopulationInformationE
* @return com.elink.esua.epdc.dto.PopulationInformationDTO
**/
PopulationInformationDTO getHouseHeadInfo(String houseId);
/**
* @Description 人口信息列表
* @Author songyunpeng
* @Date 2020/8/25
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.PopulationInformationDTO>
**/
List<PopulationInformationDTO> selectListOfPopulationInformationDTO(Map<String, Object> params);
/**
* @Description 人口信息详细列表
* @Author songyunpeng
* @Date 2020/8/25
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.PopulationInformationDTO>
**/
PopulationInformationDTO selectDetailOfPopulationInformationDTO(@Param("id") String id);
}

8
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PopulationInformationService.java

@ -109,4 +109,12 @@ public interface PopulationInformationService extends BaseService<PopulationInfo
* @return com.elink.esua.epdc.dto.PopulationInformationDTO
**/
PopulationInformationEntity getInfoByIdentityNo(String residentsIdentityNo);
/**
* @Description 人口信息列表
* @Author songyunpeng
* @Date 2020/8/25
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.PopulationInformationDTO>
**/
PageData<PopulationInformationDTO> listPage(Map<String, Object> params);
}

14
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java

@ -90,8 +90,7 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
@Override
public PopulationInformationDTO get(String id) {
PopulationInformationEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PopulationInformationDTO.class);
return baseDao.selectDetailOfPopulationInformationDTO(id);
}
@Override
@ -142,8 +141,8 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
@Override
@Transactional(rollbackFor = Exception.class)
public Result update(PopulationInformationDTO dto) {
PopulationInformationEntity infoByIdentityNo = getInfoByIdentityNo(dto.getResidentsIdentityNo());
if(dto.getResidentsIdentityNo().equals(infoByIdentityNo)){
PopulationInformationEntity infoByIdentityNo = selectById(dto.getId());
if(dto.getResidentsIdentityNo().equals(infoByIdentityNo.getResidentsIdentityNo())){
PopulationInformationEntity entity = ConvertUtils.sourceToTarget(dto, PopulationInformationEntity.class);
updateById(entity);
return new Result();
@ -190,4 +189,11 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
return baseDao.getInfoByIdentityNo(residentsIdentityNo);
}
@Override
public PageData<PopulationInformationDTO> listPage(Map<String, Object> params) {
IPage<PopulationInformationDTO> page = getPage(params);
List<PopulationInformationDTO> list = baseDao.selectListOfPopulationInformationDTO(params);
return new PageData<>(list, page.getTotal());
}
}

52
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PopulationInformationDao.xml

@ -86,6 +86,58 @@
left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '1' and t1.HOUSE_ID = #{houseId} limit 1
</select>
<select id="selectListOfPopulationInformationDTO"
resultType="com.elink.esua.epdc.dto.PopulationInformationDTO">
select
t.ID,t.RESIDENTS_NAME,t.RESIDENTS_SEX,t.RESIDENTS_PHONE,t.RESIDENTS_IDENTITY_NO,t.RESIDENTS_NATION,t.HOUSEHOLD_REGISTRATION_PLACE,
group_concat(substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as gridNames
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join epdc_housing_information t2 on t1.HOUSE_ID = t2.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t2.DEL_FLAG ='0' and t.RESIDENTS_IDENTITY_NO is not null
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},t2.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},t2.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},t2.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},t2.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (t2.grid_id = #{gridId}
OR find_in_set(#{gridId},t2.ALL_DEPT_IDS))
</if>
<if test="residentsName != '' and residentsName != null">and t.RESIDENTS_NAME like concat('%',#{residentsName},'%') </if>
<if test="residentsPhone != '' and residentsPhone != null">and t.RESIDENTS_PHONE like concat('%',#{residentsPhone},'%') </if>
<if test="residentsIdentityNo != '' and residentsIdentityNo != null">and t.RESIDENTS_IDENTITY_NO like concat('%',#{residentsIdentityNo},'%') </if>
group by t.ID
order by t.CREATED_TIME desc
</select>
<resultMap type="com.elink.esua.epdc.dto.PopulationInformationDTO" id="populationInformationMap2">
<result property="id" column="ID"/>
<result property="residentsName" column="RESIDENTS_NAME"/>
<result property="residentsSex" column="RESIDENTS_SEX"/>
<result property="residentsNation" column="RESIDENTS_NATION"/>
<result property="residentsIdentityNo" column="RESIDENTS_IDENTITY_NO"/>
<result property="residentsPhone" column="RESIDENTS_PHONE"/>
<result property="householdRegistrationPlace" column="HOUSEHOLD_REGISTRATION_PLACE"/>
<collection property="housingInformationList" ofType="com.elink.esua.epdc.dto.HousingInformationDTO">
<result property="houseAddress" column="HOUSE_ADDRESS"/>
<result property="propertyOwner" column="PROPERTY_OWNER"/>
<result property="propertyOwnerIdentityNo" column="PROPERTY_OWNER_IDENTITY_NO"/>
<result property="propertyOwnerMobile" column="PROPERTY_OWNER_MOBILE"/>
<result property="gridName" column="gridName"/>
</collection>
</resultMap>
<select id="selectDetailOfPopulationInformationDTO" resultMap="populationInformationMap2">
select
t.ID,t.RESIDENTS_NAME,t.RESIDENTS_SEX,t.RESIDENTS_PHONE,t.RESIDENTS_IDENTITY_NO,t.RESIDENTS_NATION,t.HOUSEHOLD_REGISTRATION_PLACE,
substring_index(t2.ALL_DEPT_NAMES,'-',-1) as gridName,t2.HOUSE_ADDRESS,t2.PROPERTY_OWNER, t2.PROPERTY_OWNER_IDENTITY_NO, t2.PROPERTY_OWNER_MOBILE
from epdc_population_information t
left join epdc_house_resident t1 on t.ID = t1.RESIDENT_ID
left join epdc_housing_information t2 on t1.HOUSE_ID = t2.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t2.DEL_FLAG ='0' and t.ID = #{id};
</select>
</mapper>
Loading…
Cancel
Save