|
|
@ -20,8 +20,7 @@ |
|
|
|
<update id="updateByIdCard"> |
|
|
|
UPDATE epidemic_user_info |
|
|
|
set DEL_FLAG = '1' |
|
|
|
WHERE |
|
|
|
ID_CARD = #{idCard} |
|
|
|
WHERE ID_CARD = #{idCard} |
|
|
|
</update> |
|
|
|
<update id="updateVaccinationInfo"> |
|
|
|
UPDATE epidemic_user_info |
|
|
@ -30,7 +29,7 @@ |
|
|
|
,VACCINATION_STATE = #{vaccinationState} |
|
|
|
</if> |
|
|
|
WHERE |
|
|
|
ID_CARD = #{idCard} |
|
|
|
ID_CARD = #{idCard} |
|
|
|
</update> |
|
|
|
<select id="getEpidemicUserRecordList" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordListDTO"> |
|
|
|
select |
|
|
@ -148,90 +147,86 @@ |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
<select id="getDetailById" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicRecordDetailDTO"> |
|
|
|
SELECT |
|
|
|
ui.USER_NAME, |
|
|
|
ui.ID_CARD, |
|
|
|
ui.HOUSEHOLD_REGISTER_CODE, |
|
|
|
ui.HOUSEHOLD_REGISTER_NAME, |
|
|
|
ui.HOUSEHOLD_REGISTER_DETAIL, |
|
|
|
SELECT ui.USER_NAME, |
|
|
|
ui.ID_CARD, |
|
|
|
ui.HOUSEHOLD_REGISTER_CODE, |
|
|
|
ui.HOUSEHOLD_REGISTER_NAME, |
|
|
|
ui.HOUSEHOLD_REGISTER_DETAIL, |
|
|
|
|
|
|
|
uir.ID, |
|
|
|
uir.MOBILE, |
|
|
|
CASE uir.RETURN_STATE |
|
|
|
WHEN '1' THEN '1' |
|
|
|
WHEN '2' THEN '2' |
|
|
|
ELSE '' |
|
|
|
END AS RETURN_STATE, |
|
|
|
uir.LIVE_ADDRESS_CODE, |
|
|
|
uir.LIVE_ADDRESS_NAME, |
|
|
|
uir.LIVE_ADDRESS_DETAIL, |
|
|
|
uir.ID, |
|
|
|
uir.MOBILE, |
|
|
|
CASE uir.RETURN_STATE |
|
|
|
WHEN '1' THEN '1' |
|
|
|
WHEN '2' THEN '2' |
|
|
|
ELSE '' |
|
|
|
END AS RETURN_STATE, |
|
|
|
uir.LIVE_ADDRESS_CODE, |
|
|
|
uir.LIVE_ADDRESS_NAME, |
|
|
|
uir.LIVE_ADDRESS_DETAIL, |
|
|
|
|
|
|
|
uir.RELATION_PEOPLE, |
|
|
|
uir.RELATION_PEOPLE_MOBILE, |
|
|
|
uir.OUT_LIVE_ADDRESS_CODE, |
|
|
|
uir.OUT_LIVE_ADDRESS_NAME, |
|
|
|
uir.OUT_LIVE_ADDRESS_DETAIL, |
|
|
|
CASE uir.RISK_GRADE |
|
|
|
WHEN '1' THEN '1' |
|
|
|
WHEN '2' THEN '2' |
|
|
|
WHEN '3' THEN '3' |
|
|
|
ELSE '' |
|
|
|
end as RISK_GRADE, |
|
|
|
DATE_FORMAT(GO_BARK_TIME,'%Y-%m-%d %H:%i:%s') as GO_BARK_TIME, |
|
|
|
uir.RELATION_PEOPLE, |
|
|
|
uir.RELATION_PEOPLE_MOBILE, |
|
|
|
uir.OUT_LIVE_ADDRESS_CODE, |
|
|
|
uir.OUT_LIVE_ADDRESS_NAME, |
|
|
|
uir.OUT_LIVE_ADDRESS_DETAIL, |
|
|
|
CASE uir.RISK_GRADE |
|
|
|
WHEN '1' THEN '1' |
|
|
|
WHEN '2' THEN '2' |
|
|
|
WHEN '3' THEN '3' |
|
|
|
ELSE '' |
|
|
|
end as RISK_GRADE, |
|
|
|
DATE_FORMAT(GO_BARK_TIME, '%Y-%m-%d %H:%i:%s') as GO_BARK_TIME, |
|
|
|
|
|
|
|
DATE_FORMAT(LEAVE_TIME,'%Y-%m-%d %H:%i:%s') as LEAVE_TIME, |
|
|
|
uir.DESTINATION_ADDRESS_CODE, |
|
|
|
uir.DESTINATION_ADDRESS_NAME, |
|
|
|
uir.DESTINATION_ADDRESS_DETAIL, |
|
|
|
DATE_FORMAT(LEAVE_TIME, '%Y-%m-%d %H:%i:%s') as LEAVE_TIME, |
|
|
|
uir.DESTINATION_ADDRESS_CODE, |
|
|
|
uir.DESTINATION_ADDRESS_NAME, |
|
|
|
uir.DESTINATION_ADDRESS_DETAIL, |
|
|
|
|
|
|
|
ui.GENDER, |
|
|
|
ui.NATION, |
|
|
|
ui.FORMER_NAME, |
|
|
|
ui.BIRTHDAY, |
|
|
|
ui.HEIGHT, |
|
|
|
ui.STANDARD_OF_CULTURE, |
|
|
|
ui.HEALTH, |
|
|
|
ui.MARITAL_STATUS, |
|
|
|
ui.RELATION, |
|
|
|
ui.NATIONALITY, |
|
|
|
ui.POLITICS_STATUS, |
|
|
|
ui.FAITH, |
|
|
|
ui.GRADUATE_SCHOOL, |
|
|
|
ui.PROFESSIONAL, |
|
|
|
ui.WORK_STATUS, |
|
|
|
ui.INDUSTRY_CATEGORY, |
|
|
|
ui.WORK_UNITS, |
|
|
|
ui.MILITARY, |
|
|
|
ui.PEOPLE_CATEGORIES, |
|
|
|
ui.SPECIAL_CROWD, |
|
|
|
ui.CAR, |
|
|
|
ui.CAR_NO, |
|
|
|
ui.HUSHAI_STATUS, |
|
|
|
ui.NATIVE_PLACE, |
|
|
|
ui.BLOOD_TYPE, |
|
|
|
ui.GENDER, |
|
|
|
ui.NATION, |
|
|
|
ui.FORMER_NAME, |
|
|
|
ui.BIRTHDAY, |
|
|
|
ui.HEIGHT, |
|
|
|
ui.STANDARD_OF_CULTURE, |
|
|
|
ui.HEALTH, |
|
|
|
ui.MARITAL_STATUS, |
|
|
|
ui.RELATION, |
|
|
|
ui.NATIONALITY, |
|
|
|
ui.POLITICS_STATUS, |
|
|
|
ui.FAITH, |
|
|
|
ui.GRADUATE_SCHOOL, |
|
|
|
ui.PROFESSIONAL, |
|
|
|
ui.WORK_STATUS, |
|
|
|
ui.INDUSTRY_CATEGORY, |
|
|
|
ui.WORK_UNITS, |
|
|
|
ui.MILITARY, |
|
|
|
ui.PEOPLE_CATEGORIES, |
|
|
|
ui.SPECIAL_CROWD, |
|
|
|
ui.CAR, |
|
|
|
ui.CAR_NO, |
|
|
|
ui.HUSHAI_STATUS, |
|
|
|
ui.NATIVE_PLACE, |
|
|
|
ui.BLOOD_TYPE, |
|
|
|
|
|
|
|
uir.COMMUNITY, |
|
|
|
uir.GRID_NAME, |
|
|
|
uir.PLOT, |
|
|
|
uir.BUILDING_NO, |
|
|
|
uir.UNIT, |
|
|
|
uir.ROOM_NO, |
|
|
|
uir.HOUSE_PROPERTY, |
|
|
|
uir.FAMILY_SECURITY, |
|
|
|
uir.LIVING_SITUATION |
|
|
|
uir.COMMUNITY, |
|
|
|
uir.GRID_NAME, |
|
|
|
uir.PLOT, |
|
|
|
uir.BUILDING_NO, |
|
|
|
uir.UNIT, |
|
|
|
uir.ROOM_NO, |
|
|
|
uir.HOUSE_PROPERTY, |
|
|
|
uir.FAMILY_SECURITY, |
|
|
|
uir.LIVING_SITUATION |
|
|
|
|
|
|
|
FROM `epidemic_user_inout_record` uir |
|
|
|
left join epidemic_user_info ui on ui.ID_CARD=uir.ID_CARD and ui.DEL_FLAG='0' |
|
|
|
where uir.ID=#{detailId,jdbcType=BIGINT} |
|
|
|
FROM `epidemic_user_inout_record` uir |
|
|
|
left join epidemic_user_info ui on ui.ID_CARD = uir.ID_CARD and ui.DEL_FLAG = '0' |
|
|
|
where uir.ID = #{detailId,jdbcType=BIGINT} |
|
|
|
</select> |
|
|
|
<select id="selectByIdCard" resultMap="epidemicUserInfoMap"> |
|
|
|
SELECT |
|
|
|
* |
|
|
|
FROM |
|
|
|
epidemic_user_info |
|
|
|
WHERE |
|
|
|
DEL_FLAG = 0 |
|
|
|
AND ID_CARD = ( SELECT ID_CARD FROM epidemic_user_inout_record WHERE DEL_FLAG = 0 AND ID = #{id} ) |
|
|
|
SELECT * |
|
|
|
FROM epidemic_user_info |
|
|
|
WHERE DEL_FLAG = 0 |
|
|
|
AND ID_CARD = (SELECT ID_CARD FROM epidemic_user_inout_record WHERE DEL_FLAG = 0 AND ID = #{id}) |
|
|
|
</select> |
|
|
|
<select id="selectByIdCards" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoDTO"> |
|
|
|
SELECT |
|
|
@ -252,6 +247,193 @@ |
|
|
|
#{idCard} |
|
|
|
</foreach> |
|
|
|
</select> |
|
|
|
<select id="selectInfo" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO"> |
|
|
|
select r.id AS inoutId, |
|
|
|
'平阴县' AS county, |
|
|
|
'榆山街道' AS street, |
|
|
|
'370124001' AS streetId, |
|
|
|
i.GENDER sex, |
|
|
|
r.COMMUNITY community, |
|
|
|
r.GRID_NAME grid, |
|
|
|
r.PLOT villageName, |
|
|
|
CONCAT( |
|
|
|
r.BUILDING_NO, |
|
|
|
r.UNIT, |
|
|
|
'单元', |
|
|
|
r.ROOM_NO |
|
|
|
) dwellingPlace, |
|
|
|
i.USER_NAME realName, |
|
|
|
i.ID_CARD identityNo, |
|
|
|
r.MOBILE mobile, |
|
|
|
i.GENDER, |
|
|
|
i.BIRTHDAY, |
|
|
|
r.CREATED_TIME, |
|
|
|
i.PEOPLE_CATEGORIES, |
|
|
|
i.SPECIAL_CROWD, |
|
|
|
i.HUSHAI_STATUS, |
|
|
|
i.VACCINATION_STATE |
|
|
|
from epidemic_user_info i |
|
|
|
left join (select * |
|
|
|
from epidemic_user_inout_record as b |
|
|
|
where DEL_FLAG = '0' |
|
|
|
and not exists(select 1 |
|
|
|
from epidemic_user_inout_record |
|
|
|
where ID_CARD = b.ID_CARD |
|
|
|
and b.CREATED_TIME < CREATED_TIME)) r on r.ID_CARD = i.ID_CARD |
|
|
|
where i.DEL_FLAG = '0' |
|
|
|
and i.id = #{id} |
|
|
|
</select> |
|
|
|
<select id="selectDistinctInfo" |
|
|
|
resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO"> |
|
|
|
SELECT IFNULL( |
|
|
|
COUNT(DISTINCT vi.COMPANY_ID), |
|
|
|
0 |
|
|
|
) AS distinctNum, |
|
|
|
vi.COMPANY_ID, |
|
|
|
IFNULL(COUNT(0), 0) AS vaccinationNum, |
|
|
|
ui.ID |
|
|
|
FROM epidemic_user_info ui |
|
|
|
LEFT JOIN vaccination_info vi ON ui.ID_CARD = vi.IDENTITY_NO |
|
|
|
WHERE ui.DEL_FLAG = '0' |
|
|
|
AND vi.DEL_FLAG = '0' |
|
|
|
AND ui.id = #{id} |
|
|
|
</select> |
|
|
|
<select id="checkCompleteInfo" resultType="com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity"> |
|
|
|
SELECT |
|
|
|
ID,VACCINATION_NUM |
|
|
|
FROM |
|
|
|
epidemic_user_info |
|
|
|
WHERE |
|
|
|
DEL_FLAG = '0' |
|
|
|
<if test="vaccinationState!=null and vaccinationState!=''"> |
|
|
|
AND VACCINATION_STATE = '2' |
|
|
|
</if> |
|
|
|
AND ID_CARD = #{idCard} |
|
|
|
LIMIT 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectAllUserInfo" resultType="com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity"> |
|
|
|
SELECT |
|
|
|
ui.id, |
|
|
|
ui.ID_CARD, |
|
|
|
ui.VACCINATION_STATE, |
|
|
|
ui.VACCINATION_NUM |
|
|
|
FROM |
|
|
|
epidemic_user_info ui |
|
|
|
WHERE |
|
|
|
ui.DEL_FLAG = '0' |
|
|
|
<if test="vaccinationState!=null and vaccinationState!=''"> |
|
|
|
AND ui.VACCINATION_STATE != '2' |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="updateUserAge"> |
|
|
|
UPDATE epidemic_user_info |
|
|
|
SET age = IFNULL( |
|
|
|
( |
|
|
|
YEAR (now()) - IFNULL(substring (ID_CARD, 7, 4), 0) |
|
|
|
), |
|
|
|
0 |
|
|
|
) |
|
|
|
WHERE DEL_FLAG = '0' |
|
|
|
AND ID_CARD IS NOT NULL |
|
|
|
AND REVISION = '0' |
|
|
|
AND LENGTH(ID_CARD) = 18 |
|
|
|
</update> |
|
|
|
<select id="selectInfoByIdCard" resultMap="epidemicUserInfoMap"> |
|
|
|
select * |
|
|
|
from epidemic_user_info |
|
|
|
where ID_CARD = #{idCard} |
|
|
|
and del_flag = '0' |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getEpidemicPageV2" |
|
|
|
resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultV2DTO"> |
|
|
|
select |
|
|
|
t.ID, |
|
|
|
t.RESIDENTS_NAME, |
|
|
|
t.RESIDENTS_SEX, |
|
|
|
t.RESIDENTS_PHONE, |
|
|
|
t.RESIDENTS_IDENTITY_NO, |
|
|
|
t.RESIDENTS_NATION, |
|
|
|
t.HOUSEHOLD_REGISTRATION_PLACE, |
|
|
|
t.RESIDENTS_BIRTHDAY, |
|
|
|
t.HELP_STATUS, |
|
|
|
t.FAMILY_CATEGORY, |
|
|
|
t.VACCINATION_NUM, |
|
|
|
t.VACCINATION_STATE, |
|
|
|
group_concat(DISTINCT substring_index(t2.ALL_DEPT_NAMES,'-',-1)) as grid_name, |
|
|
|
group_concat(t2.HOUSE_ADDRESS) as HOUSE_ADDRESS |
|
|
|
from epdc_population_information t |
|
|
|
left join |
|
|
|
( |
|
|
|
select |
|
|
|
* |
|
|
|
from |
|
|
|
epdc_house_resident |
|
|
|
where |
|
|
|
DEL_FLAG = '0') |
|
|
|
t1 on |
|
|
|
t.ID = t1.RESIDENT_ID |
|
|
|
left join |
|
|
|
( |
|
|
|
select |
|
|
|
* |
|
|
|
from |
|
|
|
epdc_housing_information |
|
|
|
where |
|
|
|
DEL_FLAG = '0') t2 |
|
|
|
on |
|
|
|
t1.HOUSE_ID = t2.ID |
|
|
|
where t.DEL_FLAG ='0' and t.RESIDENTS_IDENTITY_NO is not null and t.RESIDENTS_IDENTITY_NO != '' |
|
|
|
<if test="streetId != '' and streetId != null"> |
|
|
|
AND (find_in_set(#{streetId},t2.PARENT_DEPT_IDS) |
|
|
|
OR find_in_set(#{streetId},t2.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="communityId != '' and communityId != null"> |
|
|
|
AND (find_in_set(#{communityId},t2.PARENT_DEPT_IDS) |
|
|
|
OR find_in_set(#{communityId},t2.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="gridId != '' and gridId != null"> |
|
|
|
and (t2.grid_id = #{gridId} |
|
|
|
OR find_in_set(#{gridId},t2.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="residentsName != '' and residentsName != null">and t.RESIDENTS_NAME like |
|
|
|
concat('%',#{residentsName},'%') |
|
|
|
</if> |
|
|
|
<if test="residentsPhone != '' and residentsPhone != null">and t.RESIDENTS_PHONE like |
|
|
|
concat('%',#{residentsPhone},'%') |
|
|
|
</if> |
|
|
|
<if test="residentsIdentityNo != '' and residentsIdentityNo != null">and t.RESIDENTS_IDENTITY_NO like |
|
|
|
concat('%',#{residentsIdentityNo},'%') |
|
|
|
</if> |
|
|
|
<if test="familyCategory != '' and familyCategory != null">and FAMILY_CATEGORY = #{familyCategory}</if> |
|
|
|
<if test="helpStatus != '' and helpStatus != null">and HELP_STATUS = #{helpStatus}</if> |
|
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 0"> |
|
|
|
and t.VACCINATION_STATE = 0 |
|
|
|
</if> |
|
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 1"> |
|
|
|
and t.VACCINATION_NUM = 1 |
|
|
|
</if> |
|
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 2"> |
|
|
|
and t.VACCINATION_NUM = 2 |
|
|
|
</if> |
|
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 3"> |
|
|
|
and t.VACCINATION_NUM = 3 |
|
|
|
</if> |
|
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 10"> |
|
|
|
and t.VACCINATION_STATE = 1 |
|
|
|
</if> |
|
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 11"> |
|
|
|
and t.VACCINATION_STATE = 2 |
|
|
|
</if> |
|
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 12"> |
|
|
|
and t.VACCINATION_STATE IN ('1', '2') |
|
|
|
</if> |
|
|
|
group by t.ID |
|
|
|
order by t.CREATED_TIME desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getEpidemicPage" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO"> |
|
|
|
select i.id as infoId, |
|
|
|
r.id as inoutId, |
|
|
@ -306,104 +488,42 @@ |
|
|
|
GROUP BY i.ID |
|
|
|
ORDER BY i.CREATED_TIME DESC |
|
|
|
</select> |
|
|
|
<select id="selectInfo" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO"> |
|
|
|
select |
|
|
|
r.id AS inoutId, |
|
|
|
'平阴县' AS county, |
|
|
|
'榆山街道' AS street, |
|
|
|
'370124001' AS streetId, |
|
|
|
i.GENDER sex, |
|
|
|
r.COMMUNITY community, |
|
|
|
r.GRID_NAME grid, |
|
|
|
r.PLOT villageName, |
|
|
|
CONCAT( |
|
|
|
r.BUILDING_NO, |
|
|
|
r.UNIT, |
|
|
|
'单元', |
|
|
|
r.ROOM_NO |
|
|
|
) dwellingPlace, |
|
|
|
i.USER_NAME realName, |
|
|
|
i.ID_CARD identityNo, |
|
|
|
r.MOBILE mobile, |
|
|
|
i.GENDER, |
|
|
|
i.BIRTHDAY, |
|
|
|
r.CREATED_TIME, |
|
|
|
i.PEOPLE_CATEGORIES, |
|
|
|
i.SPECIAL_CROWD, |
|
|
|
i.HUSHAI_STATUS, |
|
|
|
i.VACCINATION_STATE |
|
|
|
from epidemic_user_info i |
|
|
|
left join (select * |
|
|
|
from epidemic_user_inout_record as b |
|
|
|
where DEL_FLAG='0' |
|
|
|
and not exists(select 1 from epidemic_user_inout_record where ID_CARD= b.ID_CARD |
|
|
|
and b.CREATED_TIME < CREATED_TIME ))r on r.ID_CARD=i.ID_CARD |
|
|
|
where i.DEL_FLAG='0'and i.id = #{id} |
|
|
|
</select> |
|
|
|
<select id="selectDistinctInfo" resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO"> |
|
|
|
SELECT |
|
|
|
IFNULL( |
|
|
|
COUNT(DISTINCT vi.COMPANY_ID), |
|
|
|
0 |
|
|
|
) AS distinctNum, |
|
|
|
vi.COMPANY_ID, |
|
|
|
IFNULL(COUNT(0), 0) AS vaccinationNum, |
|
|
|
ui.ID |
|
|
|
FROM |
|
|
|
epidemic_user_info ui |
|
|
|
LEFT JOIN vaccination_info vi ON ui.ID_CARD = vi.IDENTITY_NO |
|
|
|
WHERE |
|
|
|
ui.DEL_FLAG = '0' |
|
|
|
AND vi.DEL_FLAG = '0' |
|
|
|
AND ui.id = #{id} |
|
|
|
</select> |
|
|
|
<select id="checkCompleteInfo" resultType="com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity"> |
|
|
|
SELECT |
|
|
|
ID,VACCINATION_NUM |
|
|
|
FROM |
|
|
|
epidemic_user_info |
|
|
|
WHERE |
|
|
|
DEL_FLAG = '0' |
|
|
|
<if test="vaccinationState!=null and vaccinationState!=''"> |
|
|
|
AND VACCINATION_STATE = '2' |
|
|
|
</if> |
|
|
|
AND ID_CARD = #{idCard} |
|
|
|
LIMIT 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectAllUserInfo" resultType="com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity"> |
|
|
|
SELECT |
|
|
|
ui.id, |
|
|
|
ui.ID_CARD, |
|
|
|
ui.VACCINATION_STATE, |
|
|
|
ui.VACCINATION_NUM |
|
|
|
FROM |
|
|
|
epidemic_user_info ui |
|
|
|
WHERE |
|
|
|
ui.DEL_FLAG = '0' |
|
|
|
<if test="vaccinationState!=null and vaccinationState!=''"> |
|
|
|
AND ui.VACCINATION_STATE != '2' |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="updateUserAge"> |
|
|
|
UPDATE epidemic_user_info |
|
|
|
SET age = IFNULL( |
|
|
|
<select id="selectInfoV2" |
|
|
|
resultType="com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO"> |
|
|
|
select |
|
|
|
i.id, |
|
|
|
i.RESIDENTS_NAME, |
|
|
|
i.RESIDENTS_IDENTITY_NO, |
|
|
|
i.RESIDENTS_PHONE, |
|
|
|
i.RESIDENTS_SEX, |
|
|
|
i.RESIDENTS_BIRTHDAY, |
|
|
|
i.VACCINATION_NUM, |
|
|
|
i.VACCINATION_STATE, |
|
|
|
t.COMPANY_ID, |
|
|
|
t.SITE_ID, |
|
|
|
t.DOSE, |
|
|
|
t.BATCH_NO |
|
|
|
from |
|
|
|
epdc_population_information i |
|
|
|
left join |
|
|
|
( |
|
|
|
YEAR (now()) - IFNULL(substring(ID_CARD, 7, 4), 0) |
|
|
|
), |
|
|
|
0 |
|
|
|
) |
|
|
|
WHERE |
|
|
|
DEL_FLAG = '0' |
|
|
|
AND ID_CARD IS NOT NULL |
|
|
|
AND REVISION = '0' |
|
|
|
AND LENGTH(ID_CARD) = 18 |
|
|
|
</update> |
|
|
|
<select id="selectInfoByIdCard" resultMap="epidemicUserInfoMap"> |
|
|
|
select * from epidemic_user_info |
|
|
|
where ID_CARD=#{idCard} |
|
|
|
and del_flag='0' |
|
|
|
select |
|
|
|
id, |
|
|
|
MAX(DOSE) DOSE, |
|
|
|
COMPANY_ID, |
|
|
|
SITE_ID, |
|
|
|
BATCH_NO, |
|
|
|
IDENTITY_NO |
|
|
|
from |
|
|
|
vaccination_info |
|
|
|
group by |
|
|
|
IDENTITY_NO) |
|
|
|
|
|
|
|
t on |
|
|
|
i.RESIDENTS_IDENTITY_NO = t.IDENTITY_NO |
|
|
|
where |
|
|
|
i.DEL_FLAG = '0' |
|
|
|
and i.id = #{id} |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|