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.
111 lines
3.9 KiB
111 lines
3.9 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.epmet.dao.IcEpidemicSpecialAttentionDao">
|
|
|
|
<!-- 取消关注 -->
|
|
<update id="cancelAttention">
|
|
UPDATE ic_epidemic_special_attention
|
|
SET UPDATED_TIME = NOW(),
|
|
IS_ATTENTION = 0
|
|
WHERE del_flag = 0
|
|
AND attention_type = #{attentionType}
|
|
AND id_card IN (
|
|
<foreach collection="list" item="l" separator=",">
|
|
#{l}
|
|
</foreach>
|
|
)
|
|
</update>
|
|
|
|
<!-- 疫苗接种关注名单 -->
|
|
<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>
|
|
|
|
<!-- 查询已经存在的关注 -->
|
|
<select id="getExistList" resultType="java.lang.String">
|
|
SELECT
|
|
ID_CARD
|
|
FROM ic_epidemic_special_attention
|
|
WHERE DEL_FLAG = 0
|
|
AND ATTENTION_TYPE = #{attentionType}
|
|
AND ID_CARD IN (
|
|
<foreach collection="list" item="l" separator=",">
|
|
#{l}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
|
|
<select id="getIdCardList" parameterType="map" resultType="java.lang.String">
|
|
SELECT
|
|
DISTINCT
|
|
ID_CARD
|
|
FROM
|
|
ic_epidemic_special_attention
|
|
WHERE
|
|
DEL_FLAG = 0
|
|
AND IS_ATTENTION = '1'
|
|
AND ATTENTION_TYPE = #{attentionType}
|
|
AND CUSTOMER_ID=#{customerId}
|
|
AND ID_CARD IN (
|
|
<foreach collection="idCardSet" item="idCard" separator=",">
|
|
#{idCard}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
</mapper>
|