|
@ -55,7 +55,6 @@ |
|
|
DATE_FORMAT(uir.CREATED_TIME,'%Y-%m-%d %H:%i:%s') as CREATED_TIME |
|
|
DATE_FORMAT(uir.CREATED_TIME,'%Y-%m-%d %H:%i:%s') as CREATED_TIME |
|
|
from epidemic_user_info ui |
|
|
from epidemic_user_info ui |
|
|
left join epidemic_user_inout_record uir on ui.ID_CARD=uir.ID_CARD |
|
|
left join epidemic_user_inout_record uir on ui.ID_CARD=uir.ID_CARD |
|
|
LEFT JOIN vaccination_info vi ON ui.ID_CARD = vi.IDENTITY_NO AND vi.DEL_FLAG='0' |
|
|
|
|
|
where ui.DEL_FLAG='0' |
|
|
where ui.DEL_FLAG='0' |
|
|
and uir.DEL_FLAG='0' |
|
|
and uir.DEL_FLAG='0' |
|
|
<if test="deptIdList != null and deptIdList.size() > 0"> |
|
|
<if test="deptIdList != null and deptIdList.size() > 0"> |
|
@ -91,73 +90,11 @@ |
|
|
<if test="gridName != null and gridName != ''"> |
|
|
<if test="gridName != null and gridName != ''"> |
|
|
and uir.GRID_NAME like '%${gridName}%' |
|
|
and uir.GRID_NAME like '%${gridName}%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="age != null and age.size() > 0"> |
|
|
<if test="ageStart != null and ageStart != ''"> |
|
|
and |
|
|
and ui.AGE >= #{ageStart} |
|
|
<foreach collection="age" open="(" close=")" separator="or" item="ageItem"> |
|
|
|
|
|
<if test="ageItem == 0"> |
|
|
|
|
|
( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) |
|
|
|
|
|
) BETWEEN 0 |
|
|
|
|
|
AND 18 |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ageItem == 1"> |
|
|
|
|
|
( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) |
|
|
|
|
|
) BETWEEN 19 |
|
|
|
|
|
AND 19 |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ageItem == 2"> |
|
|
|
|
|
( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) |
|
|
|
|
|
) BETWEEN 20 |
|
|
|
|
|
AND 29 |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ageItem == 3"> |
|
|
|
|
|
( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) |
|
|
|
|
|
) BETWEEN 30 |
|
|
|
|
|
AND 39 |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ageItem == 4"> |
|
|
|
|
|
( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) |
|
|
|
|
|
) BETWEEN 40 |
|
|
|
|
|
AND 49 |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ageItem == 5"> |
|
|
|
|
|
( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) |
|
|
|
|
|
) BETWEEN 50 |
|
|
|
|
|
AND 59 |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ageItem == 6"> |
|
|
|
|
|
( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ui.ID_CARD, 7, 8)) |
|
|
|
|
|
) >= 60 |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
</if> |
|
|
<if test="company != null and company.size() > 0"> |
|
|
<if test="ageEnd != null and ageEnd != ''"> |
|
|
and |
|
|
and ui.AGE <= #{ageEnd} |
|
|
<foreach collection="company" open="(" close=")" separator="or" item="companyItem"> |
|
|
|
|
|
<if test="companyItem != null and companyItem != ''"> |
|
|
|
|
|
vi.COMPANY_ID = #{companyItem} |
|
|
|
|
|
</if> |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
</if> |
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 0"> |
|
|
<if test="isInoculate != null and isInoculate != '' and isInoculate == 0"> |
|
|
and ui.VACCINATION_NUM = 0 |
|
|
and ui.VACCINATION_NUM = 0 |
|
@ -400,4 +337,19 @@ |
|
|
WHERE |
|
|
WHERE |
|
|
ui.DEL_FLAG = '0' |
|
|
ui.DEL_FLAG = '0' |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<update id="updateUserAge"> |
|
|
|
|
|
UPDATE epidemic_user_info |
|
|
|
|
|
SET age = IFNULL( |
|
|
|
|
|
( |
|
|
|
|
|
YEAR (now()) - YEAR (substring(ID_CARD, 7, 8)) |
|
|
|
|
|
), |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
|
|
|
WHERE |
|
|
|
|
|
DEL_FLAG = '0' |
|
|
|
|
|
AND ID_CARD IS NOT NULL |
|
|
|
|
|
AND REVISION = 0 |
|
|
|
|
|
AND LENGTH(ID_CARD) = 18 |
|
|
|
|
|
</update> |
|
|
</mapper> |
|
|
</mapper> |