| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Insert; |
| | | 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.vos.community.ComMngPopulationHouseUserAdminVO; |
| | | import com.panzhihua.common.model.vos.grid.admin.ComMngVillagePopulationHouseListVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationHouseUserDO; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @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}") |
| | | @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); |
| | | |
| | | @Select("update com_mng_population_house_user set relation = null where id = #{id}") |
| | |
| | | @Select("update com_mng_population_house_user set relation_id = null where id = #{id}") |
| | | Integer delBuildingHousePopulationRelationId(@Param("id") Long id); |
| | | |
| | | @Select("SELECT " + |
| | | " cmv.`name` AS villageName, " + |
| | | " cmph.id, " + |
| | | " cmv.address, " + |
| | | " cmph.floor, " + |
| | | " cmph.unit_no, " + |
| | | " cmph.house_no " + |
| | | "FROM " + |
| | | " com_mng_population_house_user AS cmphu " + |
| | | " LEFT JOIN com_mng_population_house AS cmph ON cmph.id = cmphu.house_id " + |
| | | " LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmph.village_id " + |
| | | "WHERE " + |
| | | " cmphu.popul_id = #{villagePopulationDTO.populationId}") |
| | | IPage<ComMngVillagePopulationHouseListVO> getVillagePopulationHouseAdmin(Page page, @Param("villagePopulationDTO") PageComMngVillagePopulationHouseDTO villagePopulationDTO); |
| | | @Select("SELECT " + " cmv.`name` AS villageName, " + " cmph.id, " + " cmv.address, " + " cmph.floor, " |
| | | + " cmph.unit_no, " + " cmph.house_no " + "FROM " + " com_mng_population_house_user AS cmphu " |
| | | + " LEFT JOIN com_mng_population_house AS cmph ON cmph.id = cmphu.house_id " |
| | | + " LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmph.village_id " + "WHERE " |
| | | + " cmphu.popul_id = #{villagePopulationDTO.populationId}") |
| | | IPage<ComMngVillagePopulationHouseListVO> getVillagePopulationHouseAdmin(Page page, |
| | | @Param("villagePopulationDTO") PageComMngVillagePopulationHouseDTO villagePopulationDTO); |
| | | |
| | | @Insert("<script> " + |
| | | "insert into com_mng_population_house_user(`id`,`popul_id`,`house_id`,`relation_id`,`relation`" + |
| | | ",`residence`,`start_at`,`end_at`,`create_at`) values " + |
| | | "<foreach collection=\"houseUserList\" item=\"item\" index=\"index\" separator=\",\">\n" + |
| | | " (#{item.id},#{item.populId},#{item.houseId},#{item.relationId}" + |
| | | ",#{item.relation},#{item.residence},#{item.startAt},#{item.endAt}" + |
| | | ",now())" + |
| | | " </foreach>" + |
| | | " </script>") |
| | | @Insert("<script> " |
| | | + "insert into com_mng_population_house_user(`id`,`popul_id`,`house_id`,`relation_id`,`relation`" |
| | | + ",`residence`,`start_at`,`end_at`,`create_at`) values " |
| | | + "<foreach collection=\"houseUserList\" item=\"item\" index=\"index\" separator=\",\">\n" |
| | | + " (#{item.id},#{item.populId},#{item.houseId},#{item.relationId}" |
| | | + ",#{item.relation},#{item.residence},#{item.startAt},#{item.endAt}" + ",now())" + " </foreach>" |
| | | + " </script>") |
| | | void insertAll(@Param("houseUserList") List<ComMngPopulationHouseUserDO> houseUserList); |
| | | } |