Browse Source

Merge remote-tracking branch 'remotes/origin/develop' into 主线测试

master
jianjun 3 years ago
parent
commit
6b26f23f8e
  1. 6
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.13__up_sys_dict_data.sql
  2. 2
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml
  3. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  5. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  6. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  7. 152
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  8. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java
  9. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java
  10. 45
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java
  11. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java
  12. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  13. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java
  14. 38
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

6
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.13__up_sys_dict_data.sql

@ -0,0 +1,6 @@
update sys_dict_data set dict_label='联建单位'
where dict_value='party_unit'
and DEL_FLAG='0'
and dict_type_id=(
select st.id from sys_dict_type st where st.dict_type='user_demand_service_type' and st.DEL_FLAG='0'
);

2
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml

@ -84,7 +84,6 @@
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>
@ -101,7 +100,6 @@
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -89,11 +89,9 @@ public class HouseController implements ResultDataResolver {
//效验数据
ValidatorUtils.validateEntity(formDTO);
String queryScene = "house_manage";
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(null, formDTO.getBuildingId(), formDTO.getOwnerName(),
formDTO.getOwnerPhone(), null,
null, queryScene,
null,
formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getId(),formDTO.getLevel(),formDTO.getRentFlag());
return new Result().ok(icNeighborHoodResultDTO);
@ -129,9 +127,6 @@ public class HouseController implements ResultDataResolver {
buildingName = null;
}
// 使用场景:社区查询
String scene = "community_search";
LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO();
form.setUserId(loginUser.getUserId());
form.setClient(loginUser.getClient());
@ -142,7 +137,7 @@ public class HouseController implements ResultDataResolver {
null);
IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(loginUserDetail.getAgencyId(),null, null, null,
neighborhoodName, buildingName, scene, formDTO.getPageNo(), formDTO.getPageSize(),null,null,null);
neighborhoodName, buildingName, formDTO.getPageNo(), formDTO.getPageSize(),null,null,null);
return new Result<IcNeighborHoodResultDTO>().ok(icNeighborHoodResultDTO);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -24,14 +24,6 @@ import java.util.Set;
@Mapper
public interface IcHouseDao extends BaseDao<IcHouseEntity> {
// IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page,
// @Param(Constants.WRAPPER) QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper,
// @Param("ew1") QueryWrapper<IcBuildingEntity> buildingEntityQueryWrapper,
// @Param("ew2") QueryWrapper<IcHouseEntity> houseEntityQueryWrapper);
// IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page,
// @Param("neighbor") IcNeighborHoodEntity neighbor,
// @Param("building") IcBuildingEntity building,
// @Param("house") IcHouseEntity house);
IPage<Map<String, Object>> searchHouseByPage(IPage<IcHouseEntity> page,
@Param("pids") String pids,
@Param("buildingId") String buildingId,
@ -39,7 +31,6 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
@Param("ownerPhone") String ownerPhone,
@Param("neighborHoodName") String neighborHoodName,
@Param("buildingName") String buildingName,
@Param("queryScene") String queryScene,
@Param("id")String id,
@Param("level")String level,
@Param("rentFlag")String rentFlag);

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -60,7 +60,6 @@ public interface HouseService {
String ownerPhone,
String neighborHoodName,
String buildingName,
String queryScene,
Integer pageNo,
Integer pageSize,
String id,

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
@ -256,26 +257,22 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
String ownerPhone,
String neighborHoodName,
String buildingName,
String queryScene,
Integer pageNo,
Integer pageSize,
String id,String level, String rentFlag) {
IcNeighborHoodResultDTO result = new IcNeighborHoodResultDTO();
//如果类型是house 查房屋
//IPage<Map<String, Object>> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize);
// 查询pids
String pids = null;
if (StringUtils.isNotBlank(ancestorAgencyId)) {
pids = getPids(ancestorAgencyId);
}
if (StringUtils.isNotBlank(level) && level.equals("agency")){
if (StringUtils.isNotBlank(level) && OrgTypeEnum.AGENCY.getCode().equals(level)){
pids = getPids(ancestorAgencyId);
}
IPage<IcHouseEntity> page = new Page<IcHouseEntity>(pageNo,pageSize);
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, queryScene,id,level,rentFlag);
IPage<Map<String, Object>> mapIPage = icHouseDao.searchHouseByPage(page, pids, buildingId, ownerName, ownerPhone, neighborHoodName, buildingName,id,level,rentFlag);
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey")));

152
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -70,83 +70,6 @@
)
</update>
<!--<select id="searchHouseByPage" resultType="map">
select
a.ID as houseId,
a.HOUSE_NAME as houseName,
a.DOOR_NAME as doorName,
a.HOUSE_TYPE as houseType,
a.PURPOSE as purpose,
a.RENT_FLAG as rentFlag,
a.OWNER_NAME as ownerName,
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName
from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID
and c.ID in (select e.ID from ic_building e ${ew1.customSqlSegment})
INNER JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID
and c.ID in (select f.ID from ic_neighbor_hood f
INNER JOIN customer_agency g on f.AGENCY_ID = g.ID
INNER JOIN customer_grid h on f.GRID_ID = h.ID
${ew2.customSqlSegment}
)
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID
${ew.customSqlSegment}
</select>-->
<!--<select id="searchHouseByPage" resultType="map">
select
a.ID as houseId,
a.HOUSE_NAME as houseName,
a.DOOR_NAME as doorName,
a.HOUSE_TYPE as houseType,
a.PURPOSE as purpose,
a.RENT_FLAG as rentFlag,
a.OWNER_NAME as ownerName,
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName
from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID
<if test="building.id != null and building.id.trim() != ''">
AND b.ID = #{building.id}
</if>
<if test="building.buildingName != null and building.buildingName.trim() != ''">
AND b.BUILDING_NAME like concat('%',trim(#{building.buildingName}),'%')
</if>
INNER JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID
<if test="neighbor.id != null and neighbor.id.trim() != ''">
AND c.ID = #{neighbor.id}
</if>
<if test="neighbor.agencyId != null and neighbor.agencyId.trim() != ''">
AND c.AGENCY_ID = #{neighbor.agencyId}
</if>
<if test="neighbor.gridId != null and neighbor.gridId.trim() != ''">
AND c.GRID_ID = #{neighbor.gridId}
</if>
<if test="neighbor.neighborHoodName != null and neighbor.neighborHoodName.trim() != ''">
AND c.NEIGHBOR_HOOD_NAME like concat('%',trim(#{neighbor.neighborHoodName}),'%')
</if>
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID
<where>
<if test="house.ownerName != null and house.ownerName.trim() != ''">
AND a.OWNER_NAME = #{house.ownerName}
</if>
<if test="house.OWNER_PHONE != null and house.OWNER_PHONE.trim() != ''">
AND a.OWNER_PHONE = #{house.ownerPhone}
</if>
<if test="house.delFlag != null and house.delFlag.trim() != ''">
AND a.DEL_FLAG = #{building.delFlag}
</if>
</where>
</select>-->
<select id="searchHouseByPage" resultType="map">
select
a.HOUSE_NAME as houseName,
@ -178,7 +101,7 @@
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0'
<where>
a.del_flag = '0'
1 = 1
<if test="pids != null and pids != ''">
and case c.AGENCY_PIDS when '' then CONCAT(c.AGENCY_ID) like CONCAT(#{pids}, '%')
else CONCAT(c.AGENCY_PIDS, ':', c.AGENCY_ID) like CONCAT(#{pids}, '%') end
@ -213,22 +136,14 @@
<if test="rentFlag != null and rentFlag.trim() != ''">
AND a.rent_flag = #{rentFlag}
</if>
and a.del_flag = '0'
</where>
/*排序规则:如果是社区查询则根据小区、楼栋、单元、房屋名字分别升序排序*/
<choose>
<when test="queryScene == 'community_search'">
ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk) ASC,
CONVERT(b.BUILDING_NAME USING gbk) ASC,
CONVERT(d.UNIT_NAME USING gbk) ASC,
CONVERT(a.HOUSE_NAME using gbk) ASC
</when>
<when test="queryScene == 'house_manage'">
ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME
</when>
<otherwise>
ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME
</otherwise>
</choose>
/*排序规则:根据小区、楼栋、单元、门牌号(分别按照数字和中文)分别升序排序*/
ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk),
CONVERT(b.BUILDING_NAME USING gbk),
CONVERT(d.UNIT_NAME USING gbk),
CAST(a.DOOR_NAME AS SIGNED),
CONVERT(a.DOOR_NAME using gbk)
</select>
<select id="searchAllHouse" resultType="com.epmet.excel.IcHouseExcel">
select
@ -260,59 +175,8 @@
<if test="house.delFlag != null and house.delFlag.trim() != ''">
AND a.DEL_FLAG = #{house.delFlag}
</if>
</where>
</select>
<!-- <select id="searchAllHouse" resultType="com.epmet.excel.IcHouseExcel">
select
a.HOUSE_NAME as houseName,
a.DOOR_NAME as doorName,
a.HOUSE_TYPE as houseType,
a.PURPOSE as purpose,
a.RENT_FLAG as rentFlag,
a.OWNER_NAME as ownerName,
a.OWNER_PHONE as ownerPhone,
a.OWNER_ID_CARD as ownerIdCard,
b.BUILDING_NAME as buildingName,
c.NEIGHBOR_HOOD_NAME as neighborHoodName,
d.UNIT_NUM as unitName
from ic_house a
INNER JOIN ic_building b on a.BUILDING_ID = b.ID
<if test="building.id != null and building.id.trim() != ''">
AND b.ID = #{building.id}
</if>
<if test="building.buildingName != null and building.buildingName.trim() != ''">
AND b.BUILDING_NAME like concat('%',trim(#{building.buildingName}),'%')
</if>
INNER JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID
<if test="neighbor.id != null and neighbor.id.trim() != ''">
AND c.ID = #{neighbor.id}
</if>
<if test="neighbor.agencyId != null and neighbor.agencyId.trim() != ''">
AND c.AGENCY_ID = #{neighbor.agencyId}
</if>
<if test="neighbor.gridId != null and neighbor.gridId.trim() != ''">
AND c.GRID_ID = #{neighbor.gridId}
</if>
<if test="neighbor.neighborHoodName != null and neighbor.neighborHoodName.trim() != ''">
AND c.NEIGHBOR_HOOD_NAME like concat('%',trim(#{neighbor.neighborHoodName}),'%')
</if>
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID
<where>
<if test="house.ownerName != null and house.ownerName.trim() != ''">
AND a.OWNER_NAME = #{house.ownerName}
</if>
<if test="house.OWNER_PHONE != null and house.OWNER_PHONE.trim() != ''">
AND a.OWNER_PHONE = #{house.ownerPhone}
</if>
<if test="house.delFlag != null and house.delFlag.trim() != ''">
AND a.DEL_FLAG = #{building.delFlag}
</if>
</where>
</select>-->
<select id="queryHouseInfo" parameterType="map" resultType="com.epmet.dto.result.HouseInfoDTO">

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java

@ -54,6 +54,26 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable
* 备注核酸检测关注名单此字段可填可不填
*/
private String remark;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
private String userId;

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiResultDTO.java

@ -40,5 +40,8 @@ public class IcStatsResiResultDTO implements Serializable {
private String managementIcon;
private String dataIcon;
private String houseShowIcon;
/**
* 列名
*/
private String columnName;
}

45
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java

@ -55,6 +55,51 @@ public class VaccinationListResultDTO implements Serializable {
*/
private String lastInformTime;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属小区名称
*/
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 所属楼宇名称
*/
private String buildName;
/**
* 单元id
*/
private String unitId;
/**
* 单元名称
*/
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 所属家庭名称
*/
private String homeName;
/**
* 小区名+楼栋名+单元名+房屋名
*/
private String allName;
public VaccinationListResultDTO() {
this.vaccinationCount = NumConstant.ZERO;
this.name = "";

3
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java

@ -32,4 +32,7 @@ public class VaccinationExportExcel {
@Excel(name = "最近一次通知时间",width = 20)
private String lastInformTime;
@Excel(name = "所属房屋",width = 40)
private String allName;
}

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

@ -23,6 +23,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcEpidemicSpecialAttentionDao;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.VaccinationListResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
@ -30,6 +31,7 @@ import com.epmet.enums.ChannelEnum;
import com.epmet.excel.ImportEpidemicSpecialAttention;
import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import com.epmet.service.IcNoticeService;
@ -53,6 +55,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -71,6 +74,8 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
private OssFeignClient ossFeignClient;
@Autowired
private IcNoticeService noticeService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params) {
@ -160,10 +165,28 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
result.setTotal(list.size());
}
}
//需求调整 列表和导出增加所属房屋(小区+楼栋+单元+房间)一列值 sun
Map<String, HouseInfoDTO> houseInfoMap = new HashMap<>();
//查询房屋信息
if (result.getList().size() > NumConstant.ZERO) {
Set<String> houseIds = result.getList().stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
}
int i = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
for (VaccinationListResultDTO v : result.getList()) {
i += 1;
v.setSort(i);
if (null != houseInfoMap && houseInfoMap.containsKey(v.getHomeId())) {
v.setVillageName(houseInfoMap.get(v.getHomeId()).getNeighborHoodName());
v.setBuildName(houseInfoMap.get(v.getHomeId()).getBuildingName());
v.setUnitName(houseInfoMap.get(v.getHomeId()).getUnitName());
v.setHomeName(houseInfoMap.get(v.getHomeId()).getDoorName());
v.setAllName(houseInfoMap.get(v.getHomeId()).getAllName());
}
}
return result;
}

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

@ -238,6 +238,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
resultDTO.setDataIcon(item.getDataIcon());
resultDTO.setHouseShowIcon(item.getHouseShowIcon());
resultDTO.setManagementIcon(item.getManagementIcon());
resultDTO.setColumnName(item.getColumnName());
//根据id ,level 获取count
//Integer count = icStatsResiWarnDao.countListByLevelAndCol(customerId,item.getTableName(),item.getColumnName(),id,level);
Map<String, BigDecimal> orDefault = tableColumnCountMap.getOrDefault(item.getTableName(), new HashMap<>());

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

@ -26,13 +26,18 @@
a.ID_CARD,
a.reason,
a.REMARK,
b.VILLAGE_ID,
b.BUILD_ID,
b.UNIT_ID,
b.HOME_ID,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime,
IFNULL(v.vaccinationCount,0) AS vaccinationCount
FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_user b ON a.id_card = b.id_card
LEFT JOIN (SELECT id_card ,count(1) AS vaccinationCount FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD) v ON (v.ID_CARD = a.ID_CARD)
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND ATTENTION_TYPE = #{attentionType}
AND a.ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
</if>
@ -42,6 +47,18 @@
<if test='null != mobile and "" != mobile'>
AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%')
</if>
<if test='null != villageId and "" != villageId'>
AND b.village_id = #{villageId}
</if>
<if test='null != buildId and "" != buildId'>
AND b.build_id = #{buildId}
</if>
<if test='null != unitId and "" != unitId'>
AND b.unit_id = #{unitId}
</if>
<if test='null != homeId and "" != homeId'>
AND b.home_id = #{homeId}
</if>
<if test=' null != vaccinationCount'>
HAVING vaccinationCount = #{vaccinationCount}
</if>
@ -56,11 +73,16 @@
a.ID_CARD,
a.REMARK,
a.REASON,
b.VILLAGE_ID,
b.BUILD_ID,
b.UNIT_ID,
b.HOME_ID,
IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime
FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_user b ON a.id_card = b.id_card
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND ATTENTION_TYPE = #{attentionType}
AND a.ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
</if>
@ -76,6 +98,18 @@
<if test='null != remark and "" != remark'>
AND a.REMARK LIKE CONCAT('%',#{remark},'%')
</if>
<if test='null != villageId and "" != villageId'>
AND b.village_id = #{villageId}
</if>
<if test='null != buildId and "" != buildId'>
AND b.build_id = #{buildId}
</if>
<if test='null != unitId and "" != unitId'>
AND b.unit_id = #{unitId}
</if>
<if test='null != homeId and "" != homeId'>
AND b.home_id = #{homeId}
</if>
ORDER BY a.CREATED_TIME DESC
</select>

Loading…
Cancel
Save