zxc 3 years ago
parent
commit
f172f7dc60
  1. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
  2. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  3. 34
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

1
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java

@ -53,6 +53,7 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao<IcEpidemicSpecial
*/
void cancelAttention(@Param("list")List<String> list,@Param("attentionType")Integer attentionType);
void addAttention(@Param("list")List<String> list,@Param("attentionType")Integer attentionType);
void addExistAttention(@Param("list") List<IcEpidemicSpecialAttentionEntity> list,@Param("attentionType")Integer attentionType);
/**
* Desc: 查询已经存在的关注

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java

@ -283,17 +283,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
List<String> idCards = entities.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
Integer attentionType = entities.get(NumConstant.ZERO).getAttentionType();
List<String> existList = baseDao.getExistList(attentionType, idCards);
List<IcEpidemicSpecialAttentionEntity> existsEntities = new ArrayList<>();
if (CollectionUtils.isNotEmpty(existList)){
for (String s : existList) {
for (int i = NumConstant.ZERO; i < entities.size(); i++) {
if (s.equals(entities.get(i).getIdCard())){
existsEntities.add(entities.get(i));
entities.remove(i);
continue;
}
}
}
}
baseDao.addAttention(idCards,attentionType);
}
entities.forEach(e -> {
e.setIsAttention(NumConstant.ONE);
e.setOrgId(agencyInfo.getId());

34
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -31,6 +31,40 @@
)
</update>
<update id="addExistAttention">
UPDATE ic_epidemic_special_attention
<trim prefix="set" suffixOverrides=",">
<trim prefix="IS_ATTENTION =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then 1
</foreach>
</trim>
<trim prefix="reason =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then #{item.reason}
</foreach>
</trim>
<trim prefix="remark =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then #{item.remark}
</foreach>
</trim>
<trim prefix="isolatedState =(case" suffix="end),">
<foreach collection="list" item="item">
when id_card = #{item.idCard} then #{item.isolatedState}
</foreach>
</trim>
updated_time = now()
</trim>
WHERE del_flag = 0
AND attention_type = #{attentionType}
AND id_card IN (
<foreach collection="list" item="l" separator=",">
#{l.idCard}
</foreach>
)
</update>
<!-- 疫苗接种关注名单 -->
<select id="vaccinationList" resultType="com.epmet.dto.result.VaccinationListResultDTO">
SELECT a.id,

Loading…
Cancel
Save