CeDo
2021-06-15 3b855b9c20751a5fee840e686988e8e094773a54
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationHouseUserDAO.java
@@ -1,8 +1,13 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.common.model.vos.community.ComMngPopulationHouseUserAdminVO;
import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
 * @auther lyq
@@ -12,4 +17,17 @@
@Mapper
public interface ComMngPopulationHouseUserDAO extends BaseMapper<ComMngPopulationHouseUserDO> {
    @Select("delete from com_mng_population_house_user where popul_id = #{populationId}")
    void deletePopulationHouseByUserId(@Param("populationId") Long populationId);
    @Select("select house_id from com_mng_population_house_user where popul_id = #{populationId}")
    List<Long> getPopulationHouseIdByUserId(@Param("populationId") Long populationId);
    @Select("select popul_id from com_mng_population_house_user where house_id = #{houseId}")
    List<Long> getPopulationHouseIdByhHosueId(@Param("houseId") Long houseId);
    @Select("select cmp.id,cmp.name,cmp.card_no,cmp.phone 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}")
    List<ComMngPopulationHouseUserAdminVO> getHouseUserByHouseId(@Param("houseId") Long houseId);
}