package com.panzhihua.service_community.dao; import java.util.List; 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; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.grid.ComMngVillageListAppDTO; import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; import com.panzhihua.common.model.vos.community.ComMngVillageTotalVO; import com.panzhihua.common.model.vos.community.ComMngVillageVO; import com.panzhihua.common.model.vos.grid.ComMngVillageBuildingVO; import com.panzhihua.common.model.vos.grid.PageComMngVillageVO; import com.panzhihua.common.model.vos.grid.admin.ComMngVillageStatisticsVO; import com.panzhihua.common.model.vos.grid.admin.excel.ComMngVillageExportExcelVO; import com.panzhihua.service_community.model.dos.ComMngVillageDO; /** * @author: llming * @description: 街道 **/ @Mapper public interface ComActVillageDAO extends BaseMapper { @Select("select count(id) as houseTotal" + ",(select count(DISTINCT floor) from com_mng_population_house where village_id = #{villageId}) as floorTotal" + ",(select count(id) from com_mng_population where road = (select alley from com_mng_village where village_id = #{villageId})" + " and door_no = (select house_num from com_mng_village where village_id = #{villageId})) as populationTotal" + ",(select count(id) from com_mng_car where area_id = #{villageId}) as carTotal" + " from com_mng_population_house where village_id = #{villageId}") ComMngVillageVO getStatisticsCount(@Param("villageId") Long villageId); @Select("select count(distinct `name`) as villageTotal" + ",(select count(distinct `name`) from com_mng_village where community_id = ${communityId} and type = 1) as townTotal" + ",(select count(distinct `name`) from com_mng_village where community_id = ${communityId} and type = 2) as countrysideTotal" + " from com_mng_village where community_id = ${communityId}") ComMngVillageTotalVO getVillageStatisticsCount(@Param("communityId") Long communityId); @Select("select village_id,alley,house_num,group_at,type,address,update_at from com_mng_village where village_id = #{villageId}") ComMngVillageVO getVillageById(@Param("villageId") Long villageId); @Select("") IPage getGridVillageList(Page page, @Param("villageListAppDTO") ComMngVillageListAppDTO villageListAppDTO); IPage getGridVillageListApp(Page page, @Param("villageListAppDTO") ComMngVillageListAppDTO villageListAppDTO); @Select("") List getGridVillageLists(@Param("villageListAppDTO") ComMngVillageListExportAdminDTO villageListAppDTO); @Select("SELECT DISTINCT " + " village_id," + " floor, " + " unit_no " + "FROM " + " com_mng_population_house AS cmph " + "WHERE " + " village_id = #{villageId}") List getGridVillageBuildingList(@Param("villageId") Long villageId); @Select("") Integer getVillageHouseCount(@Param("villageIds") List villageIds); @Select("SELECT " + " count( village_id ) AS villageNum, " + " ( SELECT count( village_id ) FROM ( SELECT DISTINCT village_id, floor FROM com_mng_population_house ) AS floor ) AS floorNum, " + " ( SELECT count( id ) FROM com_mng_population_house ) AS houseNum, " + " ( SELECT count( id ) FROM com_mng_population ) AS userNum " + "FROM " + " com_mng_village") ComMngVillageStatisticsVO getGridVillageStatistics(); }