罗元桥
2021-05-25 b24f9c75c79e4de248505295bfea7055e4975ff4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
 * @create 2021-05-18 09:26:53
 * @describe 房屋居住信息关联表mapper类
 */
@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.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);
 
}