wxz 2 years ago
parent
commit
c052c7d392
  1. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java
  2. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  3. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java
  4. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffImportExcelData.java
  5. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java
  6. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CustomerStaffImportListener.java
  7. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
  8. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodInfoModel.java
  9. 112
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  10. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  11. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/customer_staff_import_template.xlsx
  12. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx
  13. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx
  14. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx
  15. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/community_building_manager_import_temp.xlsx
  16. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
  17. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
  18. 42
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/ImportGeneralDTO.java

@ -223,4 +223,9 @@ public class ImportGeneralDTO implements Serializable {
private String buildingLeaderTypeNum; private String buildingLeaderTypeNum;
private String propertyUserName;
private String propertyUserMobile;
} }

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java

@ -259,7 +259,7 @@ public class StaffController implements ResultDataResolver {
Path fileSavePath; Path fileSavePath;
try { try {
Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import"); Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("staff", "import");
fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName));
} catch (IOException e) { } catch (IOException e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e); String errorMsg = ExceptionUtils.getErrorStackTrace(e);

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java

@ -17,6 +17,8 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
@ -39,6 +41,7 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity {
* 物业名称 * 物业名称
*/ */
private String name; private String name;
@TableField(fill = FieldFill.INSERT)
private String customerId; private String customerId;
/** /**
* 烟台需求物业联系人姓名 * 烟台需求物业联系人姓名

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffImportExcelData.java

@ -60,6 +60,13 @@ public class CustomerStaffImportExcelData {
@Data @Data
public static class RowRemarkMessage { public static class RowRemarkMessage {
@ColumnWidth(60)
@ExcelProperty("姓名")
private String name;
@ColumnWidth(60)
@ExcelProperty("联系电话")
private String mobile;
@ColumnWidth(60) @ColumnWidth(60)
@ExcelProperty("错误信息") @ExcelProperty("错误信息")

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcNeighborHoodExcel.java

@ -124,6 +124,12 @@ public class IcNeighborHoodExcel extends ExcelVerifyInfo implements Serializable
@Excel(name = "关联物业") @Excel(name = "关联物业")
private String propertyName; private String propertyName;
@Excel(name = "物业联系人")
private String propertyUserName;
@Excel(name = "联系电话")
private String propertyUserMobile;
@Excel(name = "详细地址") @Excel(name = "详细地址")
@NotBlank(message = "不能为空") @NotBlank(message = "不能为空")
private String address; private String address;

28
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/CustomerStaffImportListener.java

@ -38,6 +38,8 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm
private String currentOrgId; private String currentOrgId;
private CustomerStaffImportExcelData dataB;
/** /**
* 数据 * 数据
@ -67,6 +69,8 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm
public void invoke(CustomerStaffImportExcelData data, AnalysisContext context) { public void invoke(CustomerStaffImportExcelData data, AnalysisContext context) {
try { try {
dataB = data;
// 先校验数据 // 先校验数据
ValidatorUtils.validateEntity(data); ValidatorUtils.validateEntity(data);
@ -144,6 +148,8 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm
CustomerStaffImportExcelData.RowRemarkMessage errorRow = new CustomerStaffImportExcelData.RowRemarkMessage(); CustomerStaffImportExcelData.RowRemarkMessage errorRow = new CustomerStaffImportExcelData.RowRemarkMessage();
errorRow.setErrorInfo(errorMsg); errorRow.setErrorInfo(errorMsg);
errorRow.setName(data.getName());
errorRow.setMobile(data.getMobile());
errorRows.add(errorRow); errorRows.add(errorRow);
} }
} }
@ -151,7 +157,25 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm
@Override @Override
public void doAfterAllAnalysed(AnalysisContext context) { public void doAfterAllAnalysed(AnalysisContext context) {
// 最后几条达不到阈值,这里必须再调用一次 // 最后几条达不到阈值,这里必须再调用一次
execPersist(); try {
execPersist();
}catch (Exception e) {
String errorMsg = null;
if (e instanceof ValidateException) {
errorMsg = ((ValidateException) e).getMsg();
} else {
log.error("【客户信息导入】出错:{}", e.getStackTrace());
errorMsg = ((EpmetException)e).getInternalMsg();
log.error("【客户信息导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
}
CustomerStaffImportExcelData.RowRemarkMessage errorRow = new CustomerStaffImportExcelData.RowRemarkMessage();
errorRow.setErrorInfo(errorMsg);
errorRow.setName(dataB.getName());
errorRow.setMobile(dataB.getMobile());
errorRows.add(errorRow);
}
} }
/** /**
@ -163,7 +187,7 @@ public class CustomerStaffImportListener implements ReadListener<CustomerStaffIm
// icNatService.batchPersist(datas, this); // icNatService.batchPersist(datas, this);
staffService.exportAdd(datas,this); staffService.exportAdd(datas,this);
} }
} finally { }finally {
datas.clear(); datas.clear();
} }
} }

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java

@ -185,6 +185,13 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
disposePropertyNames.forEach(name -> { disposePropertyNames.forEach(name -> {
IcPropertyManagementEntity e = new IcPropertyManagementEntity(); IcPropertyManagementEntity e = new IcPropertyManagementEntity();
e.setName(name); e.setName(name);
for (ImportGeneralDTO importGeneralDTO : notExistList) {
if (importGeneralDTO.getPropertyName().equals(name)){
e.setContactMobile(importGeneralDTO.getPropertyUserMobile());
e.setContactName(importGeneralDTO.getPropertyUserName());
break;
}
}
propertyManagementEntities.add(e); propertyManagementEntities.add(e);
}); });
} }

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodInfoModel.java

@ -36,6 +36,12 @@ public class NeighborHoodInfoModel {
@ExcelProperty(value = "关联物业") @ExcelProperty(value = "关联物业")
private String propertyName; private String propertyName;
@ExcelProperty(value = "物业联系人")
private String propertyUserName;
@ExcelProperty(value = "联系电话")
private String propertyUserMobile;
@ExcelProperty(value = "详细地址") @ExcelProperty(value = "详细地址")
private String address; private String address;

112
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -92,6 +92,8 @@ public class BuildingServiceImpl implements BuildingService {
private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao; private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao;
@Autowired @Autowired
private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl; private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl;
@Autowired
private CommunityBuildingManagerDao communityBuildingManagerDao;
@Override @Override
@ -103,8 +105,8 @@ public class BuildingServiceImpl implements BuildingService {
if (null != count && count > 0) { if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg());
} }
IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId()); IcNeighborHoodEntity neighborHood1 = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId());
count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood.getNeighborHoodName(), formDTO.getBuildingName(), null); count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood1.getNeighborHoodName(), formDTO.getBuildingName(), null);
if (null != count && count > 0) { if (null != count && count > 0) {
throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode()); throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode());
} }
@ -121,6 +123,57 @@ public class BuildingServiceImpl implements BuildingService {
IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class); IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class);
icBuildingDao.insert(entity); icBuildingDao.insert(entity);
LambdaQueryWrapper<CommunityBuildingManagerEntity> manager = new LambdaQueryWrapper<CommunityBuildingManagerEntity>().eq(CommunityBuildingManagerEntity::getBuildingId,entity.getId());
CommunityBuildingManagerEntity communityBuildingManagerEntity = communityBuildingManagerDao.selectOne(manager);
if (StringUtils.isNotBlank(entity.getBuildingLeaderType())&&
StringUtils.isNotBlank(entity.getBuildingLeaderIdCard())&&
StringUtils.isNotBlank(entity.getBuildingLeaderMobile())&&
StringUtils.isNotBlank(entity.getBuildingLeaderName())){
if (communityBuildingManagerEntity!=null){
communityBuildingManagerEntity.setIdCard(entity.getBuildingLeaderIdCard());
communityBuildingManagerEntity.setPhone(entity.getBuildingLeaderMobile());
communityBuildingManagerEntity.setType(entity.getBuildingLeaderType());
communityBuildingManagerEntity.setName(entity.getBuildingLeaderName());
communityBuildingManagerDao.updateById(communityBuildingManagerEntity);
}else{
communityBuildingManagerEntity= new CommunityBuildingManagerEntity();
communityBuildingManagerEntity.setIdCard(entity.getBuildingLeaderIdCard());
communityBuildingManagerEntity.setPhone(entity.getBuildingLeaderMobile());
communityBuildingManagerEntity.setType(entity.getBuildingLeaderType());
communityBuildingManagerEntity.setName(entity.getBuildingLeaderName());
communityBuildingManagerEntity.setBuildingId(entity.getId());
communityBuildingManagerEntity.setViliageId(entity.getNeighborHoodId());
IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(entity.getNeighborHoodId());
communityBuildingManagerEntity.setGridId(neighborHood.getGridId());
communityBuildingManagerEntity.setOrgIdPath(neighborHood.getAgencyPids()+":"+neighborHood.getAgencyId()+":"+neighborHood.getGridId());
List<String> agencyIds = new ArrayList<>(Arrays.asList(neighborHood.getAgencyPids().split(":")));
agencyIds.add(neighborHood.getAgencyId());
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper = new LambdaQueryWrapper<CustomerAgencyEntity>().in(CustomerAgencyEntity::getId,agencyIds);
List<CustomerAgencyEntity> customerAgencyEntities = customerAgencyDao.selectList(queryWrapper);
for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) {
if (customerAgencyEntity.getLevel().equals("community")){
communityBuildingManagerEntity.setCommunityId(customerAgencyEntity.getId());
}
if (customerAgencyEntity.getLevel().equals("street")){
communityBuildingManagerEntity.setStreetId(customerAgencyEntity.getId());
}
if (customerAgencyEntity.getLevel().equals("district")){
communityBuildingManagerEntity.setDistrictId(customerAgencyEntity.getId());
}
}
communityBuildingManagerDao.insert(communityBuildingManagerEntity);
}
}else{
if (communityBuildingManagerEntity!=null){
communityBuildingManagerDao.deleteById(communityBuildingManagerEntity);
}
}
//设置楼宇单元 //设置楼宇单元
Integer totalUnitNum = formDTO.getTotalUnitNum(); Integer totalUnitNum = formDTO.getTotalUnitNum();
List<IcBuildingUnitEntity> unitList = new ArrayList<>(); List<IcBuildingUnitEntity> unitList = new ArrayList<>();
@ -657,8 +710,8 @@ public class BuildingServiceImpl implements BuildingService {
if (null != count && count > 0) { if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg());
} }
IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId()); IcNeighborHoodEntity neighborHood1 = icNeighborHoodDao.selectById(formDTO.getNeighborHoodId());
count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood.getNeighborHoodName(), formDTO.getBuildingName(), formDTO.getBuildingId()); count = icBuildingDao.checkBuildNameV2(formDTO.getAgencyId(), neighborHood1.getNeighborHoodName(), formDTO.getBuildingName(), formDTO.getBuildingId());
if (null != count && count > 0) { if (null != count && count > 0) {
throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode()); throw new EpmetException(EpmetErrorCode.BUILDING_NAME_EXITED_IN_GRID.getCode());
} }
@ -684,6 +737,57 @@ public class BuildingServiceImpl implements BuildingService {
icBuildingDTO.setCustomerId(customerId); icBuildingDTO.setCustomerId(customerId);
icBuildingService.update(icBuildingDTO); icBuildingService.update(icBuildingDTO);
LambdaQueryWrapper<CommunityBuildingManagerEntity> manager = new LambdaQueryWrapper<CommunityBuildingManagerEntity>().eq(CommunityBuildingManagerEntity::getBuildingId,icBuildingDTO.getId());
CommunityBuildingManagerEntity communityBuildingManagerEntity = communityBuildingManagerDao.selectOne(manager);
if (StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderType())&&
StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderIdCard())&&
StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderMobile())&&
StringUtils.isNotBlank(icBuildingDTO.getBuildingLeaderName())){
if (communityBuildingManagerEntity!=null){
communityBuildingManagerEntity.setIdCard(icBuildingDTO.getBuildingLeaderIdCard());
communityBuildingManagerEntity.setPhone(icBuildingDTO.getBuildingLeaderMobile());
communityBuildingManagerEntity.setType(icBuildingDTO.getBuildingLeaderType());
communityBuildingManagerEntity.setName(icBuildingDTO.getBuildingLeaderName());
communityBuildingManagerDao.updateById(communityBuildingManagerEntity);
}else{
communityBuildingManagerEntity= new CommunityBuildingManagerEntity();
communityBuildingManagerEntity.setIdCard(icBuildingDTO.getBuildingLeaderIdCard());
communityBuildingManagerEntity.setPhone(icBuildingDTO.getBuildingLeaderMobile());
communityBuildingManagerEntity.setType(icBuildingDTO.getBuildingLeaderType());
communityBuildingManagerEntity.setName(icBuildingDTO.getBuildingLeaderName());
communityBuildingManagerEntity.setBuildingId(icBuildingDTO.getId());
communityBuildingManagerEntity.setViliageId(icBuildingDTO.getNeighborHoodId());
IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(icBuildingDTO.getNeighborHoodId());
communityBuildingManagerEntity.setGridId(neighborHood.getGridId());
communityBuildingManagerEntity.setOrgIdPath(neighborHood.getAgencyPids()+":"+neighborHood.getAgencyId()+":"+neighborHood.getGridId());
List<String> agencyIds = new ArrayList<>(Arrays.asList(neighborHood.getAgencyPids().split(":")));
agencyIds.add(neighborHood.getAgencyId());
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper = new LambdaQueryWrapper<CustomerAgencyEntity>().in(CustomerAgencyEntity::getId,agencyIds);
List<CustomerAgencyEntity> customerAgencyEntities = customerAgencyDao.selectList(queryWrapper);
for (CustomerAgencyEntity customerAgencyEntity : customerAgencyEntities) {
if (customerAgencyEntity.getLevel().equals("community")){
communityBuildingManagerEntity.setCommunityId(customerAgencyEntity.getId());
}
if (customerAgencyEntity.getLevel().equals("street")){
communityBuildingManagerEntity.setStreetId(customerAgencyEntity.getId());
}
if (customerAgencyEntity.getLevel().equals("district")){
communityBuildingManagerEntity.setDistrictId(customerAgencyEntity.getId());
}
}
communityBuildingManagerDao.insert(communityBuildingManagerEntity);
}
}else{
if (communityBuildingManagerEntity!=null){
communityBuildingManagerDao.deleteById(communityBuildingManagerEntity);
}
}
// 更新房屋名称 // 更新房屋名称
icHouseDao.houseUpdateHouseName(formDTO.getBuildingId()); icHouseDao.houseUpdateHouseName(formDTO.getBuildingId());
//更新楼宇单元 //更新楼宇单元

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -792,9 +792,9 @@ public class StaffServiceImpl implements StaffService {
if (errorRows.size() > 0) { if (errorRows.size() > 0) {
try { try {
// 文件生成 // 文件生成
Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import", "error_des"); Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("staff", "import", "error_des");
String timeMillis = String.valueOf(System.currentTimeMillis()); String timeMillis = String.valueOf(System.currentTimeMillis());
String fileName = "icnat_import_error_".concat(timeMillis).concat(".xlsx"); String fileName = "staff_import_error_".concat(timeMillis).concat(".xlsx");
fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, errorDescDir.toFile()) fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, errorDescDir.toFile())
.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); .createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName);

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/customer_staff_import_template.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_template.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_export.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/neighbor_template.xlsx

Binary file not shown.

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/yantai/community_building_manager_import_temp.xlsx

Binary file not shown.

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -463,7 +463,7 @@
SELECT SELECT
b.BUILDING_LEADER_ID_CARD as buildingLeaderIdCard, b.BUILDING_LEADER_ID_CARD as buildingLeaderIdCard,
b.BUILDING_LEADER_TYPE as buildingLeaderType, b.BUILDING_LEADER_TYPE as buildingLeaderType,
if(b.BUILDING_LEADER_TYPE = 0,'楼长',if(b.BUILDING_LEADER_TYPE = 1,'单元长','')) as buildingLeaderTypeName, if(b.BUILDING_LEADER_TYPE = '0','楼长',if(b.BUILDING_LEADER_TYPE = '1','单元长',if(b.BUILDING_LEADER_TYPE = '0,1','楼长/单元长',if(b.BUILDING_LEADER_TYPE = '1,0','楼长/单元长','')))) as buildingLeaderTypeName,
b.ID AS buildingId, b.ID AS buildingId,
b.BUILDING_NAME, b.BUILDING_NAME,
b.NEIGHBOR_HOOD_ID, b.NEIGHBOR_HOOD_ID,

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

@ -197,6 +197,8 @@
a.ADDRESS as address, a.ADDRESS as address,
a.REMARK as remark, a.REMARK as remark,
e.NAME as propertyName, e.NAME as propertyName,
e.CONTACT_NAME as propertyUserName,
e.CONTACT_MOBILE as propertyUserMobile,
b.ORGANIZATION_NAME as agencyName, b.ORGANIZATION_NAME as agencyName,
c.GRID_NAME as gridName c.GRID_NAME as gridName
from ic_neighbor_hood a from ic_neighbor_hood a

42
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

@ -71,19 +71,33 @@
</select> </select>
<select id="queryList" parameterType="map" resultType="com.epmet.dto.IcPropertyManagementDTO"> <select id="queryList" parameterType="map" resultType="com.epmet.dto.IcPropertyManagementDTO">
select m.* select * from (
from ic_property_management m select m.*,
where m.del_flag='0' (
and m.customer_id=#{customerId} SELECT
<if test="name != null and name != ''"> count(p.NEIGHBOR_HOOD_ID)
and m.name like concat('%',#{name},'%') FROM
</if> ic_neighbor_hood_property p
<if test="contactName != null and contactName != ''"> INNER JOIN ic_neighbor_hood h
and m.CONTACT_NAME like concat('%',#{contactName},'%') ON ( p.NEIGHBOR_HOOD_ID = h.ID )
</if> WHERE p.DEL_FLAG = '0'
<if test="contactMobile != null and contactMobile != ''"> and p.PROPERTY_ID =m.id
and m.CONTACT_MOBILE like concat('%',#{contactMobile},'%') AND (h.AGENCY_ID = #{agencyId} or h.AGENCY_PIDS like concat('%',#{agencyId},'%') )
</if> AND h.DEL_FLAG = '0'
order by m.CREATED_TIME desc )as totalNeighborHood
from ic_property_management m
where m.del_flag='0'
and m.customer_id=#{customerId}
<if test="name != null and name != ''">
and m.name like concat('%',#{name},'%')
</if>
<if test="contactName != null and contactName != ''">
and m.CONTACT_NAME like concat('%',#{contactName},'%')
</if>
<if test="contactMobile != null and contactMobile != ''">
and m.CONTACT_MOBILE like concat('%',#{contactMobile},'%')
</if>
)t
order by t.totalNeighborHood desc,t.CREATED_TIME desc
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save