| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseAdminDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageComMngVillageBuildHouseAppDTO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseDetailVO; |
| | | import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingHouseVO; |
| | | import com.panzhihua.common.model.vos.grid.PopulationListVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngSubordinateVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngHouseVo; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | " from com_act as ca where ca.community_id = #{communityId}") |
| | | ComMngVillageRegionVO getRegion(@Param("communityId") Long communityId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT id, floor, unit_no, house_no, `status`,( SELECT count( id ) FROM com_mng_population_house_user WHERE house_id = cmph.id ) AS userNum " + |
| | | " FROM " + |
| | | " com_mng_population_house AS cmph " + |
| | | " <where> " + |
| | | "<if test='buildHouseAppDTO.villageId != null '>" + |
| | | " and cmph.village_id = #{buildHouseAppDTO.villageId} " + |
| | | " </if> " + |
| | | "<if test='buildHouseAppDTO.floor != null and buildHouseAppDTO.floor !="" '>" + |
| | | " and cmph.floor = #{buildHouseAppDTO.floor} " + |
| | | " </if> " + |
| | | "<if test='buildHouseAppDTO.unitNo != null and buildHouseAppDTO.unitNo !="" '>" + |
| | | " and cmph.unit_no = #{buildHouseAppDTO.unitNo} " + |
| | | " </if> " + |
| | | "<if test='buildHouseAppDTO.houseNo != null and buildHouseAppDTO.houseNo !="" '>" + |
| | | " and cmph.house_no like concat(#{buildHouseAppDTO.houseNo},'%') " + |
| | | " </if> " + |
| | | " </where>" + |
| | | " </script>") |
| | | IPage<ComMngVillageBuildingHouseVO> getGridVillageBuildingHouseList(Page page, @Param("buildHouseAppDTO") PageComMngVillageBuildHouseAppDTO buildHouseAppDTO); |
| | | |
| | | @Select("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}") |
| | | ComMngVillageBuildingHouseDetailVO getGridVillageBuildingHouseDetail(@Param("houseId") Long houseId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | " cmp.id, " + |
| | | " cmphu.id as housePopulationId, " + |
| | | " cmp.sex, " + |
| | | " cmp.`name`, " + |
| | | " IFNULL( cmp.phone, '暂无' ) as phone, " + |
| | | " cmp.card_no, " + |
| | | " cmp.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 " + |
| | | "WHERE " + |
| | | " cmphu.house_id = #{houseId} " + |
| | | "<if test='relation != null '>" + |
| | | " AND cmphu.relation = #{relation} " + |
| | | " </if> " + |
| | | "<if test='relationId != null '>" + |
| | | " AND cmphu.relation_id = #{relationId} " + |
| | | " </if> " + |
| | | " </script>") |
| | | List<PopulationListVO> getGridVillageBuildingPopulationList(@Param("houseId") Long houseId,@Param("relation") Integer relation,@Param("relationId") Integer relationId); |
| | | |
| | | @Select("select id as houseId,floor from com_mng_population_house where village_id = #{villageId} order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByFloors(@Param("villageId") Long villageId); |
| | | |
| | | @Select("select id as houseId,unit_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByUnitNos(@Param("villageId") Long villageId,@Param("floor") String floor); |
| | | |
| | | @Select("select id as houseId,house_no from com_mng_population_house where village_id = #{villageId} and floor = #{floor} and unit_no = #{unitNo} order by create_at asc") |
| | | List<ComMngSubordinateVO> getHouseLevelByHouseNos(@Param("villageId") Long villageId,@Param("floor") String floor,@Param("unitNo") String unitNo); |
| | | } |