榆山
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.8 KiB

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.vaccine.house.dao.HouseResidentDao">
<resultMap type="com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity" id="houseResidentMap">
<result property="id" column="ID"/>
<result property="houseId" column="HOUSE_ID"/>
<result property="residentId" column="RESIDENT_ID"/>
<result property="houseHeadRelation" column="HOUSE_HEAD_RELATION"/>
<result property="isHouseHead" column="IS_HOUSE_HEAD"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListOfPopulationInformationDTO"
resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select
t1.ID,
t.RESIDENTS_NAME,
t.RESIDENTS_SEX,
t.RESIDENTS_NATION,
t.RESIDENTS_BIRTHDAY,
t.EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.RESIDENTS_IDENTITY_NO,
t.RESIDENTS_PHONE,
t.CURRENT_EMPLOYER,
t.CURRENT_ADDRESS,
t1.HOUSE_HEAD_RELATION,
t1.HOUSE_HEAD_ID
from epdc_population_information t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.HOUSE_HEAD_ID = #{houseHeadId}
order by t1.CREATED_TIME desc
</select>
<select id="selectByHouseResidentId" resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">
select
t1.ID,
t.RESIDENTS_NAME,
t.RESIDENTS_SEX,
t.RESIDENTS_NATION,
t.RESIDENTS_BIRTHDAY,
t.EDUCATION_LEVEL,
t.POLITICS_STATUS,
t.RESIDENTS_IDENTITY_NO,
t.RESIDENTS_PHONE,
t.CURRENT_EMPLOYER,
t.CURRENT_ADDRESS,
t1.HOUSE_HEAD_RELATION,
t.ID as residentId,
t1.HOUSE_HEAD_ID
from epdc_population_information t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.ID = #{id}
</select>
<select id="getHouseResidentInfoByResidentId"
resultType="com.elink.esua.epdc.vaccine.house.entity.HouseResidentEntity">
select * from epdc_house_resident where RESIDENT_ID = #{residentId} and DEL_FLAG ='0'
and IS_HOUSE_HEAD = '0' limit 1
</select>
</mapper>