package com.panzhihua.service_community.dao;
|
|
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.community.ComMngPopulationDTO;
|
import com.panzhihua.common.model.vos.community.ComActMessageVO;
|
import com.panzhihua.common.model.vos.community.ComMngPopulationVO;
|
import com.panzhihua.common.model.vos.community.PageComActMessageVO;
|
import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
|
import com.panzhihua.service_community.model.dos.ComMngPopulationDO;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
import java.util.List;
|
|
/**
|
* 实有人口Dao
|
*/
|
@Mapper
|
public interface ComMngPopulationDAO extends BaseMapper<ComMngPopulationDO> {
|
|
@Select("<script> " +
|
"SELECT\n" +
|
"cmp.`name`,\n" +
|
"cmp.id,\n" +
|
"cmp.street_id,\n" +
|
"cmp.act_id,\n" +
|
"cmp.village_id,\n" +
|
"cmp.sex,\n" +
|
"cmp.age,\n" +
|
"cmp.card_no,\n" +
|
"cmp.road,\n" +
|
"cmp.door_no,\n" +
|
"cmp.floor,\n" +
|
"cmp.unit_no,\n" +
|
"cmp.house_no,\n" +
|
"cmp.political_outlook,\n" +
|
"cmp.work_company,\n" +
|
"cmp.special_situation,\n" +
|
"cmp.phone,\n" +
|
"cmp.remark,\n" +
|
"cmv.alley,\n" +
|
"cmp.native_place,\n" +
|
"cmp.nation \n" +
|
"FROM \n" +
|
"com_mng_population AS cmp " +
|
"LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " +
|
"<where>" +
|
"<if test='comMngPopulationVO.name != null and comMngPopulationVO.name.trim() != ""'>" +
|
"AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.road != null and comMngPopulationVO.road.trim() != ""'>" +
|
"AND cmp.road LIKE concat(#{comMngPopulationVO.road},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo.trim() != ""'>" +
|
"AND cmp.door_no = #{comMngPopulationVO.doorNo} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.alley != null and comMngPopulationVO.alley.trim() != ""'>" +
|
"AND cmv.alley LIKE concat(#{comMngPopulationVO.alley},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex.trim() != ""'>" +
|
"AND cmp.sex = #{comMngPopulationVO.sex} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.ageStart != null'>" +
|
"AND cmp.age <![CDATA[ >= ]]> #{comMngPopulationVO.ageStart} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.ageEnd != null'>" +
|
"AND cmp.age <![CDATA[ <= ]]> #{comMngPopulationVO.ageEnd} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace.trim() != ""'>" +
|
"AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.nation != null and comMngPopulationVO.nation.trim() != ""'>" +
|
"AND cmp.nation = #{comMngPopulationVO.nation} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.politicalOutlook != null and comMngPopulationVO.politicalOutlook.trim() != ""'>" +
|
"AND cmp.political_outlook = #{comMngPopulationVO.politicalOutlook} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.cardNo != null and comMngPopulationVO.cardNo.trim() != ""'>" +
|
"AND cmp.card_no = #{comMngPopulationVO.cardNo} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.remark != null and comMngPopulationVO.remark.trim() != ""'>" +
|
"AND cmp.remark = #{comMngPopulationVO.remark} " +
|
" </if> " +
|
" </where>" +
|
"</script>")
|
List<ComMngPopulationVO> listPopulation(ComMngPopulationDTO populationVO);
|
|
|
@Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at from com_mng_family_info where user_id=#{userId}")
|
List<ComMngFamilyInfoVO> listFamilyByUserId(Long userId);
|
|
@Select("<script> " +
|
"SELECT\n" +
|
"cmp.`name`,\n" +
|
"cmp.id,\n" +
|
"cmp.street_id,\n" +
|
"cmp.act_id,\n" +
|
"cmp.village_id,\n" +
|
"cmp.sex,\n" +
|
"cmp.age,\n" +
|
"cmp.card_no,\n" +
|
"cmp.road,\n" +
|
"cmp.door_no,\n" +
|
"cmp.floor,\n" +
|
"cmp.unit_no,\n" +
|
"cmp.house_no,\n" +
|
"cmp.political_outlook,\n" +
|
"cmp.work_company,\n" +
|
"cmp.special_situation,\n" +
|
"cmp.phone,\n" +
|
"cmp.remark,\n" +
|
"cmv.alley,\n" +
|
"cmp.native_place,\n" +
|
"cmp.nation, \n" +
|
"cmp.label \n" +
|
"FROM \n" +
|
"com_mng_population AS cmp " +
|
"LEFT JOIN com_mng_village AS cmv ON cmv.village_id = cmp.village_id " +
|
"<where>" +
|
"<if test='comMngPopulationVO.name != null and comMngPopulationVO.name.trim() != ""'>" +
|
"AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.road != null and comMngPopulationVO.road.trim() != ""'>" +
|
"AND cmp.road LIKE concat(#{comMngPopulationVO.road},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo.trim() != ""'>" +
|
"AND cmp.door_no = #{comMngPopulationVO.doorNo} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.alley != null and comMngPopulationVO.alley.trim() != ""'>" +
|
"AND cmv.alley LIKE concat(#{comMngPopulationVO.alley},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex.trim() != ""'>" +
|
"AND cmp.sex = #{comMngPopulationVO.sex} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.ageStart != null'>" +
|
"AND cmp.age <![CDATA[ >= ]]> #{comMngPopulationVO.ageStart} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.ageEnd != null'>" +
|
"AND cmp.age <![CDATA[ <= ]]> #{comMngPopulationVO.ageEnd} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace.trim() != ""'>" +
|
"AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " +
|
" </if> " +
|
"<if test='comMngPopulationVO.nation != null and comMngPopulationVO.nation.trim() != ""'>" +
|
"AND cmp.nation = #{comMngPopulationVO.nation} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.politicalOutlook != null and comMngPopulationVO.politicalOutlook.trim() != ""'>" +
|
"AND cmp.political_outlook = #{comMngPopulationVO.politicalOutlook} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.cardNo != null and comMngPopulationVO.cardNo.trim() != ""'>" +
|
"AND cmp.card_no = #{comMngPopulationVO.cardNo} " +
|
" </if> " +
|
"<if test='comMngPopulationVO.remark != null and comMngPopulationVO.remark.trim() != ""'>" +
|
"AND cmp.remark = #{comMngPopulationVO.remark} " +
|
" </if> " +
|
" </where>" +
|
"</script>")
|
IPage<ComMngPopulationVO> pagePopulation(Page page, @Param("comMngPopulationVO") ComMngPopulationDTO comMngPopulationVO);
|
|
|
|
|
}
|