Browse Source

新增筛选人员接口

dev
zxc 3 years ago
parent
commit
d15d15b2cc
  1. 16
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java
  2. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
  3. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  4. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  5. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  6. 73
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

16
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java

@ -56,6 +56,16 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab
* 身份证
*/
private String idCard;
/**
* 开始日期
*/
private String startDate;
/**
* 结束日期
*/
private String endDate;
/**
* 疫苗接种次数
*/
@ -65,6 +75,8 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab
*/
private Integer natCount;
private String startDate;
private String endDate;
/**
* 关注类型核酸检测2疫苗接种1
*/
private Integer attentionType;
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java

@ -64,6 +64,13 @@ public class IcEpidemicPreventionController{
return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result);
}
@PostMapping("user-list")
public Result<PageData<EpidemicPreventionResultDTO>> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<EpidemicPreventionResultDTO> result = icResiUserService.userList(formDTO);
return new Result<PageData<EpidemicPreventionResultDTO>>().ok(result);
}
/**
* 居民防疫信息详情
* @Param formDTO

3
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -280,4 +280,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<EpidemicPreventionResultDTO> getEpidemicPreventionList(EpidemicPreventionFormDTO formDTO);
List<EpidemicPreventionResultDTO> natList(EpidemicPreventionFormDTO formDTO);
List<EpidemicPreventionResultDTO> vaccineList(EpidemicPreventionFormDTO formDTO);
}

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -226,6 +226,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @Date 2022/3/29 14:27
*/
PageData<EpidemicPreventionResultDTO> epidemicPreventionList(EpidemicPreventionFormDTO formDTO);
PageData<EpidemicPreventionResultDTO> userList(EpidemicPreventionFormDTO formDTO);
/**
* 居民防疫信息详情

13
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -1278,6 +1278,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public PageData<EpidemicPreventionResultDTO> userList(EpidemicPreventionFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<EpidemicPreventionResultDTO> list = new ArrayList<>();
if (formDTO.getAttentionType().equals(NumConstant.TWO)){
list = baseDao.natList(formDTO);
}else if (formDTO.getAttentionType().equals(NumConstant.ONE)){
list = baseDao.vaccineList(formDTO);
}
PageInfo<EpidemicPreventionResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* 居民防疫信息详情
*

73
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -724,4 +724,77 @@
</if>
ORDER BY `NAME`
</select>
<select id="natList" resultType="com.epmet.dto.result.EpidemicPreventionResultDTO">
SELECT * FROM
(SELECT
ID,
`NAME`,
GRID_ID,
HOME_ID,
MOBILE,
a.ID_CARD,
c.created_time,
IFNULL( c.count, 0 ) AS natCount
FROM ic_resi_user a
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count,created_time FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD
WHERE a.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND a.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test="gridId != null and gridId != ''">
AND GRID_ID = #{gridId}
</if>
) t
WHERE 1=1
<if test="startDate != null and startDate != ''">
AND date_format(created_time,'%Y%m%d') >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND date_format(created_time,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
<if test="natCount != null">
AND natCount <![CDATA[ <= ]]> #{natCount}
</if>
ORDER BY `NAME`
</select>
<select id="vaccineList" resultType="com.epmet.dto.result.EpidemicPreventionResultDTO">
SELECT * FROM
(SELECT
ID,
`NAME`,
GRID_ID,
HOME_ID,
MOBILE,
a.ID_CARD,
b.created_time,
IFNULL( b.count, 0 ) AS vaccineCount
FROM ic_resi_user a
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count,created_time FROM ic_resi_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD
WHERE a.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND a.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test="gridId != null and gridId != ''">
AND GRID_ID = #{gridId}
</if>
) t
WHERE 1=1
<if test="startDate != null and startDate != ''">
AND date_format(created_time,'%Y%m%d') >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND date_format(created_time,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
<if test="vaccineCount != null">
AND vaccineCount <![CDATA[ <= ]]> #{vaccineCount}
</if>
ORDER BY `NAME`
</select>
</mapper>

Loading…
Cancel
Save