Merge remote-tracking branch 'origin/test' into test
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building; |
| | | |
| | | public class BuildingDto { |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 添加楼栋户室请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("添加楼栋户室请求参数") |
| | | public class AddBuildingHouseDto { |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("楼层数") |
| | | private Integer floorNum; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表请求参数") |
| | | public class AddBuildingUnitDto { |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unitNo; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 删除楼栋户室人员关系请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("删除楼栋户室人员关系请求参数") |
| | | public class DeleteBuildingHousePopulationDto { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | private Long houseId; |
| | | |
| | | @ApiModelProperty("人员类型(1.业主 2.居住人)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("人员id") |
| | | private Long populationId; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 人员类型(1.业主 2.居住人) |
| | | */ |
| | | public interface type{ |
| | | int yz = 1; |
| | | int jzr = 2; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 修改楼栋户室请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("修改楼栋户室请求参数") |
| | | public class EditBuildingHouseDto { |
| | | |
| | | @ApiModelProperty("房屋id") |
| | | private Long houseId; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("楼层数") |
| | | private Integer floorNum; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表请求参数") |
| | | public class EditBuildingUnitDto { |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("原单元号") |
| | | private String oldUnitNo; |
| | | |
| | | @ApiModelProperty("新单元号") |
| | | private String newUnitNo; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表请求参数") |
| | | public class PageBuildingListDto { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | private Long villageId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋单元下房屋列表请求参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋单元下房屋列表请求参数") |
| | | public class PageBuildingUnitHouseListDto { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty("楼栋id") |
| | | private Long id; |
| | | |
| | | private Long villageId; |
| | | |
| | | private String floor; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BuildingVO { |
| | | private String label; |
| | | private String value; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 楼栋详情返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("楼栋详情返回参数") |
| | | public class BuildingDetailAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋主键") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty("街路巷号") |
| | | private String doorNum; |
| | | |
| | | @ApiModelProperty("楼栋号") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("小区名称") |
| | | private String villageName; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("房屋总户数") |
| | | private Integer houseNum; |
| | | |
| | | @ApiModelProperty("自住房屋数量") |
| | | private Integer liveTotal; |
| | | |
| | | @ApiModelProperty("出租房屋数量") |
| | | private Integer leaseTotal; |
| | | |
| | | @ApiModelProperty("空置房屋数量") |
| | | private Integer vacantNum; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 楼栋列表表头统计返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("楼栋列表表头统计返回参数") |
| | | public class BuildingListHeaderStatisticsAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋数") |
| | | private Integer buildNum; |
| | | |
| | | @ApiModelProperty("总户数") |
| | | private Integer houseNum; |
| | | |
| | | @ApiModelProperty("居民人数") |
| | | private Integer populationNum; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 楼栋单元下房屋列表返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("楼栋单元下房屋列表返回参数") |
| | | public class BuildingUnitHouseListAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋单元下房屋列表") |
| | | private List<ComMngVillageBuildingHouseVO> houseList; |
| | | |
| | | @ApiModelProperty("房屋总户数") |
| | | private Integer houseNum = 0; |
| | | |
| | | @ApiModelProperty("自住房屋数量") |
| | | private Integer liveTotal = 0; |
| | | |
| | | @ApiModelProperty("出租房屋数量") |
| | | private Integer leaseTotal = 0; |
| | | |
| | | @ApiModelProperty("空置房屋数量") |
| | | private Integer vacantNum = 0; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.building.admin; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * 分页查询楼栋列表返回参数 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("分页查询楼栋列表返回参数") |
| | | public class PageBuildingListAdminVo { |
| | | |
| | | @ApiModelProperty("楼栋主键") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty("楼栋号") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("小区名称") |
| | | private String villageName; |
| | | |
| | | @ApiModelProperty("小区id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long villageId; |
| | | |
| | | @ApiModelProperty("单元数") |
| | | private Integer unitTotal; |
| | | |
| | | @ApiModelProperty("楼层数") |
| | | private Integer buildFloorSum; |
| | | |
| | | @ApiModelProperty("总户数") |
| | | private Integer houseNum; |
| | | |
| | | @ApiModelProperty("居民人数") |
| | | private Integer populationNum; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | private String doorNum; |
| | | } |
| | |
| | | @ApiModelProperty("户室号") |
| | | private String houseNo; |
| | | |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.其他)") |
| | | @ApiModelProperty("房屋状态(1.自住 2.租住 3.空置 4.其他)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("在住居民数") |
| | |
| | | @ApiModelProperty(value = "纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty(value = "政治面貌文字描述") |
| | | private String outlook; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lyq |
| | | * @date 2021/6/16 14:45 |
| | | */ |
| | | @Data |
| | | @ApiModel("网格员运动轨迹返回参数") |
| | | public class GridMemberTrajectoryVo { |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("网格员名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("网格员运动轨迹经纬度列表") |
| | | private List<String> lngLatList; |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.community.GetIdentityEidTokenDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.dtos.community.cluster.PageClusterMemberDto; |
| | | import com.panzhihua.common.model.dtos.community.cluster.admin.*; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | |
| | | */ |
| | | @GetMapping("/common/data/population/house/user/detail") |
| | | public R detailHousesUser(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | @PostMapping("/building/page/admin/") |
| | | R pageBuildingAdmin(@RequestBody PageBuildingListDto pageBuildingListDto); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | @GetMapping("/building/header/statistics/") |
| | | R buildingListHeaderStatisticsAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | @GetMapping("/building/detail/admin/") |
| | | R detailBuildAdmin(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | @GetMapping("/building/unit/list/admin") |
| | | R buildingUnitListAdmin(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | @PostMapping("/building/unit/house/list/admin") |
| | | R buildingUnitHouseListAdmin(@RequestBody PageBuildingUnitHouseListDto unitHouseListDto); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋详情 |
| | | * @param houseId 房屋id |
| | | * @param communityId 社区id |
| | | * @return 房屋详情 |
| | | */ |
| | | @GetMapping("/building/unit/house/detail/admin") |
| | | R unitHouseDetailAdmin(@RequestParam("houseId") Long houseId,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询社区下小区列表 |
| | | * @param communityId 社区id |
| | | * @return 小区列表 |
| | | */ |
| | | @GetMapping("/building/village/list/admin") |
| | | R buildingVillageListAdmin(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 添加楼栋下单元 |
| | | * @param addBuildingUnitDto 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/building/unit/add/admin") |
| | | R addBuildingUnitAdmin(@RequestBody AddBuildingUnitDto addBuildingUnitDto); |
| | | |
| | | /** |
| | | * 修改楼栋下单元 |
| | | * @param editBuildingUnitDto 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/building/unit/edit/admin") |
| | | R editBuildingUnitAdmin(@RequestBody EditBuildingUnitDto editBuildingUnitDto); |
| | | |
| | | /** |
| | | * 添加户室 |
| | | * @param addBuildingHouseDto 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/building/house/add/admin") |
| | | R addBuildingHouseAdmin(@RequestBody AddBuildingHouseDto addBuildingHouseDto); |
| | | |
| | | /** |
| | | * 修改户室 |
| | | * @param editBuildingHouseDto 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/building/house/edit/admin") |
| | | R editBuildingHouseAdmin(@RequestBody EditBuildingHouseDto editBuildingHouseDto); |
| | | |
| | | /** |
| | | * 删除户室下人员关联信息 |
| | | * @param housePopulationDto 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/building/house/population/delete/admin") |
| | | R deleteBuildingHousePopulationAdmin(@RequestBody DeleteBuildingHousePopulationDto housePopulationDto); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/eventvisitingtasks/timedTaskVisitingJobHandler") |
| | | R timedTaskVisitingJobHandler(); |
| | | |
| | | /** |
| | | * 查询社区网格员运动轨迹 |
| | | * @param communityId 社区id |
| | | * @return 社区网格员运动轨迹 |
| | | */ |
| | | @GetMapping("/screen/member/trajectory") |
| | | R getGridsMemberTrajectory(@RequestParam("communityId") Long communityId); |
| | | } |
| | |
| | | return R.ok(result.getString("data")); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取社区网格员移动轨迹接口@lyq", response = EventGridMemberVO.class) |
| | | @GetMapping("/grids/member/trajectory") |
| | | public R getGridsMemberTrajectory() { |
| | | Long communityId = this.getCommunityId(); |
| | | if (communityId == null) { |
| | | return R.fail(401, "请先登录"); |
| | | } |
| | | return gridService.getGridsMemberTrajectory(communityId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import java.io.InputStream; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingDetailAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingUnitHouseListAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | |
| | | * @date 2021/6/10 12:34 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"社区管理"}) |
| | | @Api(tags = {"楼栋管理"}) |
| | | @RestController |
| | | @RequestMapping("/building") |
| | | public class BuildingApi extends BaseController { |
| | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "excel导入楼栋信息") |
| | | @ApiOperation(value = "excel导入楼栋信息--注:以前的接口,不需要对接") |
| | | @PostMapping(value = "/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | // String fileName = file.getOriginalFilename(); |
| | | // log.info("传入文件名字【{}】", fileName); |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file) { |
| | | InputStream inputStream; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询楼栋列表", response = PageBuildingListAdminVo.class) |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody PageBuildingListDto pageBuildingListDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | pageBuildingListDto.setCommunityId(communityId); |
| | | return communityService.pageBuildingAdmin(pageBuildingListDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "楼栋列表表头统计", response = BuildingListHeaderStatisticsAdminVo.class) |
| | | @GetMapping("/header/statistics") |
| | | public R headerStatistics() { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.buildingListHeaderStatisticsAdmin(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "楼栋详情", response = BuildingDetailAdminVo.class) |
| | | @GetMapping("/detail") |
| | | public R detail(@RequestParam("id") Long id) { |
| | | return communityService.detailBuildAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询楼栋下单元列表", response = ComMngVillageBuildingVO.class) |
| | | @GetMapping("/unit/list") |
| | | public R unitList(@RequestParam("id") Long id) { |
| | | return communityService.buildingUnitListAdmin(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询单元下房屋列表", response = BuildingUnitHouseListAdminVo.class) |
| | | @PostMapping("/unit/house/list") |
| | | public R unitHouseList(@RequestBody PageBuildingUnitHouseListDto unitHouseListDto) { |
| | | return communityService.buildingUnitHouseListAdmin(unitHouseListDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询房屋详情", response = ComMngVillageBuildingHouseDetailVO.class) |
| | | @GetMapping("/unit/house/detail") |
| | | public R unitHouseDetail(@RequestParam("houseId") Long houseId) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.unitHouseDetailAdmin(houseId,communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询小区列表", response = ComMngVillageVO.class) |
| | | @GetMapping("/village/list") |
| | | public R villageList() { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | return communityService.buildingVillageListAdmin(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加单元") |
| | | @PostMapping("/add/unit") |
| | | public R addUnit(@RequestBody AddBuildingUnitDto addBuildingUnitDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | addBuildingUnitDto.setCommunityId(communityId); |
| | | |
| | | if(addBuildingUnitDto.getId() == null || addBuildingUnitDto.getUnitNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.addBuildingUnitAdmin(addBuildingUnitDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改单元") |
| | | @PostMapping("/edit/unit") |
| | | public R editUnit(@RequestBody EditBuildingUnitDto editBuildingUnitDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | editBuildingUnitDto.setCommunityId(communityId); |
| | | |
| | | if(editBuildingUnitDto.getId() == null || editBuildingUnitDto.getOldUnitNo() == null || editBuildingUnitDto.getNewUnitNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.editBuildingUnitAdmin(editBuildingUnitDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加户室") |
| | | @PostMapping("/add/house") |
| | | public R addHouse(@RequestBody AddBuildingHouseDto addBuildingHouseDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | addBuildingHouseDto.setCommunityId(communityId); |
| | | |
| | | if(addBuildingHouseDto.getId() == null || addBuildingHouseDto.getHouseNo() == null || addBuildingHouseDto.getUnitNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.addBuildingHouseAdmin(addBuildingHouseDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改户室") |
| | | @PostMapping("/edit/house") |
| | | public R editHouse(@RequestBody EditBuildingHouseDto editBuildingHouseDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | editBuildingHouseDto.setCommunityId(communityId); |
| | | |
| | | if(editBuildingHouseDto.getHouseId() == null || editBuildingHouseDto.getHouseNo() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.editBuildingHouseAdmin(editBuildingHouseDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除户室下人员") |
| | | @PostMapping("/delete/population") |
| | | public R deletePopulation(@RequestBody DeleteBuildingHousePopulationDto housePopulationDto) { |
| | | // 获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | housePopulationDto.setCommunityId(communityId); |
| | | |
| | | if(housePopulationDto.getHouseId() == null || housePopulationDto.getPopulationId() == null || housePopulationDto.getType() == null){ |
| | | return R.fail("参数有误"); |
| | | } |
| | | return communityService.deleteBuildingHousePopulationAdmin(housePopulationDto); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/building") |
| | | @RequestMapping("/building/") |
| | | public class BuildingApi { |
| | | |
| | | @Resource |
| | |
| | | @PostMapping("/batchSave") |
| | | R listSaveBuildingExcelVO(@RequestBody List<ComMngBuildingExcelVO> newVoList, |
| | | @RequestParam("communityId") Long communityId) { |
| | | |
| | | return comActBuildingService.batchSaveBuilding(newVoList, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | @PostMapping("/page/admin") |
| | | public R pageBuildingAdmin(@RequestBody PageBuildingListDto pageBuildingListDto) { |
| | | return comActBuildingService.pageBuildingAdmin(pageBuildingListDto); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | @GetMapping("/header/statistics/") |
| | | public R buildingListHeaderStatisticsAdmin(@RequestParam("communityId") Long communityId) { |
| | | return comActBuildingService.buildingListHeaderStatisticsAdmin(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | @GetMapping("/detail/admin") |
| | | public R detailBuildAdmin(@RequestParam("id") Long id) { |
| | | return comActBuildingService.detailBuildAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | @GetMapping("/unit/list/admin") |
| | | public R buildingUnitListAdmin(@RequestParam("id") Long id) { |
| | | return comActBuildingService.buildingUnitListAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | @PostMapping("/unit/house/list/admin") |
| | | public R buildingUnitHouseListAdmin(@RequestBody PageBuildingUnitHouseListDto unitHouseListDto) { |
| | | return comActBuildingService.buildingUnitHouseListAdmin(unitHouseListDto); |
| | | } |
| | | |
| | | @GetMapping("/unit/house/detail/admin") |
| | | public R buildingUnitHouseDetailAdmin(@RequestParam("houseId") Long houseId,@RequestParam("communityId") Long communityId) { |
| | | return comActBuildingService.buildingUnitHouseDetailAdmin(houseId,communityId); |
| | | } |
| | | |
| | | @GetMapping("/village/list/admin") |
| | | public R buildingVillageListAdmin(@RequestParam("communityId") Long communityId) { |
| | | return comActBuildingService.buildingVillageListAdmin(communityId); |
| | | } |
| | | |
| | | @PostMapping("/unit/add/admin") |
| | | public R addBuildingUnitAdmin(@RequestBody AddBuildingUnitDto addBuildingUnitDto) { |
| | | return comActBuildingService.addBuildingUnitAdmin(addBuildingUnitDto); |
| | | } |
| | | |
| | | @PostMapping("/unit/edit/admin") |
| | | public R editBuildingUnitAdmin(@RequestBody EditBuildingUnitDto editBuildingUnitDto) { |
| | | return comActBuildingService.editBuildingUnitAdmin(editBuildingUnitDto); |
| | | } |
| | | |
| | | @PostMapping("/house/add/admin") |
| | | public R addBuildingHouseAdmin(@RequestBody AddBuildingHouseDto addBuildingHouseDto) { |
| | | return comActBuildingService.addBuildingHouseAdmin(addBuildingHouseDto); |
| | | } |
| | | |
| | | @PostMapping("/house/edit/admin") |
| | | public R editBuildingHouseAdmin(@RequestBody EditBuildingHouseDto editBuildingHouseDto) { |
| | | return comActBuildingService.editBuildingHouseAdmin(editBuildingHouseDto); |
| | | } |
| | | |
| | | @PostMapping("/house/population/delete/admin") |
| | | public R deleteBuildingHousePopulationAdmin(@RequestBody DeleteBuildingHousePopulationDto housePopulationDto) { |
| | | return comActBuildingService.deleteBuildingHousePopulationAdmin(housePopulationDto); |
| | | } |
| | | } |
| | |
| | | @Select("<script> " |
| | | + "SELECT qs.id AS sub_id, ac.choice as option_name, COUNT(ac.user_id) as total, ac.answer_content as answerContent, ac.type,\n" |
| | | + " CONCAT(ROUND( COUNT(ac.user_id) /(SELECT COUNT(*) FROM com_act_questnaire_answer_content WHERE sub_id = qs.id) *100), '%') AS proportion\n" |
| | | + "FROM com_act_questnaire qn LEFT JOIN com_act_questnaire_sub qs ON qn.id = qs.que_Id\n" |
| | | + "FROM com_act_questnaire qn LEFT JOIN com_act_questnaire_sub qs ON qn.id = qs.que_id\n" |
| | | + " LEFT JOIN com_act_questnaire_answer_content ac ON qs.id = ac.sub_id\n" + "WHERE qn.id=#{questId} \n" |
| | | + "GROUP BY qs.id, ac.choice\n" + "ORDER BY qs.id" + "</script>") |
| | | List<UserSubAnswerSelectionStatVO> selectQuestnaireStat(@Param("questId") Long questId); |
| | |
| | | * 问卷ID |
| | | */ |
| | | @Select("<script> " + "SELECT u.name as user_name, ac.user_id , ac.create_at \n" |
| | | + "FROM com_act_questnaire qn LEFT JOIN com_act_questnaire_sub qs ON qn.id = qs.que_Id\n" |
| | | + "FROM com_act_questnaire qn LEFT JOIN com_act_questnaire_sub qs ON qn.id = qs.que_id\n" |
| | | + " LEFT JOIN com_act_questnaire_answer_content ac ON qs.id = ac.sub_id\n" |
| | | + " LEFT JOIN sys_user u ON ac.user_id = u.user_id \n" + "WHERE qn.id=#{pageQuestnaireAnswerDTO.questId}\n" |
| | | + "GROUP BY user_id\n" + "ORDER BY ac.create_at\n" + "</script>") |
| | |
| | | * 用户ID |
| | | */ |
| | | @Select("<script> " + "SELECT COUNT(*)\n" |
| | | + "FROM com_act_questnaire q LEFT JOIN com_act_questnaire_sub qs ON q.id = qs.que_Id\n" |
| | | + "FROM com_act_questnaire q LEFT JOIN com_act_questnaire_sub qs ON q.id = qs.que_id\n" |
| | | + "LEFT JOIN com_act_questnaire_answer_content ac ON qs.id = ac.sub_id\n" |
| | | + "WHERE q.id = #{questId} AND ac.user_id = #{userId}\n" + "</script>") |
| | | Integer selectUserCountByQuestnaireId(@Param("questId") String questId, @Param("userId") Long userId); |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.PageBuildingListDto; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.PageBuildingUnitHouseListDto; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.VillageVO; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingDetailAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | List<String> findByVillage(String ids); |
| | | |
| | | List<VillageVO> select(Long id); |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | IPage<PageBuildingListAdminVo> pageBuildingAdmin(Page page, @Param(value = "pageBuildingListDto") PageBuildingListDto pageBuildingListDto); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | BuildingListHeaderStatisticsAdminVo buildingListHeaderStatisticsAdmin(@Param(value = "communityId") Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | BuildingDetailAdminVo detailBuildAdmin(@Param(value = "id") Long id); |
| | | |
| | | /** |
| | | * 查询楼栋下的单元列表 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @return 单元列表 |
| | | */ |
| | | List<ComMngVillageBuildingVO> buildingUnitList(@Param(value = "villageId") Long villageId, @Param(value = "floor") String floor); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 房屋列表 |
| | | */ |
| | | IPage<ComMngVillageBuildingHouseVO> getBuildingUnitHouseList(Page page, @Param(value = "pageBuildingListDto") PageBuildingUnitHouseListDto unitHouseListDto); |
| | | |
| | | /** |
| | | * 查询楼栋单元下统计数据 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @param unit 单元号 |
| | | * @return 统计数据 |
| | | */ |
| | | Map<String,Object> getBuildingUnitHouseStatistics(@Param(value = "villageId") Long villageId, @Param(value = "floor") String floor, @Param(value = "unit") String unit); |
| | | |
| | | ComMngVillageBuildingHouseDetailVO buildingUnitHouseDetailAdmin(@Param("houseId") Long houseId); |
| | | |
| | | List<PopulationListVO> getGridVillageBuildingPopulationList(@Param("houseId") Long houseId,@Param("communityId") Long communityId, |
| | | @Param("relation") Integer relation, @Param("relationId") Integer relationId); |
| | | |
| | | List<ComMngVillageVO> buildingVillageListAdmin(@Param("communityId") Long communityId); |
| | | } |
| | |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmp.out_or_local = 1) as localTotal " |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmp.out_or_local = 2) as outTotal " |
| | | + ",(select count(cmpct.id) from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmpct.population_id = cmp.id where cmpct.community_id = #{communityId} and cmpct.label is not null) as specialTotal " |
| | | + ",(select count(village_id) from com_mng_village where community_id = #{communityId}) as villageTotal " |
| | | + ",(select count(DISTINCT `name`) from com_mng_village where community_id = #{communityId}) as villageTotal " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','吸毒人员','%')) as drugTotal " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','社区矫正','%')) as correctTotal " |
| | | + ",(select count(id) from com_mng_population_community_tags where community_id = #{communityId} and label LIKE CONCAT('%','精神障碍患者','%')) as majorTotal " |
| | |
| | | @Select("select count(id) as populationTotal," + |
| | | "IFNULL((select count(id) from com_mng_population_house where community_id = cmpct.community_id),0) as houseTotal, " + |
| | | "IFNULL((select count(id) from com_mng_real_company where community_id = cmpct.community_id),0) as companyTotal, " + |
| | | "IFNULL((select count(village_id) from com_mng_village where community_id = cmpct.community_id),0) as villageTotal " + |
| | | "IFNULL((select count(DISTINCT `name`) from com_mng_village where community_id = cmpct.community_id),0) as villageTotal " + |
| | | " from com_mng_population_community_tags AS cmpct " + |
| | | " where cmpct.community_id = #{communityId}") |
| | | IndexBasicsStatisticsVO getScreenIndexByBasics(@Param("communityId") Long communityId); |
| | |
| | | * 居民详情 |
| | | */ |
| | | ComMngPopulationDetailVO getById(Long id); |
| | | |
| | | /** |
| | | * 修改实有人口绑定单元号 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @param oldUnitNo 原单元号 |
| | | * @param newUnitNo 新单元号 |
| | | */ |
| | | void updatePopulationUnit(@Param("villageId") Long villageId, @Param("floor") String floor,@Param("oldUnitNo") String oldUnitNo,@Param("newUnitNo") String newUnitNo); |
| | | } |
| | |
| | | + ",#{item.purpose},#{item.controlStatus},#{item.isEmpty},#{item.constructPurpose}" |
| | | + ",#{item.constructArea},#{item.path},now())" + " </foreach>" + " </script>") |
| | | void insertAll(@Param("houseList") List<ComMngPopulationHouseDO> houseList); |
| | | |
| | | /** |
| | | * 修改房屋关联单元号 |
| | | * @param villageId 小区id |
| | | * @param floor 楼栋号 |
| | | * @param oldUnitNo 原单元号 |
| | | * @param newUnitNo 新单元号 |
| | | */ |
| | | void updateHouseUnit(@Param("villageId") Long villageId, @Param("floor") String floor,@Param("oldUnitNo") String oldUnitNo,@Param("newUnitNo") String newUnitNo); |
| | | |
| | | /** |
| | | * 修改房屋关联单元号 |
| | | * @param houseList 需要修改的数据 |
| | | */ |
| | | void updateUnitAll(@Param("houseList") List<ComMngPopulationHouseDO> houseList); |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.elders.ComEldersAuthHistoryVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | import com.panzhihua.common.model.dtos.community.PageComEldersRecordsDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageEldersAuthDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageEldersAuthRecordDTO; |
| | | import com.panzhihua.common.model.vos.community.ComEldersAuthRecordForCommunityVO; |
| | | import com.panzhihua.common.model.vos.community.ComEldersAuthRecordVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthVO; |
| | | import com.panzhihua.common.model.vos.elders.ComEldersAuthHistoryVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserVO; |
| | | import com.panzhihua.service_community.model.dos.EldersAuthDO; |
| | | |
| | |
| | | public interface EldersAuthDAO extends BaseMapper<EldersAuthDO> { |
| | | |
| | | @Select("<script> " + "SELECT ea.id, ea.create_at, ea.create_by, ea.update_by, ea.update_at," |
| | | + " ea.AUTH_USER_NAME , ea.ID_CARD, ea.BIRTH_DAY, ea.FAMILY_USER_ID ," |
| | | + " ea.DOMICILE, ea.SUMIT_USER_ID, u.phone as submitUserAccount , ea.VIDEO_URL, " |
| | | + " u.name as submitUserName, ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) as age \n" + "FROM " + " (" |
| | | + " ea.auth_user_name , ea.id_card, ea.birth_day, ea.family_user_id ," |
| | | + " ea.domicile, ea.submit_user_id, u.phone as submitUserAccount , ea.video_url, " |
| | | + " u.name as submitUserName, ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) as age \n" + "FROM " + " (" |
| | | + " SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth\n" + " FROM com_elders_auth \n" |
| | | + " GROUP BY id_card, yearMonth\n" + " ) t " + " LEFT JOIN com_elders_auth ea ON t.id = ea.id " |
| | | + " LEFT JOIN sys_user u ON ea.SUMIT_USER_ID = u.user_id\n" |
| | | + " LEFT JOIN sys_user u ON ea.submit_user_id = u.user_id\n" |
| | | + " LEFT JOIN com_act ac ON u.community_id = ac.community_id\n" + " <where> " + |
| | | |
| | | "<if test='pageEldersAuthDTO.communityId != null'>" |
| | | + " AND ac.community_id = #{pageEldersAuthDTO.communityId} " + " </if> " + |
| | | |
| | | "<if test='pageEldersAuthDTO.sumitUserId != null'>" |
| | | + " AND ea.SUMIT_USER_ID = #{pageEldersAuthDTO.sumitUserId} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.idCard != null'>" + " AND ea.ID_CARD = #{pageEldersAuthDTO.idCard} " + " </if> " |
| | | + " AND ea.submit_user_id = #{pageEldersAuthDTO.sumitUserId} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.idCard != null'>" + " AND ea.id_card = #{pageEldersAuthDTO.idCard} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.authUserName != null'>" |
| | | + " AND ea.AUTH_USER_NAME like concat('%', #{pageEldersAuthDTO.authUserName}, '%' ) " + " </if> " |
| | | + " AND ea.auth_user_name like concat('%', #{pageEldersAuthDTO.authUserName}, '%' ) " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.type == 1 '>" |
| | | + " AND DATE_FORMAT(ea.CREATE_AT, '%c') = #{pageEldersAuthDTO.month} " + " </if> " |
| | | + " AND DATE_FORMAT(ea.create_at, '%c') = #{pageEldersAuthDTO.month} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.type == 2 '>" + "<if test='pageEldersAuthDTO.createAtStart != null'>" |
| | | + " AND ea.create_at <![CDATA[>=]]> #{pageEldersAuthDTO.createAtStart} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.createAtEnd != null'>" |
| | |
| | | IPage<EldersAuthVO> selectByPage(Page page, @Param("pageEldersAuthDTO") PageEldersAuthDTO pageEldersAuthDTO); |
| | | |
| | | @Select("<script> " + "SELECT ea.id, ea.create_at, ea.create_by, ea.update_by, ea.update_at," |
| | | + " ea.AUTH_USER_NAME , ea.ID_CARD, ea.BIRTH_DAY, ea.FAMILY_USER_ID,ea.type, " |
| | | + " ea.DOMICILE, ea.SUMIT_USER_ID, u.phone as submitUserAccount , ea.VIDEO_URL , ea.FAMILY_USER_ID, " |
| | | + " u.name as submitUserName, ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) as age \n" |
| | | + "FROM com_elders_auth ea LEFT JOIN sys_user u ON ea.SUMIT_USER_ID = u.user_id\n" + " where ea.id = #{id}" |
| | | + " ea.auth_user_name , ea.id_card, ea.birth_day, ea.family_user_id,ea.type, " |
| | | + " ea.domicile, ea.submit_user_id, u.phone as submitUserAccount , ea.video_url , ea.family_user_id, " |
| | | + " u.name as submitUserName, ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) as age \n" |
| | | + "FROM com_elders_auth ea LEFT JOIN sys_user u ON ea.submit_user_id = u.user_id\n" + " where ea.id = #{id}" |
| | | + "</script>") |
| | | EldersAuthDetailsVO selectDetails(@Param("id") Long id); |
| | | |
| | | @Select("<script> " + " SELECT \n" |
| | | + " (@rownum:=@rownum+1) as seq, '高龄补贴' AS subsidy, '' AS batch, ea.AUTH_USER_NAME AS NAME, ea.ID_CARD, \n" |
| | | + " CASE\n" + " WHEN ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) > 99 THEN \"100周岁(含)以上\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) > 89 THEN \"90-99周岁\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) >= 80 THEN \"80-89周岁\"\n" + " ELSE \"未达到年龄\"\n" |
| | | + " (@rownum:=@rownum+1) as seq, '高龄补贴' AS subsidy, '' AS batch, ea.auth_user_name AS NAME, ea.id_card, \n" |
| | | + " CASE\n" + " WHEN ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) > 99 THEN \"100周岁(含)以上\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) > 89 THEN \"90-99周岁\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) >= 80 THEN \"80-89周岁\"\n" + " ELSE \"未达到年龄\"\n" |
| | | + " END AS TYPE, DATE_FORMAT(ea.create_at, '%Y-%m') AS yearMonth,\n" + " CASE\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) > 99 THEN \"800\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) > 89 THEN \"200\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) >= 80 THEN \"50\"\n" + " ELSE \"未达到年龄\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) > 99 THEN \"800\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) > 89 THEN \"200\"\n" |
| | | + " WHEN ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) >= 80 THEN \"50\"\n" + " ELSE \"未达到年龄\"\n" |
| | | + " END AS payCount,\n" |
| | | + " ac.name AS communityName, '' AS 'group', '' AS telphone , ROUND(DATEDIFF(CURDATE(), ea.BIRTH_DAY)/365.2422) AS age\n" |
| | | + " ac.name AS communityName, '' AS 'group', '' AS telphone , ROUND(DATEDIFF(CURDATE(), ea.birth_day)/365.2422) AS age\n" |
| | | + " FROM \n" + " (" + " SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth, @rownum:=0 \n" |
| | | + " FROM com_elders_auth \n" + " GROUP BY id_card, yearMonth\n" + " ) t \n" |
| | | + " LEFT JOIN com_elders_auth ea ON t.id = ea.id \n" + " LEFT JOIN sys_user u ON ea.SUMIT_USER_ID = u.user_id\n" |
| | | + " LEFT JOIN com_elders_auth ea ON t.id = ea.id \n" |
| | | + " LEFT JOIN sys_user u ON ea.submit_user_id = u.user_id\n" |
| | | + " LEFT JOIN com_act ac ON u.community_id = ac.community_id\n" + " <where> " + |
| | | |
| | | "<if test='pageEldersAuthDTO.communityId != null'>" |
| | |
| | | |
| | | "<if test='pageEldersAuthDTO.ids == null or pageEldersAuthDTO.ids.length==0 '>" |
| | | + "<if test='pageEldersAuthDTO.sumitUserId != null'>" |
| | | + " AND ea.SUMIT_USER_ID = #{pageEldersAuthDTO.sumitUserId} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.idCard != null'>" + " AND ea.ID_CARD = #{pageEldersAuthDTO.idCard} " + " </if> " |
| | | + " AND ea.submit_user_id = #{pageEldersAuthDTO.sumitUserId} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.idCard != null'>" + " AND ea.id_card = #{pageEldersAuthDTO.idCard} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.authUserName != null'>" |
| | | + " AND ea.AUTH_USER_NAME like concat('%', #{pageEldersAuthDTO.authUserName}, '%' ) " + " </if> " |
| | | + " AND ea.auth_user_name like concat('%', #{pageEldersAuthDTO.authUserName}, '%' ) " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.type == 1 '>" |
| | | + " AND DATE_FORMAT(ea.CREATE_AT, '%c') = #{pageEldersAuthDTO.month} " + " </if> " |
| | | + " AND DATE_FORMAT(ea.create_at, '%c') = #{pageEldersAuthDTO.month} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.type == 2 '>" + "<if test='pageEldersAuthDTO.createAtStart != null'>" |
| | | + " AND ea.create_at <![CDATA[>=]]> #{pageComShopOrderSearchDTO.createAtStart} " + " </if> " |
| | | + "<if test='pageEldersAuthDTO.createAtEnd != null'>" |
| | |
| | | String selectDomicile(@Param("idCard") String idCard); |
| | | |
| | | @Select("<script> " |
| | | + " SELECT distinct t.id, t.yearMonth, au.`type`, DATE_FORMAT(au.CREATE_AT,'%Y-%m-%d') AS create_at,\n" |
| | | + " SELECT distinct t.id, t.yearMonth, au.`type`, DATE_FORMAT(au.create_at,'%Y-%m-%d') AS create_at,\n" |
| | | + " case " + " when fed.id IS NOT NULL then true\n" + " ELSE false " + " END hasFeed " |
| | | + " FROM ( SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth\n" + " FROM com_elders_auth \n" |
| | | + " GROUP BY id_card, yearMonth\n" + " ) t LEFT JOIN com_elders_auth au ON t.id = au.id\n" |
| | | + " LEFT JOIN com_elders_auth_feedback fed ON t.id = fed.AUTH_ID\n" + " <where>" |
| | | + " au.FAMILY_USER_ID = #{pageComEldersRecordsDTO.bigAgeid} " + "</where>" |
| | | + " au.family_user_id = #{pageComEldersRecordsDTO.bigAgeid} " + "</where>" |
| | | + "<if test='pageComEldersRecordsDTO.sortColumns!=null'>\n" |
| | | + "ORDER BY ${pageComEldersRecordsDTO.sortColumns} ${pageComEldersRecordsDTO.sortType}\n" + "</if> " |
| | | + "</script>") |
| | |
| | | @Param("pageComEldersRecordsDTO") PageComEldersRecordsDTO pageComEldersRecordsDTO); |
| | | |
| | | @Select("<script> " + " SELECT DISTINCT a.name" |
| | | + " FROM com_elders_auth ea LEFT JOIN com_elders_auth_user au ON ea.FAMILY_USER_ID = au.id \n" |
| | | + "LEFT JOIN com_act a ON au.community_id = a.community_id\n" + " WHERE ea.ID = #{id} " + "</script>") |
| | | + " FROM com_elders_auth ea LEFT JOIN com_elders_auth_user au ON ea.family_user_id = au.id \n" |
| | | + "LEFT JOIN com_act a ON au.community_id = a.community_id\n" + " WHERE ea.id = #{id} " + "</script>") |
| | | String selectCommunityNameByAuth(@Param("id") Long id); |
| | | |
| | | @Select("select user_id,id_card,name from sys_user where user_id = #{userId}") |
| | | SysUserVO getSysUserByUserId(@Param("userId") Long userId); |
| | | |
| | | @Select("<script> " |
| | | + " SELECT e.ID,e.CREATE_BY,e.CREATE_AT, e.UPDATE_BY, e.UPDATE_AT, e.ID_CARD, e.AUTH_USER_NAME, e.VIDEO_URL," |
| | | + " e.SUMIT_USER_ID, e.DOMICILE, e.STATUS, e.BIRTH_DAY, e.type, e.age, e.verification_result, u.name as sumitUserName, u.phone as sumitUserAccount " |
| | | + " SELECT e.id,e.CREATE_BY,e.create_at, e.update_by, e.update_at, e.id_card, e.auth_user_name, e.video_url," |
| | | + " e.submit_user_id, e.domicile, e.STATUS, e.birth_day, e.type, e.age, e.verification_result, u.name as sumitUserName, u.phone as sumitUserAccount " |
| | | + " FROM ( " + " SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth " |
| | | + " FROM com_elders_auth " + " GROUP BY id_card, yearMonth " + " ) t " |
| | | + " left join com_elders_auth e on t.id = e.id " + " LEFT JOIN sys_user u ON e.SUMIT_USER_ID = u.user_id " |
| | | + " left join com_elders_auth e on t.id = e.id " + " LEFT JOIN sys_user u ON e.submit_user_id = u.user_id " |
| | | + "<where>" + " <if test='pageEldersAuthRecordDTO.name!=null'>\n" |
| | | + " AND e.AUTH_USER_NAME like concat('%', #{pageEldersAuthRecordDTO.name}, '%')" + "</if>" |
| | | + " AND e.auth_user_name like concat('%', #{pageEldersAuthRecordDTO.name}, '%')" + "</if>" |
| | | + " <if test='pageEldersAuthRecordDTO.idCard!=null and pageEldersAuthRecordDTO.idCard!=""'>\n" |
| | | + " AND e.ID_CARD = #{pageEldersAuthRecordDTO.idCard}\n" + "</if>" |
| | | + " AND e.id_card = #{pageEldersAuthRecordDTO.idCard}\n" + "</if>" |
| | | + " <if test='pageEldersAuthRecordDTO.type!=null'>\n" + " AND e.type = #{pageEldersAuthRecordDTO.type}\n" |
| | | + "</if>" + " <if test='pageEldersAuthRecordDTO.month!=null'>\n" |
| | | + " AND month(e.CREATE_AT) = #{pageEldersAuthRecordDTO.month}\n" + "</if>\n" + "</where>\n" |
| | | + " AND month(e.create_at) = #{pageEldersAuthRecordDTO.month}\n" + "</if>\n" + "</where>\n" |
| | | + "<if test='pageEldersAuthRecordDTO.sortColumns!=null'>\n" |
| | | + "ORDER BY e.${pageEldersAuthRecordDTO.sortColumns} ${pageEldersAuthRecordDTO.sortType}\n" + "</if> " |
| | | + "</script>") |
| | |
| | | private String houseNo; |
| | | |
| | | /** |
| | | * 房屋状态(1.自住 2.租住 3.其他) |
| | | * 房屋状态(1.自住 2.租住 3.空置 4.其他) |
| | | */ |
| | | private Integer status; |
| | | |
| | |
| | | */ |
| | | private String path; |
| | | |
| | | /** |
| | | * 楼层数 |
| | | */ |
| | | private Integer floorNum; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComMngPopulationHouseDO{" + "id=" + id + ", streetId=" + streetId + ", address=" + address + ", code=" |
| | |
| | | + ", constructArea=" + constructArea + ", path=" + path + ", createAt=" + createAt + ", updateAt=" |
| | | + updateAt + "}"; |
| | | } |
| | | |
| | | /** |
| | | * 房屋状态(1.自住 2.租住 3.空置 4.其他) |
| | | */ |
| | | public interface status{ |
| | | int zizhu = 1; |
| | | int zuzhu = 2; |
| | | int kongzhi = 3; |
| | | int qita = 4; |
| | | } |
| | | } |
| | |
| | | private Integer relation; |
| | | |
| | | /** |
| | | * 人和房屋关系’ (1.自住2、租住) |
| | | * 人和房屋关系’ (1.自住2、租住) 该字段类型改为(1.业主 2.业主家属 3.租户) |
| | | */ |
| | | private Integer relationId; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 人和房屋关系’ (1.自住2、租住) |
| | | * 人和房屋关系’ (1.自住2、租住) 该字段类型改为(1.业主 2.业主家属 3.租户) |
| | | */ |
| | | public interface relationId { |
| | | int zizhu = 1; |
| | | int zuzhu = 2; |
| | | int zuhu = 3; |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngBuildingExcelVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; |
| | |
| | | public interface ComActBuildingService extends IService<ComMngBuildingDO> { |
| | | |
| | | R batchSaveBuilding(List<ComMngBuildingExcelVO> newVoList, Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | R pageBuildingAdmin(PageBuildingListDto pageBuildingListDto); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | R buildingListHeaderStatisticsAdmin(Long communityId); |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | R detailBuildAdmin(Long id); |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | R buildingUnitListAdmin(Long id); |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | R buildingUnitHouseListAdmin(PageBuildingUnitHouseListDto unitHouseListDto); |
| | | |
| | | R buildingUnitHouseDetailAdmin(Long houseId,Long communityId); |
| | | |
| | | R buildingVillageListAdmin(Long communityId); |
| | | |
| | | R addBuildingUnitAdmin(AddBuildingUnitDto addBuildingUnitDto); |
| | | |
| | | R editBuildingUnitAdmin(EditBuildingUnitDto editBuildingUnitDto); |
| | | |
| | | R addBuildingHouseAdmin(AddBuildingHouseDto addBuildingHouseDto); |
| | | |
| | | R editBuildingHouseAdmin(EditBuildingHouseDto editBuildingHouseDto); |
| | | |
| | | R deleteBuildingHousePopulationAdmin(DeleteBuildingHousePopulationDto housePopulationDto); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.enums.PopulIsOksEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.model.dtos.community.building.admin.*; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.ComPopulationActVO; |
| | | import com.panzhihua.common.model.vos.community.building.admin.BuildingUnitHouseListAdminVo; |
| | | import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngBuildingDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.model.dos.GridBuildRelationDO; |
| | | import com.panzhihua.service_community.service.ComActBuildingService; |
| | | import com.panzhihua.service_community.service.GridBuildRelationService; |
| | | |
| | |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private GridBuildRelationService gridBuildRelationService; |
| | | @Resource |
| | | private ComMngPopulationHouseDAO comMngPopulationHouseDAO; |
| | | @Resource |
| | | private ComMngPopulationDAO comMngPopulationDAO; |
| | | @Resource |
| | | private ComMngPopulationHouseUserDAO comMngPopulationHouseUserDAO; |
| | | |
| | | @Override |
| | | public R batchSaveBuilding(List<ComMngBuildingExcelVO> newVoList, Long communityId) { |
| | |
| | | gridBuildRelation.setCreateAt(new Date()); |
| | | return gridBuildRelation; |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-分页查询楼栋列表 |
| | | * @param pageBuildingListDto 请求参数 |
| | | * @return 楼栋列表 |
| | | */ |
| | | @Override |
| | | public R pageBuildingAdmin(PageBuildingListDto pageBuildingListDto){ |
| | | IPage<PageBuildingListAdminVo> pageBuildingList = this.baseMapper.pageBuildingAdmin( |
| | | new Page(pageBuildingListDto.getPageNum(),pageBuildingListDto.getPageSize()),pageBuildingListDto); |
| | | return R.ok(pageBuildingList); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋列表表头统计数据 |
| | | * @param communityId 社区id |
| | | * @return 楼栋列表表头统计数据 |
| | | */ |
| | | @Override |
| | | public R buildingListHeaderStatisticsAdmin(Long communityId){ |
| | | return R.ok(this.baseMapper.buildingListHeaderStatisticsAdmin(communityId)); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-查询楼栋详情 |
| | | * @param id 楼栋id |
| | | * @return 楼栋详情 |
| | | */ |
| | | @Override |
| | | public R detailBuildAdmin(Long id){ |
| | | return R.ok(this.baseMapper.detailBuildAdmin(id)); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋下单元列表 |
| | | * @param id 楼栋id |
| | | * @return 单元列表 |
| | | */ |
| | | @Override |
| | | public R buildingUnitListAdmin(Long id){ |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(id); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | List<ComMngVillageBuildingVO> buildList = new ArrayList<>(); |
| | | if(StringUtils.isNotEmpty(buildingDO.getName())){ |
| | | buildList = this.baseMapper.buildingUnitList(buildingDO.getVillageId(),buildingDO.getName()); |
| | | buildList.forEach(villageBuilding -> { |
| | | if(StringUtils.isNotEmpty(villageBuilding.getFloor())){ |
| | | if (!villageBuilding.getFloor().contains("栋")) { |
| | | villageBuilding.setFloorString(villageBuilding.getFloor() + "栋"); |
| | | } else { |
| | | villageBuilding.setFloorString(villageBuilding.getFloor()); |
| | | } |
| | | } |
| | | if(StringUtils.isNotEmpty(villageBuilding.getUnitNo())){ |
| | | if (!villageBuilding.getUnitNo().contains("单元")) { |
| | | villageBuilding.setUnitNoString(villageBuilding.getUnitNo() + "单元"); |
| | | } else { |
| | | villageBuilding.setUnitNoString(villageBuilding.getUnitNo()); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(buildList); |
| | | } |
| | | |
| | | /** |
| | | * 查询楼栋单元下房屋列表 |
| | | * @param unitHouseListDto 请求参数 |
| | | * @return 单元列表 |
| | | */ |
| | | @Override |
| | | public R buildingUnitHouseListAdmin(PageBuildingUnitHouseListDto unitHouseListDto){ |
| | | |
| | | BuildingUnitHouseListAdminVo houseListAdminVo = new BuildingUnitHouseListAdminVo(); |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(unitHouseListDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | unitHouseListDto.setVillageId(buildingDO.getVillageId()); |
| | | unitHouseListDto.setFloor(buildingDO.getName()); |
| | | List<ComMngVillageBuildingHouseVO> buildHouseList = new ArrayList<>(); |
| | | if(StringUtils.isNotEmpty(buildingDO.getName())){ |
| | | IPage<ComMngVillageBuildingHouseVO> buildingHousePage = this.baseMapper.getBuildingUnitHouseList(new Page(unitHouseListDto.getPageNum(),unitHouseListDto.getPageSize()),unitHouseListDto); |
| | | buildingHousePage.getRecords().forEach(house -> { |
| | | if(StringUtils.isEmpty(house.getBuildingNum())){ |
| | | if(StringUtils.isNotEmpty(house.getHouseNo())){ |
| | | boolean result = house.getHouseNo().matches("[0-9]+"); |
| | | if (result) {// 该字段为纯数字 |
| | | if (house.getHouseNo().length() == 4) { |
| | | house.setBuildingNum(house.getHouseNo().substring(0, 2).replaceAll("^(0+)", "")); |
| | | } else if (house.getHouseNo().length() == 3) { |
| | | house.setBuildingNum(house.getHouseNo().substring(0, 1).replaceAll("^(0+)", "")); |
| | | } |
| | | } else { |
| | | house.setBuildingNum("-"); |
| | | } |
| | | } else { |
| | | house.setBuildingNum("-"); |
| | | } |
| | | } |
| | | }); |
| | | buildHouseList = buildingHousePage.getRecords(); |
| | | |
| | | //查询统计数据 |
| | | Map<String,Object> statisticsMap = this.baseMapper.getBuildingUnitHouseStatistics(buildingDO.getVillageId(),buildingDO.getName(),unitHouseListDto.getUnit()); |
| | | if(statisticsMap != null){ |
| | | houseListAdminVo.setHouseNum(Integer.parseInt(statisticsMap.get("houseNum").toString())); |
| | | houseListAdminVo.setLiveTotal(Integer.parseInt(statisticsMap.get("liveTotal").toString())); |
| | | houseListAdminVo.setLeaseTotal(Integer.parseInt(statisticsMap.get("leaseTotal").toString())); |
| | | houseListAdminVo.setVacantNum(Integer.parseInt(statisticsMap.get("vacantNum").toString())); |
| | | } |
| | | } |
| | | houseListAdminVo.setHouseList(buildHouseList); |
| | | |
| | | return R.ok(houseListAdminVo); |
| | | } |
| | | |
| | | @Override |
| | | public R buildingUnitHouseDetailAdmin(Long houseId,Long communityId){ |
| | | ComMngVillageBuildingHouseDetailVO buildingHouseDetailVO = |
| | | this.baseMapper.buildingUnitHouseDetailAdmin(houseId); |
| | | if (buildingHouseDetailVO != null) { |
| | | |
| | | // 转换楼层数 |
| | | String houseNo = buildingHouseDetailVO.getHouseNo(); |
| | | boolean result = houseNo.matches("[0-9]+"); |
| | | if (result) {// 该字段为纯数字 |
| | | if (houseNo.length() == 4) { |
| | | buildingHouseDetailVO.setBuildingNum(houseNo.substring(0, 2).replaceAll("^(0+)", "")); |
| | | } else if (houseNo.length() == 3) { |
| | | buildingHouseDetailVO.setBuildingNum(houseNo.substring(0, 1).replaceAll("^(0+)", "")); |
| | | } |
| | | } else { |
| | | buildingHouseDetailVO.setBuildingNum("-"); |
| | | } |
| | | |
| | | // 查询该房屋的户主信息 |
| | | List<PopulationListVO> householderList = |
| | | this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(),communityId, null, 1); |
| | | if (!householderList.isEmpty()) { |
| | | householderList.forEach(householder -> { |
| | | if(householder.getPoliticalOutlook() != null){ |
| | | householder.setOutlook(PopulPoliticalOutlookEnum.getCnDescByName(householder.getPoliticalOutlook())); |
| | | }else{ |
| | | householder.setOutlook("暂无"); |
| | | } |
| | | try { |
| | | Integer age = IdcardUtil.getAgeByIdCard(householder.getCardNo()); |
| | | householder.setAge(age); |
| | | } catch (Exception e) { |
| | | log.error("身份证号码转换年龄失败,人员id:" + householder.getId()); |
| | | } |
| | | }); |
| | | buildingHouseDetailVO.setHouseholderList(householderList); |
| | | } |
| | | // 查询该房屋的住户信息 |
| | | List<PopulationListVO> populationList = |
| | | this.baseMapper.getGridVillageBuildingPopulationList(buildingHouseDetailVO.getId(),communityId, null, null); |
| | | if (!populationList.isEmpty()) { |
| | | populationList.forEach(population -> { |
| | | if(population.getPoliticalOutlook() != null){ |
| | | population.setOutlook(PopulPoliticalOutlookEnum.getCnDescByName(population.getPoliticalOutlook())); |
| | | }else{ |
| | | population.setOutlook("暂无"); |
| | | } |
| | | try { |
| | | Integer age = IdcardUtil.getAgeByIdCard(population.getCardNo()); |
| | | population.setAge(age); |
| | | } catch (Exception e) { |
| | | log.error("身份证号码转换年龄失败,人员id:" + population.getId()); |
| | | } |
| | | }); |
| | | buildingHouseDetailVO.setPopulationList(populationList); |
| | | } |
| | | } |
| | | return R.ok(buildingHouseDetailVO); |
| | | } |
| | | |
| | | @Override |
| | | public R buildingVillageListAdmin(Long communityId){ |
| | | List<ComMngVillageVO> villageList = this.baseMapper.buildingVillageListAdmin(communityId); |
| | | villageList.forEach(village -> { |
| | | if(StringUtils.isEmpty(village.getName())){ |
| | | village.setName(village.getAlley() + village.getHouseNum()); |
| | | } |
| | | }); |
| | | return R.ok(villageList); |
| | | } |
| | | |
| | | @Override |
| | | public R addBuildingUnitAdmin(AddBuildingUnitDto addBuildingUnitDto){ |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(addBuildingUnitDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | |
| | | Integer count = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,addBuildingUnitDto.getUnitNo())); |
| | | if(count > 0){ |
| | | return R.fail("该单元号已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(buildingDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | StringBuilder address = new StringBuilder(); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(addBuildingUnitDto.getCommunityId()); |
| | | if(populationActVO != null){ |
| | | address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) |
| | | .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) |
| | | .append(villageDO.getAlley()).append(villageDO.getHouseNum()).append("号"); |
| | | if (StringUtils.isNotEmpty(buildingDO.getName())) { |
| | | address.append(buildingDO.getName()).append("栋"); |
| | | } |
| | | if (StringUtils.isNotEmpty(addBuildingUnitDto.getUnitNo())) { |
| | | address.append(addBuildingUnitDto.getUnitNo()).append("单元"); |
| | | } |
| | | housePath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()).append(">") |
| | | .append(villageDO.getAlley()).append(">").append(populationActVO.getName()).append(">").append(villageDO.getName()).append(">").append(address.toString()); |
| | | } |
| | | ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setId(Snowflake.getId()); |
| | | populationHouseDO.setStreetId(buildingDO.getStreetId()); |
| | | populationHouseDO.setVillageId(buildingDO.getVillageId()); |
| | | populationHouseDO.setAlley(villageDO.getAlley()); |
| | | populationHouseDO.setHouseNum(villageDO.getHouseNum()); |
| | | populationHouseDO.setStatus(ComMngPopulationHouseDO.status.kongzhi); |
| | | populationHouseDO.setCommunityId(addBuildingUnitDto.getCommunityId()); |
| | | populationHouseDO.setFloor(buildingDO.getName()); |
| | | populationHouseDO.setUnitNo(addBuildingUnitDto.getUnitNo()); |
| | | populationHouseDO.setAddress(address.toString()); |
| | | populationHouseDO.setUpdateAt(new Date()); |
| | | populationHouseDO.setPath(housePath.toString()); |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R editBuildingUnitAdmin(EditBuildingUnitDto editBuildingUnitDto){ |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(editBuildingUnitDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | |
| | | Integer oldCount = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,editBuildingUnitDto.getOldUnitNo())); |
| | | if(oldCount <= 0){ |
| | | return R.fail("原单元号不存在"); |
| | | } |
| | | |
| | | Integer newCount = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,editBuildingUnitDto.getNewUnitNo())); |
| | | if(newCount > 0){ |
| | | return R.fail("新单元号已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(buildingDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | String unitString = editBuildingUnitDto.getNewUnitNo() + "单元"; |
| | | |
| | | List<ComMngPopulationHouseDO> editHouseList = new ArrayList<>(); |
| | | //查询需要修改的房屋列表信息 |
| | | List<ComMngPopulationHouseDO> houseList = comMngPopulationHouseDAO.selectList(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,villageDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,editBuildingUnitDto.getOldUnitNo())); |
| | | houseList.forEach(house -> { |
| | | ComMngPopulationHouseDO houseDO = new ComMngPopulationHouseDO(); |
| | | houseDO.setId(house.getId()); |
| | | houseDO.setAddress(house.getAddress().replace(house.getUnitNo() + "单元", unitString)); |
| | | houseDO.setPath(house.getPath().replace(house.getUnitNo() + "单元", unitString)); |
| | | houseDO.setUnitNo(editBuildingUnitDto.getNewUnitNo()); |
| | | editHouseList.add(houseDO); |
| | | }); |
| | | |
| | | List<ComMngPopulationDO> editPopulationList = new ArrayList<>(); |
| | | //查询需要修改的人口信息 |
| | | List<ComMngPopulationDO> populationList = comMngPopulationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getVillageId,villageDO.getVillageId()) |
| | | .eq(ComMngPopulationDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationDO::getUnitNo,editBuildingUnitDto.getOldUnitNo())); |
| | | populationList.forEach(population -> { |
| | | ComMngPopulationDO populationDO = new ComMngPopulationDO(); |
| | | populationDO.setId(population.getId()); |
| | | populationDO.setAddress(population.getAddress().replace(population.getUnitNo() + "单元", unitString)); |
| | | populationDO.setUnitNo(editBuildingUnitDto.getNewUnitNo()); |
| | | editPopulationList.add(populationDO); |
| | | }); |
| | | |
| | | if(!editHouseList.isEmpty()){ |
| | | comMngPopulationHouseDAO.updateUnitAll(editHouseList); |
| | | } |
| | | |
| | | if(!editPopulationList.isEmpty()){ |
| | | comMngPopulationDAO.updateAll(editPopulationList); |
| | | } |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R addBuildingHouseAdmin(AddBuildingHouseDto addBuildingHouseDto){ |
| | | |
| | | //查询该楼栋信息 |
| | | ComMngBuildingDO buildingDO = this.baseMapper.selectById(addBuildingHouseDto.getId()); |
| | | if(buildingDO == null){ |
| | | return R.fail("未查询到该楼栋信息"); |
| | | } |
| | | |
| | | Integer count = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,buildingDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,buildingDO.getName()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,addBuildingHouseDto.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo,addBuildingHouseDto.getHouseNo())); |
| | | if(count > 0){ |
| | | return R.fail("该房间已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(buildingDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | StringBuilder address = new StringBuilder(); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(addBuildingHouseDto.getCommunityId()); |
| | | if(populationActVO != null){ |
| | | address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) |
| | | .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) |
| | | .append(villageDO.getAlley()).append(villageDO.getHouseNum()).append("号"); |
| | | if (StringUtils.isNotEmpty(buildingDO.getName())) { |
| | | address.append(buildingDO.getName()).append("栋"); |
| | | } |
| | | if (StringUtils.isNotEmpty(addBuildingHouseDto.getUnitNo())) { |
| | | address.append(addBuildingHouseDto.getUnitNo()).append("单元"); |
| | | } |
| | | if (StringUtils.isNotEmpty(addBuildingHouseDto.getHouseNo())) { |
| | | address.append(addBuildingHouseDto.getHouseNo()).append("号"); |
| | | } |
| | | housePath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()).append(">") |
| | | .append(villageDO.getAlley()).append(">").append(populationActVO.getName()).append(">").append(villageDO.getName()).append(">").append(address.toString()); |
| | | } |
| | | ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); |
| | | populationHouseDO.setId(Snowflake.getId()); |
| | | populationHouseDO.setStreetId(buildingDO.getStreetId()); |
| | | populationHouseDO.setVillageId(buildingDO.getVillageId()); |
| | | populationHouseDO.setAlley(villageDO.getAlley()); |
| | | populationHouseDO.setHouseNum(villageDO.getHouseNum()); |
| | | populationHouseDO.setStatus(ComMngPopulationHouseDO.status.kongzhi); |
| | | populationHouseDO.setCommunityId(addBuildingHouseDto.getCommunityId()); |
| | | populationHouseDO.setFloor(buildingDO.getName()); |
| | | populationHouseDO.setUnitNo(addBuildingHouseDto.getUnitNo()); |
| | | populationHouseDO.setHouseNo(addBuildingHouseDto.getHouseNo()); |
| | | populationHouseDO.setFloorNum(addBuildingHouseDto.getFloorNum()); |
| | | populationHouseDO.setAddress(address.toString()); |
| | | populationHouseDO.setUpdateAt(new Date()); |
| | | populationHouseDO.setPath(housePath.toString()); |
| | | populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); |
| | | comMngPopulationHouseDAO.insert(populationHouseDO); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R editBuildingHouseAdmin(EditBuildingHouseDto editBuildingHouseDto){ |
| | | |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(editBuildingHouseDto.getHouseId()); |
| | | if(houseDO == null){ |
| | | return R.fail("未查询到该户室"); |
| | | } |
| | | |
| | | Integer count = comMngPopulationHouseDAO.selectCount(new QueryWrapper<ComMngPopulationHouseDO>().lambda() |
| | | .eq(ComMngPopulationHouseDO::getVillageId,houseDO.getVillageId()) |
| | | .eq(ComMngPopulationHouseDO::getFloor,houseDO.getFloor()) |
| | | .eq(ComMngPopulationHouseDO::getUnitNo,houseDO.getUnitNo()) |
| | | .eq(ComMngPopulationHouseDO::getHouseNo,editBuildingHouseDto.getHouseNo())); |
| | | if(count > 0){ |
| | | return R.fail("该房间已存在"); |
| | | } |
| | | |
| | | //查询小区信息 |
| | | ComMngVillageDO villageDO = comActVillageDAO.selectById(houseDO.getVillageId()); |
| | | if(villageDO != null){ |
| | | StringBuilder address = new StringBuilder(); |
| | | StringBuilder housePath = new StringBuilder(); |
| | | ComPopulationActVO populationActVO = comActDAO.getPopulationActById(editBuildingHouseDto.getCommunityId()); |
| | | if(populationActVO != null){ |
| | | address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) |
| | | .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) |
| | | .append(villageDO.getAlley()).append(villageDO.getHouseNum()).append("号"); |
| | | if (StringUtils.isNotEmpty(houseDO.getFloor())) { |
| | | address.append(houseDO.getFloor()).append("栋"); |
| | | } |
| | | if (StringUtils.isNotEmpty(houseDO.getUnitNo())) { |
| | | address.append(houseDO.getUnitNo()).append("单元"); |
| | | } |
| | | if (StringUtils.isNotEmpty(editBuildingHouseDto.getHouseNo())) { |
| | | address.append(editBuildingHouseDto.getHouseNo()).append("号"); |
| | | } |
| | | housePath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()).append(">") |
| | | .append(villageDO.getAlley()).append(">").append(populationActVO.getName()).append(">").append(villageDO.getName()).append(">").append(address.toString()); |
| | | houseDO.setAddress(address.toString()); |
| | | houseDO.setPath(housePath.toString()); |
| | | } |
| | | List<ComMngPopulationDO> editPopulationList = new ArrayList<>(); |
| | | //查询需要修改的人口信息 |
| | | List<ComMngPopulationDO> populationList = comMngPopulationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getVillageId,villageDO.getVillageId()) |
| | | .eq(ComMngPopulationDO::getFloor,houseDO.getFloor()) |
| | | .eq(ComMngPopulationDO::getUnitNo,houseDO.getUnitNo()) |
| | | .eq(ComMngPopulationDO::getHouseNo,houseDO.getHouseNo())); |
| | | populationList.forEach(population -> { |
| | | ComMngPopulationDO populationDO = new ComMngPopulationDO(); |
| | | populationDO.setId(population.getId()); |
| | | populationDO.setAddress(address.toString()); |
| | | populationDO.setHouseNo(editBuildingHouseDto.getHouseNo()); |
| | | editPopulationList.add(populationDO); |
| | | }); |
| | | |
| | | houseDO.setHouseNo(editBuildingHouseDto.getHouseNo()); |
| | | houseDO.setFloorNum(editBuildingHouseDto.getFloorNum()); |
| | | comMngPopulationHouseDAO.updateById(houseDO); |
| | | |
| | | if(!editPopulationList.isEmpty()){ |
| | | comMngPopulationDAO.updateAll(editPopulationList); |
| | | } |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteBuildingHousePopulationAdmin(DeleteBuildingHousePopulationDto housePopulationDto){ |
| | | |
| | | ComMngPopulationHouseDO houseDO = comMngPopulationHouseDAO.selectById(housePopulationDto.getHouseId()); |
| | | if(houseDO == null){ |
| | | return R.fail("未查询到该户室"); |
| | | } |
| | | |
| | | if(housePopulationDto.getType().equals(DeleteBuildingHousePopulationDto.type.yz)){ |
| | | ComMngPopulationHouseUserDO houseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId,housePopulationDto.getPopulationId())); |
| | | if(houseUserDO != null){ |
| | | houseUserDO.setRelationId(ComMngPopulationHouseUserDO.relationId.zuzhu); |
| | | houseUserDO.setUpdateAt(new Date()); |
| | | comMngPopulationHouseUserDAO.updateById(houseUserDO); |
| | | } |
| | | }else if(housePopulationDto.getType().equals(DeleteBuildingHousePopulationDto.type.jzr)){ |
| | | //清理人员和房屋关联关系 |
| | | comMngPopulationHouseUserDAO.delete(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId()) |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId,housePopulationDto.getPopulationId())); |
| | | |
| | | //查询该房屋是否还有人居住 |
| | | Integer count = comMngPopulationHouseUserDAO.selectCount(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId())); |
| | | if(count <= 0){ |
| | | houseDO.setStatus(ComMngPopulationHouseDO.status.kongzhi); |
| | | comMngPopulationHouseDAO.updateById(houseDO); |
| | | }else{ |
| | | //查询该房屋的居住人中是否还有租住的人 |
| | | Integer zCount = comMngPopulationHouseUserDAO.selectCount(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getHouseId,housePopulationDto.getHouseId()) |
| | | .eq(ComMngPopulationHouseUserDO::getRelationId,ComMngPopulationHouseUserDO.relationId.zuhu)); |
| | | if(zCount <= 0){ |
| | | houseDO.setStatus(ComMngPopulationHouseDO.status.zizhu); |
| | | comMngPopulationHouseDAO.updateById(houseDO); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | FROM |
| | | com_act_questnaire_answer_content caqac |
| | | LEFT JOIN com_act_questnaire_sub caqs ON caqac.sub_id = caqs.id |
| | | LEFT JOIN com_act_questnaire caq ON caqs.que_Id = caq.id |
| | | LEFT JOIN com_act_questnaire caq ON caqs.que_id = caq.id |
| | | LEFT JOIN sys_user su ON caqac.user_id = su.user_id |
| | | LEFT JOIN com_act_questnaire_user_answer caqua ON caqua.id = caqac.answer_id |
| | | WHERE |
| | |
| | | </select> |
| | | |
| | | <delete id="deleteQuesSubAll"> |
| | | delete from com_act_questnaire_sub where que_Id = #{queId}; |
| | | delete from com_act_questnaire_sub_selection where que_Id = #{queId}; |
| | | delete from com_act_questnaire_sub where que_id = #{queId}; |
| | | delete from com_act_questnaire_sub_selection where que_id = #{queId}; |
| | | </delete> |
| | | |
| | | <select id="getQuesDetailAdmin" resultType="com.panzhihua.common.model.vos.community.questnaire.QuestnaireDetailAdminVO"> |
| | |
| | | com_act_questnaire_sub_selection AS caqss |
| | | LEFT JOIN com_act_questnaire_sub AS caqs ON caqs.id = caqss.que_sub_id |
| | | WHERE |
| | | caqss.que_Id = #{summaryDTO.questId} |
| | | caqss.que_id = #{summaryDTO.questId} |
| | | order by caqss.create_at asc |
| | | </select> |
| | | |
| | |
| | | com_act_questnaire_sub_selection AS caqss |
| | | LEFT JOIN com_act_questnaire_sub AS caqs ON caqs.id = caqss.que_sub_id |
| | | WHERE |
| | | caqss.que_Id = #{questId} |
| | | caqss.que_id = #{questId} |
| | | order by caqss.create_at asc |
| | | </select> |
| | | |
| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.EldersAuthDO"> |
| | | <id column="ID" property="id" /> |
| | | <result column="CREATE_BY" property="createBy" /> |
| | | <result column="CREATE_AT" property="createAt" /> |
| | | <result column="UPDATE_BY" property="updateBy" /> |
| | | <result column="UPDATE_AT" property="updateAt" /> |
| | | <result column="ID_CARD" property="idCard" /> |
| | | <result column="AUTH_USER_NAME" property="authUserName" /> |
| | | <result column="VIDEO_URL" property="videoUrl" /> |
| | | <result column="SUMIT_USER_ID" property="sumitUserId" /> |
| | | <result column="DOMICILE" property="domicile" /> |
| | | <result column="STATUS" property="status" /> |
| | | <result column="BIRTH_DAY" property="birthDay" /> |
| | | <result column="FAMILY_USER_ID" property="familyUserId" /> |
| | | <id column="id" property="id"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_at" property="updateAt"/> |
| | | <result column="id_card" property="idCard"/> |
| | | <result column="auth_user_name" property="authUserName"/> |
| | | <result column="video_url" property="videoUrl"/> |
| | | <result column="submit_user_id" property="sumitUserId"/> |
| | | <result column="domicile" property="domicile"/> |
| | | <result column="status" property="status"/> |
| | | <result column="birth_day" property="birthDay"/> |
| | | <result column="family_user_id" property="familyUserId"/> |
| | | <result column="type" property="type" /> |
| | | <result column="verification_result" property="verificationResult" /> |
| | | <result column="age" property="age" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | ID, CREATE_BY, CREATE_AT, UPDATE_BY, UPDATE_AT, ID_CARD, AUTH_USER_NAME, VIDEO_URL, SUMIT_USER_ID, DOMICILE, STATUS, BIRTH_DAY, FAMILY_USER_ID, type, verification_result, age |
| | | id, create_by, create_at, update_by, update_at, id_card, auth_user_name, video_url, sumit_user_id, domicile, status, birth_day, family_user_id, type, verification_result, age |
| | | </sql> |
| | | |
| | | <select id="getEldersAuthStatistics" resultType="Map"> |
| | |
| | | ceae.id_card, |
| | | ceae.birthday, |
| | | ceae.domicile, |
| | | cea.CREATE_AT |
| | | cea.create_at |
| | | FROM |
| | | com_elders_auth AS cea |
| | | LEFT JOIN com_elders_auth_user AS ceau ON ceau.id = cea.FAMILY_USER_ID |
| | | LEFT JOIN com_elders_auth_user AS ceau ON ceau.id = cea.family_user_id |
| | | LEFT JOIN com_elders_auth_elderly AS ceae ON ceae.id = ceau.big_age_id |
| | | WHERE |
| | | type = 1 and ceau.community_id = #{communityId} |
| | | AND cea.CREATE_AT BETWEEN DATE_FORMAT( date_sub( date_format( now(), '%y-%m-%d 00:00:00' ), INTERVAL extract( DAY FROM now())- 1 DAY ), '%Y-%m-%d %H:%i:%s' ) |
| | | AND cea.create_at BETWEEN DATE_FORMAT( date_sub( date_format( now(), '%y-%m-%d 00:00:00' ), INTERVAL extract( DAY FROM now())- 1 DAY ), '%Y-%m-%d %H:%i:%s' ) |
| | | AND DATE_FORMAT( date_sub( date_format( now(), '%y-%m-%d 23:59:59' ), INTERVAL extract( DAY FROM now()) DAY ), '%Y-%m-%d %H:%i:%s' ) |
| | | order by cea.CREATE_AT desc |
| | | order by cea.create_at desc |
| | | </select> |
| | | |
| | | <select id="selectCommunityEldersRecordByPage" parameterType="com.panzhihua.common.model.dtos.community.PageEldersAuthRecordDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComEldersAuthRecordForCommunityVO"> |
| | | SELECT e.ID,e.CREATE_BY,e.CREATE_AT, e.UPDATE_BY, e.UPDATE_AT, e.ID_CARD, e.AUTH_USER_NAME, e.VIDEO_URL, |
| | | e.SUMIT_USER_ID, e.DOMICILE, e.STATUS, e.BIRTH_DAY, e.type, e.age, e.verification_result, u.name as sumitUserName, u.phone as sumitUserAccount |
| | | SELECT e.id,e.create_by,e.create_at, e.update_by, e.update_at, e.id_card, e.auth_user_name, e.video_url, |
| | | e.sumit_user_id, e.domicile, e.status, e.birth_day, e.type, e.age, e.verification_result, u.name as |
| | | sumitUserName, u.phone as sumitUserAccount |
| | | FROM ( SELECT MAX(id) AS id , DATE_FORMAT(create_at, '%Y-%m') AS yearMonth |
| | | FROM com_elders_auth GROUP BY id_card, yearMonth ) t |
| | | left join com_elders_auth e on t.id = e.id LEFT JOIN sys_user u ON e.SUMIT_USER_ID = u.user_id |
| | | left join com_elders_auth e on t.id = e.id LEFT JOIN sys_user u ON e.sumit_user_id = u.user_id |
| | | <where> |
| | | <if test='pageEldersAuthRecordDTO.name!=null'> |
| | | AND e.AUTH_USER_NAME like concat('%', #{pageEldersAuthRecordDTO.name}, '%') |
| | | AND e.auth_user_name like concat('%', #{pageEldersAuthRecordDTO.name}, '%') |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.idCard!=null and pageEldersAuthRecordDTO.idCard!=""'> |
| | | AND e.ID_CARD = #{pageEldersAuthRecordDTO.idCard} |
| | | AND e.id_card = #{pageEldersAuthRecordDTO.idCard} |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.type!=null'> |
| | | AND e.type = #{pageEldersAuthRecordDTO.type} |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.month!=null'> |
| | | AND month(e.CREATE_AT) = #{pageEldersAuthRecordDTO.month} |
| | | AND month(e.create_at) = #{pageEldersAuthRecordDTO.month} |
| | | </if> |
| | | <if test='pageEldersAuthRecordDTO.year!=null'> |
| | | AND year(e.CREATE_AT) = #{pageEldersAuthRecordDTO.year} |
| | | AND year(e.create_at) = #{pageEldersAuthRecordDTO.year} |
| | | </if> |
| | | </where> |
| | | <if test='pageEldersAuthRecordDTO.sortColumns!=null'> |
| | |
| | | select t.village_id as villageId,t.name as villageName,t1.id,t1.name from com_mng_village t left join com_mng_building t1 on t.village_id = t1.village_id where t.community_id=#{id} and t1.id is not null |
| | | </select> |
| | | |
| | | <select id="pageBuildingAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo"> |
| | | SELECT |
| | | cmb.id, |
| | | cmv.village_id, |
| | | cmv.alley, |
| | | cmb.`name`, |
| | | cmv.`name` AS villageName, |
| | | cmv.house_num as doorNum, |
| | | cmb.unit_total, |
| | | cmb.build_floor_sum, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name`) as houseNum, |
| | | (select count(id) from com_mng_population where village_id = cmb.village_id and floor = cmb.`name`) as populationNum |
| | | FROM |
| | | com_mng_building AS cmb |
| | | LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmb.village_id |
| | | <where> |
| | | <if test="pageBuildingListDto.communityId != null"> |
| | | and cmb.act_id = #{pageBuildingListDto.communityId} |
| | | </if> |
| | | <if test="pageBuildingListDto.villageId != null"> |
| | | and cmb.village_id = #{pageBuildingListDto.villageId} |
| | | </if> |
| | | <if test="pageBuildingListDto.keyWord != null and pageBuildingListDto.keyWord != """> |
| | | and cmv.alley like concat(#{pageBuildingListDto.keyWord},'%') |
| | | </if> |
| | | </where> |
| | | order by cmb.create_at desc |
| | | </select> |
| | | |
| | | <select id="buildingListHeaderStatisticsAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo"> |
| | | SELECT count( id ) AS buildNum,( SELECT count( id ) FROM com_mng_population_house WHERE community_id = cmb.act_id ) AS houseNum, |
| | | ( SELECT count( id ) FROM com_mng_population_community_tags WHERE community_id = cmb.act_id ) AS populationNum |
| | | FROM |
| | | com_mng_building AS cmb |
| | | WHERE |
| | | cmb.act_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="detailBuildAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.BuildingDetailAdminVo"> |
| | | SELECT |
| | | cmb.id, |
| | | cmv.alley, |
| | | cmv.house_num AS doorNum, |
| | | cmb.`name`, |
| | | cmv.`name` AS village, |
| | | cmv.village_id, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name`) as houseNum, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name` and `status` = 1) as liveTotal, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name` and `status` = 2) as leaseTotal, |
| | | (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name` and `status` = 3) as vacantNum |
| | | FROM |
| | | com_mng_building AS cmb |
| | | LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmb.village_id |
| | | where cmb.id = #{id} |
| | | </select> |
| | | |
| | | <select id="buildingUnitList" resultType="com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO"> |
| | | SELECT DISTINCT |
| | | village_id, |
| | | floor, |
| | | unit_no |
| | | FROM |
| | | com_mng_population_house AS cmph |
| | | WHERE |
| | | village_id = #{villageId} and floor = #{floor} |
| | | </select> |
| | | |
| | | <select id="getBuildingUnitHouseList" resultType="com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO"> |
| | | SELECT id, floor, unit_no, house_no, `status`,floor_num as buildingNum, |
| | | ( SELECT count( id ) FROM com_mng_population_house_user WHERE house_id = cmph.id ) AS userNum |
| | | FROM |
| | | com_mng_population_house AS cmph |
| | | where cmph.village_id = #{pageBuildingListDto.villageId} |
| | | and cmph.floor = #{pageBuildingListDto.floor} |
| | | and cmph.unit_no = #{pageBuildingListDto.unit} |
| | | and cmph.house_no is not null |
| | | |
| | | order by floor_num asc |
| | | </select> |
| | | |
| | | <select id="getBuildingUnitHouseStatistics" resultType="Map"> |
| | | SELECT |
| | | count( id ) as houseNum, |
| | | (select count(id) from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null and `status` = 1) as liveTotal, |
| | | (select count(id) from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null and `status` = 2) as leaseTotal, |
| | | (select count(id) from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null and `status` = 3) as vacantNum |
| | | FROM |
| | | com_mng_population_house |
| | | WHERE |
| | | village_id = #{villageId} and floor = #{floor} and unit_no = #{unit} and house_no is not null |
| | | </select> |
| | | |
| | | <select id="buildingUnitHouseDetailAdmin" resultType="com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO"> |
| | | SELECT |
| | | cmph.id, |
| | | cmv.`name` AS villageName, |
| | | cmph.floor, |
| | | cmph.unit_no, |
| | | cmph.house_no, |
| | | cmph.address, |
| | | cmph.`status`, |
| | | cmv.lat, |
| | | cmv.lng |
| | | FROM |
| | | com_mng_population_house AS cmph |
| | | LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmph.village_id |
| | | WHERE |
| | | cmph.id = #{houseId} |
| | | </select> |
| | | |
| | | <select id="getGridVillageBuildingPopulationList" resultType="com.panzhihua.common.model.vos.grid.PopulationListVO"> |
| | | SELECT |
| | | cmp.id, |
| | | cmphu.id AS housePopulationId, |
| | | cmp.sex, |
| | | cmp.`name`, |
| | | IFNULL( cmp.phone, '暂无' ) AS phone, |
| | | cmp.card_no, |
| | | cmpct.label, |
| | | cmp.address, |
| | | cmp.nation, |
| | | cmphu.create_at, |
| | | cmp.political_outlook |
| | | FROM |
| | | com_mng_population_house_user AS cmphu |
| | | LEFT JOIN com_mng_population AS cmp ON cmp.id = cmphu.popul_id |
| | | LEFT JOIN com_mng_population_community_tags AS cmpct ON cmp.id = cmpct.population_id and community_id = #{communityId} |
| | | WHERE |
| | | cmphu.house_id = #{houseId} |
| | | <if test='relation != null '> |
| | | AND cmphu.relation = #{relation} |
| | | </if> |
| | | <if test='relationId != null '> |
| | | AND cmphu.relation_id = #{relationId} |
| | | </if> |
| | | group by id |
| | | </select> |
| | | |
| | | <select id="buildingVillageListAdmin" resultType="com.panzhihua.common.model.vos.community.ComMngVillageVO"> |
| | | SELECT |
| | | village_id, |
| | | alley, |
| | | house_num, |
| | | `name` |
| | | FROM |
| | | com_mng_village |
| | | WHERE |
| | | community_id = #{communityId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test='screenEventDTO.endTime != null and screenEventDTO.endTime != ""'> |
| | | AND create_at <![CDATA[<=]]> #{screenEventDTO.endTime} </if> ), 0 ) AS yesEventSSPTotal |
| | | FROM `event` AS e LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id WHERE |
| | | egd.grid_community_id = #{screenEventDTO.communityId} AND event_status = 2 |
| | | egd.grid_community_id = #{screenEventDTO.communityId} AND event_status = 2 AND event_category = 1 |
| | | AND event_type = 1 |
| | | <if test='screenEventDTO.startTime != null and screenEventDTO.startTime != ""'> |
| | | AND e.create_at <![CDATA[>=]]> #{screenEventDTO.startTime} </if> |
| | | <if test='screenEventDTO.endTime != null and screenEventDTO.endTime != ""'> |
| | | AND e.create_at <![CDATA[<=]]> #{screenEventDTO.endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <update id="updatePopulationUnit"> |
| | | update com_mng_population set unit_no = #{newUnitNo} where village_id = #{villageId} and floor = #{floor} and unit_no = #{oldUnitNo} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComMngPopulationHouseDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="street_id" property="streetId" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="village_id" property="villageId" /> |
| | | <result column="alley" property="alley" /> |
| | | <result column="house_num" property="houseNum" /> |
| | | <result column="unit_no" property="unitNo" /> |
| | | <result column="floor" property="floor" /> |
| | | <result column="house_no" property="houseNo" /> |
| | | <result column="code" property="code" /> |
| | | <result column="address" property="address" /> |
| | | <result column="status" property="status" /> |
| | | <result column="purpose" property="purpose" /> |
| | | <result column="control_status" property="controlStatus" /> |
| | | <result column="is_empty" property="isEmpty" /> |
| | | <result column="construct_purpose" property="constructPurpose" /> |
| | | <result column="construct_area" property="constructArea" /> |
| | | <result column="path" property="path" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, street_id, community_id, village_id, alley, house_num, unit_no, floor, house_no, code, address, status, purpose, control_status, is_empty, construct_purpose, construct_area, path, create_at, update_at |
| | | </sql> |
| | | |
| | | <update id="updateHouseUnit"> |
| | | update com_mng_population_house set unit_no = #{newUnitNo} where village_id = #{villageId} and floor = #{floor} and unit_no = #{oldUnitNo} |
| | | </update> |
| | | |
| | | <update id="updateUnitAll" parameterType="java.util.List"> |
| | | <foreach collection="houseList" item="item" index="index" separator=";"> |
| | | update com_mng_population_house |
| | | <set> |
| | | <if test="item.address != null and item.address != """> |
| | | `address` = #{item.address}, |
| | | </if> |
| | | <if test="item.path != null and item.path != """> |
| | | `path` = #{item.path}, |
| | | </if> |
| | | <if test="item.unitNo != null and item.unitNo != """> |
| | | `unit_no` = #{item.unitNo}, |
| | | </if> |
| | | `update_at` = NOW() |
| | | </set> |
| | | WHERE `id` = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.service_grid.dao.EventGridMemberRelationMapper; |
| | | import com.panzhihua.service_grid.service.EventGridMemberRelationService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | |
| | | |
| | | @Resource |
| | | private EventService eventService; |
| | | @Resource |
| | | private EventGridMemberRelationService eventGridMemberRelationService; |
| | | |
| | | /** |
| | | * 事件大屏查询事件列表 |
| | |
| | | return eventService.civilVillageStatistics(villageId); |
| | | } |
| | | |
| | | /** |
| | | * 查询社区网格员运动轨迹 |
| | | * @param communityId 社区id |
| | | * @return 社区网格员运动轨迹 |
| | | */ |
| | | @GetMapping("/member/trajectory") |
| | | public R getGridsMemberTrajectory(@RequestParam("communityId") Long communityId){ |
| | | return eventGridMemberRelationService.getGridsMemberTrajectory(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.vos.screen.GridMemberTrajectoryVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | List<EventStatisticsMemberAdminVO> |
| | | gridMemberStatisticsAll(@Param("statisticsAdminDTO") MemberStatisticsAdminDTO statisticsAdminDTO); |
| | | |
| | | /** |
| | | * 查询该社区的网格员列表 |
| | | * @param communityId 社区id |
| | | * @return 网格员列表 |
| | | */ |
| | | List<GridMemberTrajectoryVo> getGridsMemberList(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询网格员当天运动轨迹 |
| | | * @param userId 用户id |
| | | * @return 网格员当天运动轨迹 |
| | | */ |
| | | List<String> getGridsMemberTrajectory(@Param("userId") Long userId); |
| | | |
| | | } |
| | |
| | | |
| | | R getMapGridsListsByApp(Long userId); |
| | | |
| | | /** |
| | | * 查询社区网格员运动轨迹 |
| | | * @param communityId 社区id |
| | | * @return 社区网格员运动轨迹 |
| | | */ |
| | | R getGridsMemberTrajectory(Long communityId); |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.screen.GridMemberTrajectoryVo; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | return R.ok(resultList); |
| | | } |
| | | |
| | | /** |
| | | * 查询社区网格员运动轨迹 |
| | | * @param communityId 社区id |
| | | * @return 社区网格员运动轨迹 |
| | | */ |
| | | @Override |
| | | public R getGridsMemberTrajectory(Long communityId){ |
| | | //查询社区所有网格员 |
| | | List<GridMemberTrajectoryVo> memberTrajectoryList = eventGridMemberRelationMapper.getGridsMemberList(communityId); |
| | | memberTrajectoryList.forEach(member -> { |
| | | member.setLngLatList(eventGridMemberRelationMapper.getGridsMemberTrajectory(member.getUserId())); |
| | | }); |
| | | return R.ok(memberTrajectoryList); |
| | | } |
| | | |
| | | } |
| | |
| | | ORDER BY su.create_at desc |
| | | </select> |
| | | |
| | | <select id="getGridsMemberList" resultType="com.panzhihua.common.model.vos.screen.GridMemberTrajectoryVo"> |
| | | SELECT |
| | | egmr.grid_member_id as userId, |
| | | su.`name` |
| | | FROM |
| | | event_grid_member_relation AS egmr |
| | | left join event_grid_data as egd on egd.id = egmr.grid_id |
| | | INNER JOIN sys_user AS su ON su.user_id = egmr.grid_member_id |
| | | |
| | | where egd.grid_community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="getGridsMemberTrajectory" resultType="String"> |
| | | select lng_lat from event_grid_member_gps_log |
| | | where grid_member_id = #{userId} and create_at > DATE_SUB(DATE_FORMAT(CURDATE(),'%Y-%m-%d 09:00:00'),INTERVAL 0 DAY) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result property="idCard" column="id_card"/> |
| | | <result property="company" column="company"/> |
| | | <result property="residence" column="residence"/> |
| | | <result property="isPanzhihua" column="is_panzhiHua"/> |
| | | <result property="isPanzhihua" column="is_panzhihua"/> |
| | | <result property="situation" column="situation"/> |
| | | <result property="isContact" column="is_contact"/> |
| | | <result property="major" column="major"/> |
| | | <result property="soldier" column="soldier"/> |
| | | <result property="lowincomeHouseholds" column="lowIncome_households"/> |
| | | <result property="lowincomePeople" column="lowIncome_people"/> |
| | | <result property="lowincomeHouseholds" column="low_income_households"/> |
| | | <result property="lowincomePeople" column="low_income_people"/> |
| | | <result property="oldPeople" column="old_people"/> |
| | | <result property="specialServiceFamily" column="special_service_family"/> |
| | | <result property="keyPersonnel" column="key_personnel"/> |
| | |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | | `id`,`door_number`,`is_rent`,`name`,`nation`,`political_outlook`,`marital_status`,`phone`,`education`,`id_card`,`company`,`residence`,`is_panzhiHua`,`situation`,`is_contact`,`major`,`soldier`,`lowIncome_households`,`lowIncome_people`,`old_people`,`special_service_family`,`key_personnel`,`community_id`,`area_id`,`create_at`,`update_at`,`house_code`,`disability`,`tags` |
| | | `id`,`door_number`,`is_rent`,`name`,`nation`,`political_outlook`,`marital_status`,`phone`,`education`,`id_card`,`company`,`residence`,`is_panzhihua`,`situation`,`is_contact`,`major`,`soldier`,`low_income_households`,`low_income_people`,`old_people`,`special_service_family`,`key_personnel`,`community_id`,`area_id`,`create_at`,`update_at`,`house_code`,`disability`,`tags` |
| | | </sql> |
| | | |
| | | |
| | |
| | | SELECT u.id 'order', c.`area_name` areaName, u.door_number doorNumber, if(u.is_rent=1,'租住','自主')isRent, u.name, |
| | | u.nation, case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, |
| | | if(u.marital_status=1,'已婚','未婚')maritalStatus, u.phone, u.education, u.id_card, u.company, u.residence, |
| | | if(u.is_panzhiHua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') |
| | | if(u.is_panzhihua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') |
| | | major, if(u.soldier=1,'是','否') soldier, if(u.disability=1,'是','否') disability, |
| | | if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, if(u.lowIncome_people=1,'是','否') lowIncomePeople, |
| | | if(u.low_income_households=1,'是','否') lowIncomeHouseholds, if(u.low_income_people=1,'是','否') lowIncomePeople, |
| | | if(u.old_people=1,'是','否') oldPeople, if(u.special_service_family=1,'是','否') specialServiceFamily, |
| | | if(u.key_personnel=1,'是','否') keyPersonnel, u.tags FROM sys_user_input u JOIN com_mng_struct_area c ON u.area_id |
| | | = c.id where u.community_id=#{exportSpecialUserDTO.communityId} |
| | |
| | | like concat(#{exportSpecialUserDTO.name},'%') |
| | | </if> |
| | | <if test='exportSpecialUserDTO.tags != null and exportSpecialUserDTO.tags.trim() != ""'>CONCAT( IF ( |
| | | t.soldier = 1, '军人,', '' ), IF ( t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, |
| | | t.soldier = 1, '军人,', '' ), IF ( t.low_income_households = 1, '低保户,', '' ), IF ( t.low_income_people = 1, |
| | | '低收入,', '' ), IF ( t.old_people = 1, '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ), |
| | | IFNULL(t.tags,'') ) like concat(#{exportSpecialUserDTO.tags},'%') |
| | | </if> |
| | |
| | | SELECT u.id 'order', c.`area_name` areaName, u.door_number doorNumber, if(u.is_rent=1,'租住','自主')isRent, u.name, |
| | | u.nation, case u.political_outlook when 1 then '党员' when 2 then '团员' else '群众' end politicalOutlook, |
| | | if(u.marital_status=1,'已婚','未婚')maritalStatus, u.phone, u.education, u.id_card, u.company, u.residence, |
| | | if(u.is_panzhiHua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') |
| | | if(u.is_panzhihua=1,'是','否') isPanZhiHua, u.situation, if(is_contact=1,'是','否') isContact, if(u.major=1,'是','否') |
| | | major, if(u.soldier=1,'是','否') soldier, if(u.disability=1,'是','否') disability, |
| | | if(u.lowIncome_households=1,'是','否') lowIncomeHouseholds, if(u.lowIncome_people=1,'是','否') lowIncomePeople, |
| | | if(u.low_income_households=1,'是','否') lowIncomeHouseholds, if(u.low_income_people=1,'是','否') lowIncomePeople, |
| | | if(u.old_people=1,'是','否') oldPeople, if(u.special_service_family=1,'是','否') specialServiceFamily, |
| | | if(u.key_personnel=1,'是','否') keyPersonnel, u.tags FROM sys_user_input u where |
| | | u.community_id=#{exportUserDTO.communityId} |
| | |
| | | 2, IF ( length( t.id_card ) = 15, cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, 3 ) ) WHEN 1 THEN 1 |
| | | WHEN 0 THEN 2 ELSE 0 END AS sex, t.phone, YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) age, |
| | | t1.area_name as areaName, t.political_outlook politicalOutlook, CONCAT( IF ( t.soldier = 1, '军人,', '' ), IF ( |
| | | t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, '低收入,', '' ), IF ( t.old_people = 1, |
| | | t.low_income_households = 1, '低保户,', '' ), IF ( t.low_income_people = 1, '低收入,', '' ), IF ( t.old_people = 1, |
| | | '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ) ) tags, t.create_at as createAt FROM sys_user_input t |
| | | LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id WHERE t.community_id = #{pageInputUserDTO.communityId} |
| | | <if |
| | |
| | | AS UNSIGNED ) % 2, IF ( length( t.id_card ) = 15, cast( substring( t.id_card, 15, 1 ) AS UNSIGNED ) % 2, 3 ) ) |
| | | WHEN 1 THEN 1 WHEN 0 THEN 2 ELSE 0 END AS sex, t.phone, YEAR ( now( ) ) - YEAR ( substring( t.id_card, 7, 8 ) ) |
| | | age, t1.area_name as areaName, t.political_outlook politicalOutlook, CONCAT( IF ( t.soldier = 1, '军人,', '' ), IF |
| | | ( t.lowIncome_households = 1, '低保户,', '' ), IF ( t.lowIncome_people = 1, '低收入,', '' ), IF ( t.old_people = 1, |
| | | ( t.low_income_households = 1, '低保户,', '' ), IF ( t.low_income_people = 1, '低收入,', '' ), IF ( t.old_people = 1, |
| | | '特服家庭,', '' ), IF ( t.key_personnel = 1, '重点人员,', '' ), IFNULL(t.tags,'') ) tags, t2.house_name as address, |
| | | t.create_at as createAt FROM sys_user_input t LEFT JOIN com_mng_struct_area t1 ON t.area_id = t1.id LEFT JOIN |
| | | com_mng_struct_house t2 ON t.house_code = t2.house_code WHERE t.community_id = #{pageInputUserDTO.communityId} |
| | | AND (t.soldier=1 OR t.lowIncome_households=1 OR t.lowIncome_people=1 or t.old_people=1 OR |
| | | AND (t.soldier=1 OR t.low_income_households=1 OR t.low_income_people=1 or t.old_people=1 OR |
| | | t.special_service_family=1 OR t.key_personnel=1 OR |
| | | (t.tags IS NOT NULL AND TRIM(t.tags)!='')) |
| | | <if test='pageInputUserDTO.name != null and pageInputUserDTO.name.trim() != ""'> |