市北互联平台后端仓库
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.

67 lines
2.6 KiB

4 years ago
<?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.epmet.dao.IcEpidemicSpecialAttentionDao">
4 years ago
<!-- 疫苗接种关注名单 -->
<select id="vaccinationList" resultType="com.epmet.dto.result.VaccinationListResultDTO">
SELECT
a.`NAME`,
a.MOBILE,
a.ID_CARD,
a.REMARK,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime,
COUNT(v.ID) AS vaccinationCount
FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_vaccine v ON (v.ID_CARD = a.ID_CARD AND v.DEL_FLAG = '0')
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` = #{name}
</if>
<if test='null != mobile and "" != mobile'>
AND a.MOBILE = #{mobile}
</if>
<if test='null != mobile and "" != mobile'>
AND a.ID_CARD = #{idCard}
</if>
<if test=' null != vaccinationCount'>
HAVING vaccinationCount = #{vaccinationCount}
</if>
ORDER BY a.CREATED_TIME DESC
</select>
<!-- 核酸检测关注名单 -->
<select id="natList" resultType="com.epmet.dto.result.VaccinationListResultDTO">
SELECT
a.`NAME`,
a.MOBILE,
a.ID_CARD,
a.REMARK,
a.REASON,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime
FROM ic_epidemic_special_attention a
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` = #{name}
</if>
<if test='null != mobile and "" != mobile'>
AND a.MOBILE = #{mobile}
</if>
<if test='null != mobile and "" != mobile'>
AND a.ID_CARD = #{idCard}
</if>
<if test='null != reason and "" != reason'>
AND a.REASON LIKE CONCAT('%',#{reason},'%')
</if>
<if test='null != remark and "" != remark'>
AND a.REMARK LIKE CONCAT('%',#{remark},'%')
</if>
ORDER BY a.CREATED_TIME DESC
</select>
4 years ago
</mapper>