Compare commits

...

3 Commits

@ -6,3 +6,8 @@ etcV2TV3_villageCode=320924000000001
#射阳数据源读取东台数据源数据 并清洗到数据库中
syrkV3Switch=true
dtJwzTimes=2
#标准地址清洗任务开关
dtOdsStandardAddressSwitch=true

@ -27,6 +27,14 @@
<!-- <artifactId>spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6 -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>

@ -1,2 +1,8 @@
##该工程用
多数据源的情况 数据清洗
多数据源的情况 数据清洗
etc2.0清洗到3.0配置
射阳数据源读取东台数据源数据 并清洗到数据库中

@ -15,6 +15,7 @@ public class DatatoDBsApplication {
SpringApplication.run(DatatoDBsApplication.class, args);
LoggerWt.info("---当前版本号--1.0.0,项目初始化");
LoggerWt.info("---当前版本号--1.0.0,新增射阳数据源读取东台数据源数据 并清洗到数据库中,射阳标准地址清洗任务(其他地势修改配置)");
}

@ -0,0 +1,35 @@
package com.wt.dataToDBs.tool;
public class CodeUtil {
private static final int GRID_NUMBER_LENGTH = 2;//网格序号长度
private static final int BUILDING_NUMBER_LENGTH = 3;//楼栋序号长度
private static final int UNIT_NUMBER_LENGTH = 2;//单元序号长度
private static final int HOME_NUMBER_LENGTH = 4;//房屋序号长度
/**
* @param code
* @param lastNumber
* @return
*/
public static String generateNumber(String code, String type, int lastNumber) {
type = StringKit.toString(type);
if ("".equals(type)) {
return "";
}
int numberLength = 0;//初始化
if ("grid".equals(type)) {
numberLength = GRID_NUMBER_LENGTH;
} else if ("build".equals(type)) {
numberLength = BUILDING_NUMBER_LENGTH;
} else if ("unit".equals(type)) {
numberLength = UNIT_NUMBER_LENGTH;
} else if ("home".equals(type)) {
numberLength = HOME_NUMBER_LENGTH;
}
String paddedNumber = String.format("%0" + numberLength + "d", lastNumber + 1);
return code + paddedNumber;
}
}

@ -8,4 +8,6 @@ public class ConfigParam {
public static String etcSwitch = PropertiesUtil.queryPropertiesByKey("etcSwitch");
public static String syrkV3Switch = PropertiesUtil.queryPropertiesByKey("syrkV3Switch");
public static String dtJwzTimes = PropertiesUtil.queryPropertiesByKey("dtJwzTimes");
public static String dtOdsStandardAddressSwitch = PropertiesUtil.queryPropertiesByKey("dtOdsStandardAddressSwitch");
}

@ -3,6 +3,7 @@ package com.wt.dataToDBs.tool;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@ -23,6 +24,17 @@ public class DateUtil {
return ymdhms.format(new Date(time * 1000));
}
public static String convertTimeToString(long longTime, String format) {
try {
Timestamp t = new Timestamp(longTime * 1000L);
SimpleDateFormat sDateFormat = new SimpleDateFormat(format);
return sDateFormat.format(t);
} catch (Exception ex) {
throw new RuntimeException((new StringBuilder()).append("Can't format the time by format[").append(format).append("]!").toString());
}
}
/**
*
*/

@ -199,6 +199,27 @@ public class StringKit {
}
/**
*
* @param input
* @return
*/
public static String convertChineseUnitToDigit(String input) {
input = input.replaceAll("一单元", "1单元")
.replaceAll("二单元", "2单元")
.replaceAll("三单元", "3单元")
.replaceAll("四单元", "4单元")
.replaceAll("五单元", "5单元")
.replaceAll("六单元", "6单元")
.replaceAll("七单元", "7单元")
.replaceAll("八单元", "8单元")
.replaceAll("九单元", "9单元");
return input;
}
/*
public static void main(String[] args) {

@ -0,0 +1,312 @@
package com.wt.dataToDBs.tool.julong;
import com.wt.dataToDBs.tool.StringKit;
public class DictUtil {
/**
*
*
* @return
*/
public static int convertRelation(String value) {
value = StringKit.toString(value);
int result = 8;
//1 本人
if ("01".equals(value)) {
result = 0;
}
//2 户主
else if ("02".equals(value)) {
result = 0;
}
//3 小集体户户主
else if ("03".equals(value)) {
result = 0;
}
//10 配偶
else if ("10".equals(value)) {
result = 1;
}
//11 夫
else if ("11".equals(value)) {
result = 1;
}
//12 妻
else if ("12".equals(value)) {
result = 1;
}
//20 子
else if ("20".equals(value)) {
result = 2;
}
//21 独生子
else if ("21".equals(value)) {
result = 2;
}
//22 长子
else if ("22".equals(value)) {
result = 2;
}
//23 次子
else if ("23".equals(value)) {
result = 2;
}
//24 三子
else if ("24".equals(value)) {
result = 2;
}
//25 四子
else if ("25".equals(value)) {
result = 2;
}
//26 五子
else if ("26".equals(value)) {
result = 2;
}
//27 养子或继子
else if ("27".equals(value)) {
result = 2;
}
//28 女婿
else if ("28".equals(value)) {
result = 8;
}
//29 其它儿子
else if ("28".equals(value)) {
result = 2;
}
//30 女
else if ("30".equals(value)) {
result = 3;
}
//31 独生女
else if ("31".equals(value)) {
result = 3;
}
//32 长女
else if ("32".equals(value)) {
result = 3;
}
//33 二女
else if ("33".equals(value)) {
result = 3;
}
//34 三女
else if ("34".equals(value)) {
result = 3;
}
//35 四女
else if ("35".equals(value)) {
result = 3;
}
//36 五女
else if ("36".equals(value)) {
result = 3;
}
//37 养女
else if ("37".equals(value)) {
result = 3;
}
//38 儿媳
else if ("38".equals(value)) {
result = 8;
}
//39 其它女儿
else if ("39".equals(value)) {
result = 3;
}
//40 孙子,孙女或外孙子,外孙女
else if ("40".equals(value)) {
result = 4;
}
//41 孙子
else if ("41".equals(value)) {
result = 4;
}
//42 孙女
else if ("42".equals(value)) {
result = 4;
}
//43 外孙子
else if ("43".equals(value)) {
result = 4;
}
//44 外孙女
else if ("44".equals(value)) {
result = 4;
}
//45 孙媳妇或外孙媳妇
else if ("45".equals(value)) {
result = 8;
}
//46 孙女婿或外孙女婿
else if ("46".equals(value)) {
result = 8;
}
//47 曾孙子或曾外孙子
else if ("47".equals(value)) {
result = 8;
}
//48 曾孙女或曾外孙女
else if ("48".equals(value)) {
result = 8;
}
//49 其他孙子,孙女或外孙子
else if ("49".equals(value)) {
result = 8;
}
//50 父母
else if ("50".equals(value)) {
result = 5;
}
//51 父亲
else if ("51".equals(value)) {
result = 5;
}
//52 母亲
else if ("52".equals(value)) {
result = 5;
}
//53 公公
else if ("53".equals(value)) {
result = 8;
}
//54 婆婆
else if ("54".equals(value)) {
result = 8;
}
//55 岳父
else if ("55".equals(value)) {
result = 8;
}
//56 岳母
else if ("56".equals(value)) {
result = 8;
}
//57 继父或养父
else if ("57".equals(value)) {
result = 8;
}
//58 继母或养母
else if ("58".equals(value)) {
result = 8;
}
//59 其它父母关系
else if ("59".equals(value)) {
result = 8;
}
//60 祖父母或外祖父母
else if ("60".equals(value)) {
result = 6;
}
//61 祖父
else if ("61".equals(value)) {
result = 6;
}
//62 祖母
else if ("62".equals(value)) {
result = 6;
}
//63 外祖父
else if ("63".equals(value)) {
result = 6;
}
//64 外祖母
else if ("64".equals(value)) {
result = 6;
}
//65 配偶的祖父母或外祖父母
else if ("65".equals(value)) {
result = 8;
}
//66 曾祖父
else if ("66".equals(value)) {
result = 8;
}
//67 曾祖母
else if ("67".equals(value)) {
result = 8;
}
//68 配偶的曾祖父母
else if ("68".equals(value)) {
result = 8;
}
//69 其它祖父母或外祖父母关系
else if ("69".equals(value)) {
result = 8;
}
//70 兄弟姐妹
else if ("70".equals(value)) {
result = 7;
}
//71 兄
else if ("71".equals(value)) {
result = 7;
}
//72 嫂
else if ("72".equals(value)) {
result = 8;
}
//73 弟
else if ("73".equals(value)) {
result = 7;
}
//74 弟媳
else if ("74".equals(value)) {
result = 8;
}
//75 姐姐
else if ("75".equals(value)) {
result = 7;
}
//76 姐夫
else if ("76".equals(value)) {
result = 8;
}
//77 妹妹
else if ("77".equals(value)) {
result = 7;
}
//78 妹夫
else if ("78".equals(value)) {
result = 8;
}
//79 其它兄弟姐妹
else if ("79".equals(value)) {
result = 8;
} else {
//下面的关系都是其他
result = 8;
}
return result;
// 81 伯父
// 82 伯母
// 83 叔父
// 84 婶母
// 85 舅父
// 86 舅母
// 87 姨父
// 88 姨母
// 89 姑父
// 90 姑母
// 91 堂兄弟,堂姐妹
// 92 表兄弟,表姐妹
// 93 侄子
// 94 侄女
// 95 外甥
// 96 外甥女
// 97 其他亲属
// 98 保姆
// 99 非亲属
}
}

@ -0,0 +1,35 @@
package com.wt.dataToDBs.v3.catchs;
import com.wt.dataToDBs.v3.pojo.VillageBaseInfo;
import java.util.ArrayList;
import java.util.List;
public class VillageCatch {
private VillageCatch() {
}
private static class VillageHolder {
private static VillageCatch villageOwnerInstance = new VillageCatch();
}
public static VillageCatch getInstance() {
return VillageHolder.villageOwnerInstance;
}
public List<VillageBaseInfo> getObj() {
if (obj == null) {
obj = new ArrayList<>();
}
return obj;
}
public void setObj(List<VillageBaseInfo> villageOwnerDbV3Map) {
this.obj = villageOwnerDbV3Map;
}
private List<VillageBaseInfo> obj = null;
}

@ -0,0 +1,64 @@
package com.wt.dataToDBs.v3.mapper;
import com.wt.dataToDBs.v3.pojo.OdsStandardAddress;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2023-08-22
*/
public interface OdsStandardAddressMapper {
/**
*
*
* @param id
* @return
*/
public OdsStandardAddress selectOdsStandardAddressById(Long id);
/**
*
*
* @param odsStandardAddress
* @return
*/
public List<OdsStandardAddress> selectOdsStandardAddressList(OdsStandardAddress odsStandardAddress);
/**
*
*
* @param odsStandardAddress
* @return
*/
public int insertOdsStandardAddress(OdsStandardAddress odsStandardAddress);
/**
*
*
* @param odsStandardAddress
* @return
*/
public int updateOdsStandardAddress(OdsStandardAddress odsStandardAddress);
/**
*
*
* @param id
* @return
*/
public int deleteOdsStandardAddressById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteOdsStandardAddressByIds(Long[] ids);
public List<OdsStandardAddress> selectAddressByStatus();
}

@ -0,0 +1,53 @@
package com.wt.dataToDBs.v3.mapper;
import com.wt.dataToDBs.v3.pojo.VillageBuildInfo;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2022-05-17
*/
public interface VillageBuildInfoMapper {
/**
*
*
* @param id
* @return
*/
public VillageBuildInfo selectVillageBuildInfoById(Long id);
/**
*
*
* @param villageBuildInfo
* @return
*/
public List<VillageBuildInfo> selectVillageBuildInfoList(VillageBuildInfo villageBuildInfo);
/**
*
*
* @param villageBuildInfo
* @return
*/
public int insertVillageBuildInfo(VillageBuildInfo villageBuildInfo);
/**
*
*
* @param villageBuildInfo
* @return
*/
public int updateVillageBuildInfo(VillageBuildInfo villageBuildInfo);
public VillageBuildInfo selectBeansByCode(VillageBuildInfo bean);
public int updateBeansByCode(VillageBuildInfo bean);
public String getLastDigits(VillageBuildInfo bean);
}

@ -0,0 +1,52 @@
package com.wt.dataToDBs.v3.mapper;
import com.wt.dataToDBs.v3.pojo.VillageGridInfo;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2022-05-17
*/
public interface VillageGridInfoMapper {
/**
*
*
* @param id
* @return
*/
public VillageGridInfo selectVillageGridInfoById(Long id);
/**
*
*
* @param villageGridInfo
* @return
*/
public List<VillageGridInfo> selectVillageGridInfoList(VillageGridInfo villageGridInfo);
/**
*
*
* @param villageGridInfo
* @return
*/
public int insertVillageGridInfo(VillageGridInfo villageGridInfo);
/**
*
*
* @param villageGridInfo
* @return
*/
public int updateVillageGridInfo(VillageGridInfo villageGridInfo);
public VillageGridInfo selectBeansByCode(VillageGridInfo bean);
public int updateBeansByCode(VillageGridInfo bean);
public String getLastDigits(VillageGridInfo bean);
}

@ -70,4 +70,10 @@ public interface VillageHomeInfoMapper {
* Created by on 2022/8/9
*/
int deleteVillageHomeInfoByVillageCode(String villageCode);
public VillageHomeInfo selectBeansByCode(VillageHomeInfo bean);
public int updateBeansByCode(VillageHomeInfo bean);
public String getLastDigits(VillageHomeInfo bean);
}

@ -0,0 +1,61 @@
package com.wt.dataToDBs.v3.mapper;
import com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
*
*
* @author chglee
* @email 1992lcg@163.com
* @date 2017-10-03 16:17:48
*/
@Mapper
public interface VillageJwzUserInfoDao {
/**
*
*/
public VillageJwzUserInfoDo selectVillageJwzUserInfoById(Long id);
public VillageJwzUserInfoDo selectVillageJwzUserInfoByIdcard(String id);
/**
*
*/
public List<VillageJwzUserInfoDo> selectVillageJwzUserInfoList(VillageJwzUserInfoDo bean);
/**
*
*/
public int insertVillageJwzUserInfo(VillageJwzUserInfoDo bean);
/**
*
*/
public int updateVillageJwzUserInfo(VillageJwzUserInfoDo bean);
public int updateVillageJwzUserInfoByIdcard(VillageJwzUserInfoDo bean);
/**
*
*/
public int deleteVillageJwzUserInfoById(Long id);
public int deleteVillageJwzUserInfoByUpdatetime(VillageJwzUserInfoDo bean);
/**
*
*
* @param ids
* @return
*/
public int deleteVillageJwzUserInfoByIds(Long[] ids);
public List<VillageJwzUserInfoDo> list(Map<String, Object> map);
}

@ -45,4 +45,6 @@ public interface VillageSendRecordStaticDao {
*
*/
public List<VillageSendRecordStatic> getList(Map<String, Object> map);
public List<VillageSendRecordStatic> getLastRecord(VillageSendRecordStatic bean);
}

@ -0,0 +1,53 @@
package com.wt.dataToDBs.v3.mapper;
import com.wt.dataToDBs.v3.pojo.VillageUnitInfo;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2022-05-17
*/
public interface VillageUnitInfoMapper {
/**
*
*
* @param id
* @return
*/
public VillageUnitInfo selectVillageUnitInfoById(Long id);
/**
*
*
* @param villageUnitInfo
* @return
*/
public List<VillageUnitInfo> selectVillageUnitInfoList(VillageUnitInfo villageUnitInfo);
/**
*
*
* @param villageUnitInfo
* @return
*/
public int insertVillageUnitInfo(VillageUnitInfo villageUnitInfo);
/**
*
*
* @param villageUnitInfo
* @return
*/
public int updateVillageUnitInfo(VillageUnitInfo villageUnitInfo);
public VillageUnitInfo selectBeansByCode(VillageUnitInfo bean);
public int updateBeansByCode(VillageUnitInfo bean);
public String getLastDigits(VillageUnitInfo bean);
}

@ -85,4 +85,5 @@ public interface VillageUserInfoMapper {
public List<VillageUserInfo> userArchivesTask(VillageUserInfo userInfo);
public List<VillageUserInfo> userArchivesTaskNotIn(VillageUserInfo userInfo);
public int deleteVillageUserInfoByUpdatetime(VillageUserInfo bean);
}

@ -0,0 +1,153 @@
package com.wt.dataToDBs.v3.pojo;
import lombok.Data;
/**
* ods_standard_address
*
* @author ruoyi
* @date 2023-08-22
*/
@Data
public class OdsStandardAddress {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
*
*/
//@Excel(name = "采集人员")
private String cjry;
/**
*
*/
//@Excel(name = "地址对象名称")
private String dzdxmc;
/**
* rys
*/
//@Excel(name = "rys")
private String rys;
/**
*
*/
//@Excel(name = "原始库主键")
private String dzdxid;
/**
* /
*/
//@Excel(name = "启用/停用日期")
private String qtyrq;
/**
*
*/
//@Excel(name = "几何中心点纬度")
private String dwdwdzb;
/**
*
*/
//@Excel(name = "几何中心点经度")
private String dwdjdzb;
/**
*
*/
//@Excel(name = "坐标")
private String zb;
/**
* id
*/
//@Excel(name = "地址元素id")
private String dzysid;
/**
* /
*/
//@Excel(name = "启用/停用标志")
private String qtybz;
/**
*
*/
//@Excel(name = "本地行政代码")
private String ssjgdm;
/**
*
*/
//@Excel(name = "地址对象通用名称")
private String dzdxtymc;
/**
*
*/
//@Excel(name = "地址元素类型")
private String dzyslx;
/**
*
*/
//@Excel(name = "审核人员")
private String shry;
/**
*
*/
//@Excel(name = "所属责任区的机构代码")
private String zrqdm;
/**
* id
*/
//@Excel(name = "上级地址元素id")
private String sjdzysid;
/**
* 1 2 3
*/
//@Excel(name = "审核状态1未审核 2不通过 3通过")
private String shzt;
/**
* 12
*/
//@Excel(name = "房屋维护状态1未维护2已维护")
private String whzt;
/**
*
*/
//@Excel(name = "地址元素级别")
private String dzysjb;
/**
*
*/
//@Excel(name = "地址元素状态")
private String dzyszt;
/**
* 0 1
*/
private String isdelete;
/**
* 0:,1:
*/
//@Excel(name = "0:不活跃,1:活跃")
private Integer isactive;
private String status;
}

@ -0,0 +1,154 @@
package com.wt.dataToDBs.v3.pojo;
import lombok.Data;
import java.math.BigDecimal;
/**
* village_build_info
*
* village_namegrid_namebuilding_nameunit_numhome_num
*
* @author ruoyi
* @date 2022-05-17
*/
@Data
public class VillageBuildInfo {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
*
*/
////@Excel(name = "小区编码")
private String villageCode;
/**
*
*/
//@Excel(name = "小区名称*")
private String villageName;
/**
*
*/
//@Excel(name = "网格名称*")
private String gridName;
/**
*
*/
//@Excel(name = "楼栋名称*")
private String buildingName;
//@Excel(name = "单元数量*")
private Long unitNum;
//@Excel(name = "户室数量*")
private Long homeNum;
/**
*
*/
//@Excel(name = "建筑面积")
private String floorAcreage;
/**
*
*/
//@Excel(name = "地上层数")
private Long upFloor;
/**
*
*/
//@Excel(name = "地下层数")
private Long belowFloor;
/**
*
*/
//@Excel(name = "楼栋类型", comboWt = "building_type")
private String buildingTypeCn;
/**
*
*/
//@Excel(name = "经度")
private BigDecimal longitude;
/**
*
*/
//@Excel(name = "纬度")
private BigDecimal latitude;
/**
*
*/
//@Excel(name = "楼栋地址")
private String buildingAddress;
/**
*
*/
////@Excel(name = "网格编码")
private String gridCode;
/**
*
*/
////@Excel(name = "楼栋编码")
private String buildingCode;
/**
*
*/
private Integer buildingType;
/**
*
*/
private Integer buildingStatus;
/**
*
*/
////@Excel(name = "启用状态", comboWt = "building_status")
private String buildingStatusCn;
private String createtime;
private String createby;
private String updatetime;
private String updateby;
/**
* 0:,1:
*/
private Integer isactive;
/**
* c1
*/
private String c1;
/**
* c2
*/
private String c2;
/**
* c3
*/
private String c3;
/**
* c4
*/
private String c4;
/**
* c5
*/
private String c5;
private String idsIn;
private String c1New;
}

@ -0,0 +1,129 @@
package com.wt.dataToDBs.v3.pojo;
import lombok.Data;
/**
* village_grid_info
*
* @author ruoyi
* @date 2022-05-17
*/
@Data
public class VillageGridInfo {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
*
*/
private String villageCode;
/**
*
*/
//@Excel(name = "小区名称*")
private String villageName;
/**
*
*/
private String provinceCode;
/**
*
*/
private String provinceName;
/**
*
*/
private String cityCode;
/**
*
*/
private String cityName;
/**
*
*/
private String areaCode;
/**
*
*/
private String areaName;
/**
* /
*/
private String streetCode;
/**
* /
*/
private String streetName;
/**
* /
*/
private String blockCode;
/**
* /
*/
private String blockName;
/**
*
*/
private String gridCode;
/**
*
*/
//@Excel(name = "网格名称*")
private String gridName;
private String createtime;
private String createby;
private String updatetime;
private String updateby;
/**
* 0:,1:
*/
private Integer isactive;
/**
* c1
*/
private String c1;
/**
* c2
*/
private String c2;
/**
* c3
*/
private String c3;
/**
* c4
*/
private String c4;
/**
* c5
*/
private String c5;
private String c1New;
private String idsIn;
}

@ -1,6 +1,6 @@
package com.wt.dataToDBs.v3.pojo;
import com.wt.dataToDBs.tool.StringKit;
import lombok.Data;
/**
* village_home_info
@ -8,6 +8,7 @@ import com.wt.dataToDBs.tool.StringKit;
* @author ruoyi
* @date 2022-05-17
*/
@Data
public class VillageHomeInfo {
private static final long serialVersionUID = 1L;
@ -215,6 +216,7 @@ public class VillageHomeInfo {
// //@Excel(name = "房间数量")
private String roomNum;
private String c1New;
// private Long carNum;
// private String waterSum;
// private String elecmeterSum;
@ -225,393 +227,4 @@ public class VillageHomeInfo {
//
// private Boolean isExport;
public String getPropertyOwnerPhoneCn() {
return propertyOwnerPhoneCn;
}
public void setPropertyOwnerPhoneCn(String propertyOwnerPhoneCn) {
this.propertyOwnerPhoneCn = propertyOwnerPhoneCn;
}
// public String getCaringLabel() {
// return caringLabel;
// }
//
// public void setCaringLabel(String caringLabel) {
// this.caringLabel = caringLabel;
// }
//
// public String getImpUserType() {
// return impUserType;
// }
//
// public void setImpUserType(String impUserType) {
// this.impUserType = impUserType;
// }
//
// public String getCaringLabelCn() {
// return caringLabelCn;
// }
//
// public void setCaringLabelCn(String caringLabelCn) {
// this.caringLabelCn = caringLabelCn;
// }
//
// public String getWaterSum() {
// return waterSum;
// }
//
// public void setWaterSum(String waterSum) {
// this.waterSum = waterSum;
// }
//
// public String getElecmeterSum() {
// return elecmeterSum;
// }
//
// public void setElecmeterSum(String elecmeterSum) {
// this.elecmeterSum = elecmeterSum;
// }
//
// public Long getCarNum() {
// return carNum;
// }
//
// public void setCarNum(Long carNum) {
// this.carNum = carNum;
// }
public String getRoomNum() {
return roomNum;
}
public void setRoomNum(String roomNum) {
this.roomNum = StringKit.toString(roomNum);
}
public String getIdsIn() {
return idsIn;
}
public void setIdsIn(String idsIn) {
this.idsIn = StringKit.toString(idsIn);
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getHomeTypeCn() {
return homeTypeCn;
}
public void setHomeTypeCn(String homeTypeCn) {
this.homeTypeCn = StringKit.toString(homeTypeCn);
}
public String getHomeCategoryCn() {
return homeCategoryCn;
}
public void setHomeCategoryCn(String homeCategoryCn) {
this.homeCategoryCn = StringKit.toString(homeCategoryCn);
}
public String getHomeUseCn() {
return homeUseCn;
}
public void setHomeUseCn(String homeUseCn) {
this.homeUseCn = StringKit.toString(homeUseCn);
}
public String getHomeStateCn() {
return homeStateCn;
}
public void setHomeStateCn(String homeStateCn) {
this.homeStateCn = StringKit.toString(homeStateCn);
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getVillageCode() {
return villageCode;
}
public void setVillageCode(String villageCode) {
this.villageCode = StringKit.toString(villageCode);
}
public String getVillageName() {
return villageName;
}
public void setVillageName(String villageName) {
this.villageName = StringKit.toString(villageName);
}
public String getBuildingCode() {
return buildingCode;
}
public void setBuildingCode(String buildingCode) {
this.buildingCode = StringKit.toString(buildingCode);
}
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = StringKit.toString(buildingName);
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = StringKit.toString(unitCode);
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = StringKit.toString(unitName);
}
public String getHomeCode() {
return homeCode;
}
public void setHomeCode(String homeCode) {
this.homeCode = StringKit.toString(homeCode);
}
public String getHomeName() {
return homeName;
}
public void setHomeName(String homeName) {
this.homeName = StringKit.toString(homeName);
}
public Long getHomeFloor() {
return homeFloor;
}
public void setHomeFloor(Long homeFloor) {
this.homeFloor = homeFloor;
}
public String getHomeAdddress() {
return homeAdddress;
}
public void setHomeAdddress(String homeAdddress) {
this.homeAdddress = StringKit.toString(homeAdddress);
}
public String getHomeAcreage() {
return homeAcreage;
}
public void setHomeAcreage(String homeAcreage) {
this.homeAcreage = StringKit.toString(homeAcreage);
}
public String getInsideAcreage() {
return insideAcreage;
}
public void setInsideAcreage(String insideAcreage) {
this.insideAcreage = StringKit.toString(insideAcreage);
}
public Integer getHomeType() {
return homeType;
}
public void setHomeType(Integer homeType) {
this.homeType = homeType;
}
public Integer getHomeCategory() {
return homeCategory;
}
public void setHomeCategory(Integer homeCategory) {
this.homeCategory = homeCategory;
}
public Integer getHomeUse() {
return homeUse;
}
public void setHomeUse(Integer homeUse) {
this.homeUse = homeUse;
}
public Long getHomePersonNum() {
return homePersonNum;
}
public void setHomePersonNum(Long homePersonNum) {
this.homePersonNum = homePersonNum;
}
public String getHomeDoorModel() {
return homeDoorModel;
}
public void setHomeDoorModel(String homeDoorModel) {
this.homeDoorModel = StringKit.toString(homeDoorModel);
}
public Integer getHomeState() {
return homeState;
}
public void setHomeState(Integer homeState) {
this.homeState = homeState;
}
public String getCertificateCode() {
return certificateCode;
}
public void setCertificateCode(String certificateCode) {
this.certificateCode = StringKit.toString(certificateCode);
}
public String getPropertyOwner() {
return propertyOwner;
}
public void setPropertyOwner(String propertyOwner) {
this.propertyOwner = StringKit.toString(propertyOwner);
}
public String getPropertyOwnerPhone() {
return propertyOwnerPhone;
}
public void setPropertyOwnerPhone(String propertyOwnerPhone) {
this.propertyOwnerPhone = StringKit.toString(propertyOwnerPhone);
}
public String getCreatetime() {
return createtime;
}
public void setCreatetime(String createtime) {
this.createtime = createtime;
}
public String getCreateby() {
return createby;
}
public void setCreateby(String createby) {
this.createby = createby;
}
public String getUpdatetime() {
return updatetime;
}
public void setUpdatetime(String updatetime) {
this.updatetime = updatetime;
}
public String getUpdateby() {
return updateby;
}
public void setUpdateby(String updateby) {
this.updateby = updateby;
}
public Integer getIsactive() {
return isactive;
}
public void setIsactive(Integer isactive) {
this.isactive = isactive;
}
public String getC1() {
return c1;
}
public void setC1(String c1) {
this.c1 = c1;
}
public String getC2() {
return c2;
}
public void setC2(String c2) {
this.c2 = c2;
}
public String getC3() {
return c3;
}
public void setC3(String c3) {
this.c3 = c3;
}
public String getC4() {
return c4;
}
public void setC4(String c4) {
this.c4 = c4;
}
public String getC5() {
return c5;
}
public void setC5(String c5) {
this.c5 = c5;
}
// public Boolean getExport() {
// return isExport;
// }
//
// public void setExport(Boolean export) {
// isExport = export;
// }
public String getGridCode() {
return gridCode;
}
public void setGridCode(String gridCode) {
this.gridCode = gridCode;
}
public String getGridName() {
return gridName;
}
public void setGridName(String gridName) {
this.gridName = gridName;
}
}

@ -0,0 +1,62 @@
package com.wt.dataToDBs.v3.pojo;
import lombok.Data;
/**
* TODO
*
* @author dinosuar
* @version 1.0
* @date 2021/2/24 15:04
**/
@Data
public class VillageJwzUserInfoDo {
/** 主键 */
private Long id;
/**与户主关系*/
private String householderRelation;
/**学历(文化程度)*/
private String education;
/**宗教信仰*/
private String religious;
/**婚姻状况*/
private String marriage;
/**政治面貌*/
private String politicalOutlook;
/**管理状态*/
private String managementStatus;
/**照片*/
private String userPic;
/**人员姓名*/
private String userName;
/**移动号码*/
private String phone;
/**户号*/
private String accountNumber;
/**联系电话*/
private String landline;
/**证件号码*/
private String idCard;
/**户籍地址_省市县*/
private String houseHoldRegister;
/**户籍地址_区划内详细地址*/
private String houseHoldAddress;
/**配偶姓名*/
private String spouseName;
/**配偶身份证*/
private String spouseIdCard;
/**父亲姓名*/
private String fatherName;
/**父亲身份证号码*/
private String fatherIdCard;
/**母亲姓名*/
private String motherName;
/**母亲身份证号码*/
private String motherIdCard;
/**警务区编码*/
private String policeDistrictCode;
private String isactive;
}

@ -0,0 +1,113 @@
package com.wt.dataToDBs.v3.pojo;
import lombok.Data;
/**
* village_unit_info
* village_namebuilding_nameunit_name
*
* @author ruoyi
* @date 2022-05-17
*/
@Data
public class VillageUnitInfo {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
*
*/
////@Excel(name = "小区编码")
private String villageCode;
/**
*
*/
//@Excel(name = "小区名称*")
private String villageName;
/**
*
*/
////@Excel(name = "网格编码")
private String gridCode;
/**
*
*/
//@Excel(name = "网格名称*")
private String gridName;
/**
*
*/
////@Excel(name = "楼栋编码")
private String buildingCode;
/**
*
*/
//@Excel(name = "楼栋名称*")
private String buildingName;
/**
*
*/
////@Excel(name = "单元编码")
private String unitCode;
/**
*
*/
//@Excel(name = "单元名称*")
private String unitName;
/**
*
*/
//@Excel(name = "单元地址")
private String unitAddress;
private String createtime;
private String createby;
private String updatetime;
private String updateby;
/**
* 0:,1:
*/
private Integer isactive;
/**
* c1
*/
private String c1;
/**
* c2
*/
private String c2;
/**
* c3
*/
private String c3;
/**
* c4
*/
private String c4;
/**
* c5
*/
private String c5;
private String idsIn;
private String c1New;
}

@ -389,7 +389,15 @@ public class VillageUserInfo {
//是否全息档案请求
private String enabledArchives;
private String updatetimeV;
public String getUpdatetimeV() {
return updatetimeV;
}
public void setUpdatetimeV(String updatetimeV) {
this.updatetimeV = updatetimeV;
}
public String getC2New() {
return c2New;

@ -0,0 +1,66 @@
package com.wt.dataToDBs.v3.service;
import com.wt.dataToDBs.v3.pojo.OdsStandardAddress;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2023-08-22
*/
public interface IOdsStandardAddressService {
/**
*
*
* @param id
* @return
*/
public OdsStandardAddress selectOdsStandardAddressById(Long id);
/**
*
*
* @param odsStandardAddress
* @return
*/
public List<OdsStandardAddress> selectOdsStandardAddressList(OdsStandardAddress odsStandardAddress);
/**
*
*
* @param odsStandardAddress
* @return
*/
public int insertOdsStandardAddress(OdsStandardAddress odsStandardAddress);
/**
*
*
* @param odsStandardAddress
* @return
*/
public int updateOdsStandardAddress(OdsStandardAddress odsStandardAddress);
/**
*
*
* @param ids
* @return
*/
public int deleteOdsStandardAddressByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteOdsStandardAddressById(Long id);
public List<OdsStandardAddress> selectAddressByStatus();
public void handleOdsStandardAddress(OdsStandardAddress odsStandardAddress);
}

@ -0,0 +1,38 @@
package com.wt.dataToDBs.v3.service;
import com.wt.dataToDBs.v3.pojo.VillageBuildInfo;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2022-05-17
*/
public interface IVillageBuildInfoService {
/**
*
*
* @param id
* @return
*/
public VillageBuildInfo selectVillageBuildInfoById(Long id);
/**
*
*
* @param villageBuildInfo
* @return
*/
public List<VillageBuildInfo> selectVillageBuildInfoList(VillageBuildInfo villageBuildInfo);
public VillageBuildInfo selectBeansByCode(VillageBuildInfo bean);
public int updateBeansByCode(VillageBuildInfo bean);
public String getLastDigits(VillageBuildInfo bean);
public int saveOrUpdate(VillageBuildInfo beanToDb);
}

@ -0,0 +1,38 @@
package com.wt.dataToDBs.v3.service;
import com.wt.dataToDBs.v3.pojo.VillageGridInfo;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2022-05-17
*/
public interface IVillageGridInfoService {
/**
*
*
* @param id
* @return
*/
public VillageGridInfo selectVillageGridInfoById(Long id);
/**
*
*
* @param villageGridInfo
* @return
*/
public List<VillageGridInfo> selectVillageGridInfoList(VillageGridInfo villageGridInfo);
public VillageGridInfo selectBeansByCode(VillageGridInfo bean);
public int updateBeansByCode(VillageGridInfo bean);
public String getLastDigits(VillageGridInfo bean);
public int saveOrUpdate(VillageGridInfo beanToDb);
}

@ -0,0 +1,38 @@
package com.wt.dataToDBs.v3.service;
import com.wt.dataToDBs.v3.pojo.VillageUnitInfo;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2022-05-17
*/
public interface IVillageUnitInfoService {
/**
*
*
* @param id
* @return
*/
public VillageUnitInfo selectVillageUnitInfoById(Long id);
/**
*
*
* @param villageUnitInfo
* @return
*/
public List<VillageUnitInfo> selectVillageUnitInfoList(VillageUnitInfo villageUnitInfo);
public VillageUnitInfo selectBeansByCode(VillageUnitInfo bean);
public int updateBeansByCode(VillageUnitInfo bean);
public String getLastDigits(VillageUnitInfo bean);
public int saveOrUpdate(VillageUnitInfo beanToDb);
}

@ -0,0 +1,77 @@
package com.wt.dataToDBs.v3.service;
import com.wt.dataToDBs.v3.pojo.VillageHomeInfo;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2022-05-17
*/
public interface VillageHomeInfoFromService {
/**
*
*
* @param id
* @return
*/
public VillageHomeInfo selectVillageHomeInfoById(Long id);
/**
*
*
* @param villageHomeInfo
* @return
*/
public List<VillageHomeInfo> selectVillageHomeInfoList(VillageHomeInfo villageHomeInfo);
// /**
// * 新增房屋信息
// *
// * @param villageHomeInfo 房屋信息
// * @return 结果
// */
// public int insertVillageHomeInfo(VillageHomeInfo villageHomeInfo);
//
// /**
// * 修改房屋信息
// *
// * @param villageHomeInfo 房屋信息
// * @return 结果
// */
// public int updateVillageHomeInfo(VillageHomeInfo villageHomeInfo);
//
// /**
// * 批量删除房屋信息
// *
// * @param ids 需要删除的房屋信息主键集合
// * @return 结果
// */
// public int deleteVillageHomeInfoByIds(String ids);
//
// /**
// * 删除房屋信息
// *
// * @param id 房屋信息主键
// * @return 结果
// */
// public int deleteVillageHomeInfoById(Long id);
//
// public String importBase(List<VillageHomeInfo> userList, Boolean isUpdateSupport, String operName);
//
// public String checkPara(VillageHomeInfo villageHomeInfo, String res);
//
// public void aesEncrypt(VillageHomeInfo v);
//
// public void aesDecryptNoDesensitiza(VillageHomeInfo v);
//
// public void aesDecrypt(VillageHomeInfo v);
//
// public void getDict(List<VillageHomeInfo> list);
//
// public int logicDelete(String ids);
//
// public void setDicData(VillageHomeInfo v);
}

@ -27,51 +27,12 @@ public interface VillageHomeInfoService {
*/
public List<VillageHomeInfo> selectVillageHomeInfoList(VillageHomeInfo villageHomeInfo);
// /**
// * 新增房屋信息
// *
// * @param villageHomeInfo 房屋信息
// * @return 结果
// */
// public int insertVillageHomeInfo(VillageHomeInfo villageHomeInfo);
//
// /**
// * 修改房屋信息
// *
// * @param villageHomeInfo 房屋信息
// * @return 结果
// */
// public int updateVillageHomeInfo(VillageHomeInfo villageHomeInfo);
//
// /**
// * 批量删除房屋信息
// *
// * @param ids 需要删除的房屋信息主键集合
// * @return 结果
// */
// public int deleteVillageHomeInfoByIds(String ids);
//
// /**
// * 删除房屋信息
// *
// * @param id 房屋信息主键
// * @return 结果
// */
// public int deleteVillageHomeInfoById(Long id);
//
// public String importBase(List<VillageHomeInfo> userList, Boolean isUpdateSupport, String operName);
//
// public String checkPara(VillageHomeInfo villageHomeInfo, String res);
//
// public void aesEncrypt(VillageHomeInfo v);
//
// public void aesDecryptNoDesensitiza(VillageHomeInfo v);
//
// public void aesDecrypt(VillageHomeInfo v);
//
// public void getDict(List<VillageHomeInfo> list);
//
// public int logicDelete(String ids);
//
// public void setDicData(VillageHomeInfo v);
public VillageHomeInfo selectBeansByCode(VillageHomeInfo bean);
public int updateBeansByCode(VillageHomeInfo bean);
public String getLastDigits(VillageHomeInfo bean);
public int saveOrUpdate(VillageHomeInfo beanToDb);
}

@ -0,0 +1,53 @@
package com.wt.dataToDBs.v3.service;
import com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo;
import java.util.List;
/**
*
*
* @author chglee
* @email 1992lcg@163.com
* @date 2017-09-09 10:03:34
*/
public interface VillageJwzUserInfoService {
/**
*
*/
public VillageJwzUserInfoDo selectVillageJwzUserInfoById(Long id);
/**
*
*/
public List<VillageJwzUserInfoDo> selectVillageJwzUserInfoList(VillageJwzUserInfoDo VillageJwzUserInfo);
public VillageJwzUserInfoDo selectVillageJwzUserInfoByIdcard(String idcard);
/**
*
*/
public int insertVillageJwzUserInfo(VillageJwzUserInfoDo VillageJwzUserInfo);
/**
*
*/
public int updateVillageJwzUserInfo(VillageJwzUserInfoDo VillageJwzUserInfo);
public int updateVillageJwzUserInfoByIdcard(VillageJwzUserInfoDo bean);
/**
*
*/
public int deleteVillageJwzUserInfoByIds(Long[] ids);
/**
*
*/
public int deleteVillageJwzUserInfoById(Long id);
public int deleteVillageJwzUserInfoByUpdatetime(VillageJwzUserInfoDo bean);
}

@ -44,6 +44,7 @@ public interface VillageUserInfoService {
* @return
*/
public int updateVillageUserInfo(VillageUserInfo villageUserInfo);
public int saveOrUpdate(VillageUserInfo villageUserInfo);
/**
*
@ -60,6 +61,8 @@ public interface VillageUserInfoService {
* @return
*/
public int deleteVillageUserInfoById(Long id);
public int deleteVillageUserInfoByUpdatetime(VillageUserInfo bean);
//
// public String importBase(List<VillageUserInfo> userList, Boolean isUpdateSupport, String operName);
//

@ -0,0 +1,321 @@
package com.wt.dataToDBs.v3.service.impl;
import com.wt.dataToDBs.tool.NumKit;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.v3.catchs.VillageCatch;
import com.wt.dataToDBs.v3.mapper.OdsStandardAddressMapper;
import com.wt.dataToDBs.v3.pojo.*;
import com.wt.dataToDBs.v3.service.*;
import com.wt.dataToDBs.v3.task.CatchV3Task;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2023-08-22
*/
@Service
@RequiredArgsConstructor
public class OdsStandardAddressServiceImpl implements IOdsStandardAddressService {
private static final Logger logger = LoggerFactory.getLogger(OdsStandardAddressServiceImpl.class);
private final OdsStandardAddressMapper odsStandardAddressMapper;
private final IVillageBuildInfoService buildInfoService;
private final IVillageGridInfoService gridInfoService;
private final IVillageUnitInfoService unitInfoService;
private final VillageHomeInfoService homeInfoService;
private final CatchV3Task catchV3Task;
/**
*
*
* @param id
* @return
*/
@Override
public OdsStandardAddress selectOdsStandardAddressById(Long id) {
return odsStandardAddressMapper.selectOdsStandardAddressById(id);
}
/**
*
*
* @param odsStandardAddress
* @return
*/
@Override
public List<OdsStandardAddress> selectOdsStandardAddressList(OdsStandardAddress odsStandardAddress) {
return odsStandardAddressMapper.selectOdsStandardAddressList(odsStandardAddress);
}
/**
*
*
* @param odsStandardAddress
* @return
*/
@Override
public int insertOdsStandardAddress(OdsStandardAddress odsStandardAddress) {
return odsStandardAddressMapper.insertOdsStandardAddress(odsStandardAddress);
}
/**
*
*
* @param odsStandardAddress
* @return
*/
@Override
public int updateOdsStandardAddress(OdsStandardAddress odsStandardAddress) {
return odsStandardAddressMapper.updateOdsStandardAddress(odsStandardAddress);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteOdsStandardAddressByIds(Long[] ids) {
return odsStandardAddressMapper.deleteOdsStandardAddressByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteOdsStandardAddressById(Long id) {
return odsStandardAddressMapper.deleteOdsStandardAddressById(id);
}
@Override
public List<OdsStandardAddress> selectAddressByStatus() {
return odsStandardAddressMapper.selectAddressByStatus();
}
@Override
public void handleOdsStandardAddress(OdsStandardAddress odsStandardAddress) {
//处理地址数据 存入系统 可以调用汇聚平台的接口
List<OdsStandardAddress> addressList = selectAddressByStatus();
for (OdsStandardAddress address : addressList) {
handleOdsStandardAddressEach(address);
}
}
private void handleOdsStandardAddressEach(OdsStandardAddress odsStandardAddress) {
String villageAddress = odsStandardAddress.getDzdxmc();//标准地址
//将字符串中的 一单元 替换成 1单元
villageAddress = StringKit.convertChineseUnitToDigit(villageAddress);
String home = "";
try {
home = StringKit.extractDigits(villageAddress.substring(0, villageAddress.indexOf("室")));
} catch (Exception e) {
home = "";
}
String unit = "";
try {
unit = StringKit.extractDigits(villageAddress.substring(0, villageAddress.indexOf("单元")));
} catch (Exception e) {
unit = "";
}
String build = "";
try {
build = StringKit.extractDigits(villageAddress.substring(0, villageAddress.indexOf("幢")));
} catch (Exception e) {
build = "";
}
String address = "";
try {
int index = villageAddress.indexOf("号");
if (index != -1) {
address = villageAddress.substring(0, index);
}
} catch (Exception e) {
logger.info("小区地址未匹配到请求中户籍地址:" + build);
return;
}
//处理数据的逻辑
List<VillageBaseInfo> baseInfos = VillageCatch.getInstance().getObj();
//如果缓存是空的,直接执行一次 塞数据
if (baseInfos != null && baseInfos.size() > 0) {
} else {
catchV3Task.transBaseInfo();
baseInfos = VillageCatch.getInstance().getObj();
}
List<VillageBaseInfo> baseInfoListCatchResult = CatchV3Task.getVillageBaseInfoByAddress(baseInfos, address);
if (baseInfoListCatchResult != null && baseInfoListCatchResult.size() > 0) {
System.out.println("标准地址:" + villageAddress + ",获取到匹配的小区:" + baseInfoListCatchResult.get(0).getVillageName()
+ ",楼栋:" + build + ",单元:" + unit + ",户室:" + home);
String addressSub = "";
if (villageAddress.contains("号")) {
int end = villageAddress.indexOf("号") + 1; // 获取号字的索引位置
addressSub = villageAddress.substring(0, end); // 从字符串开始位置截取到号字的前一个字符
} else {
addressSub = odsStandardAddress.getDzdxmc();
}
VillageBaseInfo baseInfo = baseInfoListCatchResult.get(0);
VillageHomeInfo homeInfoCheck = null;
VillageUnitInfo unitInfoCheck = null;
VillageBuildInfo buildInfoCheck = null;
VillageGridInfo gridInfoCheck = null;
VillageHomeInfo homeInfoPara = new VillageHomeInfo();
VillageUnitInfo unitInfoPara = new VillageUnitInfo();
VillageBuildInfo buildInfoPara = new VillageBuildInfo();
VillageGridInfo gridInfoPara = new VillageGridInfo();
//将匹配到的结果 通过请求汇聚平台接口加到平台中去
homeInfoPara.setVillageCode(baseInfoListCatchResult.get(0).getVillageCode());
homeInfoPara.setBuildingName(build);
homeInfoPara.setUnitName(unit);
homeInfoPara.setHomeName(home);
homeInfoCheck = homeInfoService.selectBeansByCode(homeInfoPara);
//如果房屋不存在
if (homeInfoCheck == null) {
//验证单元存不存在
unitInfoPara.setVillageCode(baseInfoListCatchResult.get(0).getVillageCode());
unitInfoPara.setBuildingName(build);
unitInfoPara.setUnitName(unit);
unitInfoCheck = unitInfoService.selectBeansByCode(unitInfoPara);
if (unitInfoCheck == null) {
//如果单元不存在 验证楼栋存不存在
buildInfoPara.setVillageCode(baseInfoListCatchResult.get(0).getVillageCode());
buildInfoPara.setBuildingName(build);
buildInfoCheck = buildInfoService.selectBeansByCode(buildInfoPara);
if (buildInfoCheck == null) {
//如果楼栋不存在 验证网格存不存在
gridInfoPara.setVillageCode(baseInfoListCatchResult.get(0).getVillageCode());
List<VillageGridInfo> gridInfoChecks = gridInfoService.selectVillageGridInfoList(gridInfoPara);
if (gridInfoChecks != null && gridInfoChecks.size() > 0) {
gridInfoCheck = gridInfoChecks.get(0);
}
}
}
}
VillageGridInfo gridInfo = null;
if (gridInfoCheck == null) {
//创建网格
gridInfo = new VillageGridInfo();
gridInfo.setVillageCode(baseInfo.getVillageCode());
gridInfo.setVillageName(baseInfo.getVillageName());
gridInfo.setProvinceCode(baseInfo.getProvinceCode());
gridInfo.setProvinceName(baseInfo.getProvinceName());
gridInfo.setCityCode(baseInfo.getCityCode());
gridInfo.setCityName(baseInfo.getCityName());
gridInfo.setAreaCode(baseInfo.getAreaCode());
gridInfo.setAreaName(baseInfo.getAreaName());
gridInfo.setStreetCode(baseInfo.getStreetCode());
gridInfo.setStreetName(baseInfo.getStreetName());
gridInfo.setBlockCode(baseInfo.getBlockCode());
gridInfo.setBlockName(baseInfo.getBlockName());
gridInfoService.saveOrUpdate(gridInfo);
}
VillageBuildInfo buildInfo = null;
if (buildInfoCheck == null && !"".equals(StringKit.toString(build))) {
if (gridInfo == null) {
gridInfo = gridInfoService.selectBeansByCode(gridInfoPara);
}
if (gridInfo != null) {
//创建楼栋
buildInfo = new VillageBuildInfo();
buildInfo.setVillageCode(gridInfo.getVillageCode());
buildInfo.setVillageName(gridInfo.getVillageName());
buildInfo.setGridCode(gridInfo.getGridCode());
buildInfo.setGridName(gridInfo.getGridName());
// buildInfo.setBuildingCode();
buildInfo.setBuildingName(build);
// buildInfo.setBuildingType();
buildInfo.setLongitude(NumKit.checkBigDecimal(odsStandardAddress.getDwdjdzb()));
buildInfo.setLatitude(NumKit.checkBigDecimal(odsStandardAddress.getDwdwdzb()));
// buildInfo.setUpFloor();
// buildInfo.setBelowFloor();
// buildInfo.setFloorAcreage();
buildInfo.setBuildingAddress(addressSub + build + "幢");
buildInfoService.saveOrUpdate(buildInfo);
}
}
VillageUnitInfo unitInfo = null;
if (unitInfoCheck == null && !"".equals(StringKit.toString(unit))) {
//创建单元
if (buildInfo == null) {
buildInfo = buildInfoService.selectBeansByCode(buildInfoPara);
}
if (buildInfo != null) {
//创建楼栋
unitInfo = new VillageUnitInfo();
unitInfo.setVillageCode(buildInfo.getVillageCode());
unitInfo.setVillageName(buildInfo.getVillageName());
unitInfo.setBuildingCode(buildInfo.getBuildingCode());
unitInfo.setBuildingName(buildInfo.getBuildingName());
// unitInfo.setUnitCode();
unitInfo.setUnitName(unit);
unitInfo.setUnitAddress(buildInfo.getBuildingAddress() + unit + "单元");
unitInfo.setGridCode(buildInfo.getGridCode());
unitInfo.setGridName(buildInfo.getGridName());
unitInfoService.saveOrUpdate(unitInfo);
}
}
VillageHomeInfo homeInfo = null;
if (homeInfoCheck == null && !"".equals(StringKit.toString(home))) {
//创建房屋
if (unitInfo == null) {
unitInfo = unitInfoService.selectBeansByCode(unitInfoPara);
}
if (unitInfo != null) {
//创建房屋
homeInfo = new VillageHomeInfo();
homeInfo.setVillageCode(unitInfo.getVillageCode());
homeInfo.setVillageName(unitInfo.getVillageName());
homeInfo.setBuildingCode(unitInfo.getBuildingCode());
homeInfo.setBuildingName(unitInfo.getBuildingName());
homeInfo.setUnitCode(unitInfo.getUnitCode());
homeInfo.setUnitName(unitInfo.getUnitName());
// homeInfo.setHomeCode();
homeInfo.setHomeName(home);
// homeInfo.setHomeFloor();
homeInfo.setHomeAdddress(unitInfo.getUnitAddress() + home + "栋");
// homeInfo.setHomeAcreage();
// homeInfo.setInsideAcreage();
// homeInfo.setHomeType();
// homeInfo.setHomeCategory();
// homeInfo.setHomeUse();
// homeInfo.setHomePersonNum();
// homeInfo.setHomeDoorModel();
// homeInfo.setHomeState();
// homeInfo.setCertificateCode();
// homeInfo.setPropertyOwner();
// homeInfo.setPropertyOwnerPhone();
homeInfo.setGridCode(unitInfo.getGridCode());
homeInfo.setGridName(unitInfo.getGridName());
homeInfoService.saveOrUpdate(homeInfo);
}
}
}
//处理结束将数据状态改掉
odsStandardAddress.setStatus("2");
odsStandardAddressMapper.updateOdsStandardAddress(odsStandardAddress);
}
}

@ -0,0 +1,114 @@
package com.wt.dataToDBs.v3.service.impl;
import com.wt.dataToDBs.tool.CodeUtil;
import com.wt.dataToDBs.tool.NumKit;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.v3.mapper.VillageBuildInfoMapper;
import com.wt.dataToDBs.v3.pojo.VillageBuildInfo;
import com.wt.dataToDBs.v3.service.IVillageBuildInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2022-05-17
*/
@Service
public class VillageBuildInfoServiceImpl implements IVillageBuildInfoService {
private static final Logger logger = LoggerFactory.getLogger(VillageBuildInfoServiceImpl.class);
@Resource
private VillageBuildInfoMapper villageBuildInfoMapper;
// private static String tableName = "village_build_info";
/**
*
*
* @param id
* @return
*/
@Override
public VillageBuildInfo selectVillageBuildInfoById(Long id) {
VillageBuildInfo v = villageBuildInfoMapper.selectVillageBuildInfoById(id);
return v;
}
/**
*
*
* @param villageBuildInfo
* @return
*/
@Override
public List<VillageBuildInfo> selectVillageBuildInfoList(VillageBuildInfo villageBuildInfo) {
List<VillageBuildInfo> list = villageBuildInfoMapper.selectVillageBuildInfoList(villageBuildInfo);
return list;
}
/**
* @param bean
* @return
*/
@Override
public VillageBuildInfo selectBeansByCode(VillageBuildInfo bean) {
VillageBuildInfo v = villageBuildInfoMapper.selectBeansByCode(bean);
return v;
}
@Override
public synchronized int updateBeansByCode(VillageBuildInfo bean) {
VillageBuildInfo beanCheck = selectBeansByCode(bean);
String versionCheck = StringKit.toString(beanCheck.getC1());
String c1 = "".equals(StringKit.toString(bean.getC1())) ? "1" : bean.getC1();
int version = NumKit.checkInt(c1);
bean.setC1(StringKit.toString(version));
bean.setC1New(StringKit.toString(version + 1));
if ("".equals(versionCheck) || c1.equals(versionCheck)) {
return villageBuildInfoMapper.updateBeansByCode(bean);
}
return 0;
}
public int saveOrUpdate(VillageBuildInfo beanToDb) {
try {
VillageBuildInfo bean = selectBeansByCode(beanToDb);
int res = 0;
if (bean == null) {
beanToDb.setC1("1");
String gridCode = beanToDb.getGridCode();//网格编码
String lastDigits = villageBuildInfoMapper.getLastDigits(beanToDb);
int lastBuildingNumberInDatabase = 000;//楼栋最新的编码的后三位
if ("".equals(StringKit.toString(lastDigits))) {
} else {
lastBuildingNumberInDatabase = NumKit.checkInt(lastDigits);
}
String buildingNumber = CodeUtil.generateNumber(gridCode, "build", lastBuildingNumberInDatabase);
beanToDb.setBuildingCode(buildingNumber);
res = villageBuildInfoMapper.insertVillageBuildInfo(beanToDb);
} else {
VillageBuildInfo beanUp = new VillageBuildInfo();
BeanUtils.copyProperties(beanToDb, beanUp);
updateBeansByCode(beanUp);
}
return res;
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
return 0;
}
}
@Override
public String getLastDigits(VillageBuildInfo bean) {
String v = villageBuildInfoMapper.getLastDigits(bean);
return v;
}
}

@ -0,0 +1,120 @@
package com.wt.dataToDBs.v3.service.impl;
import com.wt.dataToDBs.tool.CodeUtil;
import com.wt.dataToDBs.tool.NumKit;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.v3.mapper.VillageGridInfoMapper;
import com.wt.dataToDBs.v3.pojo.VillageGridInfo;
import com.wt.dataToDBs.v3.service.IVillageGridInfoService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author ruoyi
*/
@Service
@RequiredArgsConstructor
public class VillageGridInfoServiceImpl implements IVillageGridInfoService {
private static final Logger logger = LoggerFactory.getLogger(VillageGridInfoServiceImpl.class);
private final VillageGridInfoMapper villageGridInfoMapper;
private static String tableName = "village_grid_info";
/**
*
*
* @param id
* @return
*/
@Override
public VillageGridInfo selectVillageGridInfoById(Long id) {
VillageGridInfo v = villageGridInfoMapper.selectVillageGridInfoById(id);
//返回解密
// aesDecrypt(v);
return v;
}
/**
*
*
* @param villageGridInfo
* @return
*/
@Override
public List<VillageGridInfo> selectVillageGridInfoList(VillageGridInfo villageGridInfo) {
// getDict(list);
return villageGridInfoMapper.selectVillageGridInfoList(villageGridInfo);
}
/**
* @param bean
* @return
*/
@Override
public VillageGridInfo selectBeansByCode(VillageGridInfo bean) {
VillageGridInfo v = villageGridInfoMapper.selectBeansByCode(bean);
return v;
}
@Override
public synchronized int updateBeansByCode(VillageGridInfo bean) {
VillageGridInfo beanCheck = selectBeansByCode(bean);
String versionCheck = StringKit.toString(beanCheck.getC1());
String c1 = "".equals(StringKit.toString(bean.getC1())) ? "1" : bean.getC1();
int version = NumKit.checkInt(c1);
bean.setC1(StringKit.toString(version));
bean.setC1New(StringKit.toString(version + 1));
if ("".equals(versionCheck) || c1.equals(versionCheck)) {
return villageGridInfoMapper.updateBeansByCode(bean);
}
return 0;
}
public int saveOrUpdate(VillageGridInfo beanToDb) {
try {
VillageGridInfo bean = selectBeansByCode(beanToDb);
int res = 0;
if (bean == null) {
beanToDb.setC1("1");
String communityCode = beanToDb.getVillageCode();//小区编码
String lastDigits = villageGridInfoMapper.getLastDigits(beanToDb);
int lastGridNumberInDatabase = 00;//网格最新的编码的后两位
if ("".equals(StringKit.toString(lastDigits))) {
} else {
lastGridNumberInDatabase = NumKit.checkInt(lastDigits);
}
String gridNumber = CodeUtil.generateNumber(communityCode, "grid", lastGridNumberInDatabase);
// System.out.println(gridNumber+",长度:"+ gridNumber.length());
beanToDb.setGridName(gridNumber.substring(gridNumber.length() - 2));
beanToDb.setGridCode(gridNumber);
res = villageGridInfoMapper.insertVillageGridInfo(beanToDb);
} else {
VillageGridInfo beanUp = new VillageGridInfo();
BeanUtils.copyProperties(beanToDb, beanUp);
updateBeansByCode(beanUp);
}
return res;
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
return 0;
}
}
@Override
public String getLastDigits(VillageGridInfo bean) {
String v = villageGridInfoMapper.getLastDigits(bean);
return v;
}
}

@ -0,0 +1,437 @@
package com.wt.dataToDBs.v3.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.wt.dataToDBs.v3.mapper.VillageHomeInfoMapper;
import com.wt.dataToDBs.v3.pojo.VillageHomeInfo;
import com.wt.dataToDBs.v3.service.VillageHomeInfoFromService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service
*
* @author ruoyi
*/
@DS("syrkFromDb")
@Service
public class VillageHomeInfoFromServiceImpl implements VillageHomeInfoFromService {
@Resource
private VillageHomeInfoMapper villageHomeInfoMapper;
/**
*
*
* @param id
* @return
*/
@Override
public VillageHomeInfo selectVillageHomeInfoById(Long id) {
VillageHomeInfo v = villageHomeInfoMapper.selectVillageHomeInfoById(id);
//返回解密
// aesDecryptNoDesensitiza(v);
return v;
}
/**
*
*
* @param villageHomeInfo
* @return
*/
@Override
public List<VillageHomeInfo> selectVillageHomeInfoList(VillageHomeInfo villageHomeInfo) {
//查询之前加密
// aesEncrypt(villageHomeInfo);
List<VillageHomeInfo> list = villageHomeInfoMapper.selectVillageHomeInfoList(villageHomeInfo);
//如果为导出只解密不脱敏
// getDict(list);
return list;
}
/**
*
*
* @param villageHomeInfo
* @return
*/
// @Override
// public int insertVillageHomeInfo(VillageHomeInfo villageHomeInfo) {
//
// //加密存库
// aesEncrypt(villageHomeInfo);
// //编码生成
// generateData(villageHomeInfo);
// return villageHomeInfoMapper.insertVillageHomeInfo(villageHomeInfo);
//
// }
//
// public int saveOrUpdate(VillageHomeInfo villageHomeInfo) {
// //加密存库
// aesEncrypt(villageHomeInfo);
// return villageHomeInfoMapper.saveOrUpdate(villageHomeInfo);
// }
// /**
// * 修改房屋信息
// *
// * @param villageHomeInfo 房屋信息
// * @return 结果
// */
// @Override
// public int updateVillageHomeInfo(VillageHomeInfo villageHomeInfo) {
//
// try {
// //加密存库
// aesEncrypt(villageHomeInfo);
//
// return villageHomeInfoMapper.updateVillageHomeInfo(villageHomeInfo);
// } catch (Exception e) {
// log.info(StringKit.getTrace(e));
// return 0;
// }
// }
// /**
// * 批量删除房屋信息
// *
// * @param ids 需要删除的房屋信息主键
// * @return 结果
// */
// @Override
// public int deleteVillageHomeInfoByIds(String ids)
// {
// return villageHomeInfoMapper.deleteVillageHomeInfoByIds(Convert.toStrArray(ids));
// }
// /**
// * 批量删除信息
// */
// @Override
// public int deleteVillageHomeInfoByIds(String ids) {
//
// String idsArr[] = ids.split(",");
// for (String id : idsArr) {
// //获取当前最新的状态发送表的id
// Map map = new HashMap();
// map.put("tableName", tableName);
// map.put("manufactor", "10000");
// map.put("tableId", id);
// VillageSendRecord villageSendRecord = villageSendRecordDao.getMaxSendRecordByTableId(map);
// if (villageSendRecord != null) {
// //重置发送状态
// map.put("c2", "1");
// map.put("id", villageSendRecord.getId());
// map.put("isactive", "0");
// villageSendRecordDao.updateSendRecord(map);
// }
// }
// //逻辑删除
// return logicDelete(ids);
// }
// /**
// * 删除房屋信息信息
// *
// * @param id 房屋信息主键
// * @return 结果
// */
// @Override
// public int deleteVillageHomeInfoById(Long id) {
// return villageHomeInfoMapper.deleteVillageHomeInfoById(id);
// }
// @Override
// public void setDicData(VillageHomeInfo v) {
// String homeType = StringKit.toString(v.getHomeTypeCn());
// if (!"".equals(homeType)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_type-" + homeType);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeType(iv);
// }
// String homeCategoryCn = StringKit.toString(v.getHomeCategoryCn());
// if (!"".equals(homeCategoryCn)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_category-" + homeCategoryCn);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeCategory(iv);
// }
// String homeUseCn = StringKit.toString(v.getHomeUseCn());
// if (!"".equals(homeUseCn)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_use-" + homeUseCn);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeUse(iv);
// }
// String homeStateCn = StringKit.toString(v.getHomeStateCn());
// if (!"".equals(homeStateCn)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_state-" + homeStateCn);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeState(iv);
// }
//
// //导入的时候加密
//// aesEncrypt(v);
//
// }
// /**
// * 逻辑删除
// */
// @Override
// public int logicDelete(String ids) {
// if ("".equals(StringKit.toString(ids))) {
// return 0;
// }
// String idsIn = "";
// if (ids.contains(",")) {
// String idsArr[] = ids.split(",");
// for (String id : idsArr) {
// if ("".equals(idsIn)) {
// idsIn = "'" + id + "'";
// } else {
// idsIn = idsIn + ",'" + id + "'";
// }
// }
// } else {
// idsIn = ids;
// }
// Map map = new HashMap();
// map.put("idsIn", idsIn);
// return villageHomeInfoMapper.logicDelete(map);
// }
// @Override
// public void getDict(List<VillageHomeInfo> list) {
// for (VillageHomeInfo v : list) {
// if (v == null) {
// return;
// }
//// setDictCn(v);
//
// aesDecrypt(v);
//
// }
// }
//
// public void getDictNoDesensitization(List<VillageHomeInfo> list) {
// for (VillageHomeInfo v : list) {
// if (v == null) {
// return;
// }
// setDictCn(v);
// v.setPropertyOwnerPhoneCn(v.getPropertyOwnerPhone());
// aesDecryptNoDesensitiza(v);
// }
// }
//
// private void setDictCn(VillageHomeInfo v) {
// String homeType = StringKit.toString(v.getHomeType());
// if (!"".equals(homeType)) {
// v.setHomeTypeCn(DictCatch.getInstance().getObj().get("home_type-" + homeType));
// }
// String homeCategory = StringKit.toString(v.getHomeCategory());
// if (!"".equals(homeCategory)) {
// v.setHomeCategoryCn(DictCatch.getInstance().getObj().get("home_category-" + homeCategory));
// }
// String homeUse = StringKit.toString(v.getHomeUse());
// if (!"".equals(homeUse)) {
// v.setHomeUseCn(DictCatch.getInstance().getObj().get("home_use-" + homeUse));
// }
// String homeState = StringKit.toString(v.getHomeState());
// if (!"".equals(homeState)) {
// v.setHomeStateCn(DictCatch.getInstance().getObj().get("home_state-" + homeState));
// }
// }
/**
*
*/
// @Override
// public void aesDecrypt(VillageHomeInfo v) {
// String desensitizationSwitch = PropertiesUtil.queryPropertiesByKey("desensitizationSwitch");
// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
// if (!"".equals(propertyOwnerPhone)) {
// if (desensitizationSwitch.equals("true")) {
// v.setPropertyOwnerPhone(desensitizationTool.dePhone(AESTools.decrypt(propertyOwnerPhone, AesConstant.AES_PHONE)));
// } else {
// v.setPropertyOwnerPhone(AESTools.decrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
// }
// }
// }
// /**
// * 解密
// */
// @Override
// public void aesDecryptNoDesensitiza(VillageHomeInfo v) {
// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
// if (!"".equals(propertyOwnerPhone)) {
// v.setPropertyOwnerPhone(AESTools.decrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
// }
// }
/**
*
*/
// @Override
// public void aesEncrypt(VillageHomeInfo v) {
//// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
//// if (!"".equals(propertyOwnerPhone)) {
//// v.setPropertyOwnerPhone(AESTools.encrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
//// }
//
// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
// if (!"".equals(propertyOwnerPhone)) {
// if (propertyOwnerPhone.contains("*")) {
// v.setPropertyOwnerPhone(null);
// } else {
// v.setPropertyOwnerPhone(AESTools.encrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
// }
// }
// }
// @Override
// public String checkPara(VillageHomeInfo villageHomeInfo, String res) {
// String villageName = StringKit.toString(villageHomeInfo.getVillageName());
// String buildingName = StringKit.toString(villageHomeInfo.getBuildingName());
// String unitName = StringKit.toString(villageHomeInfo.getUnitName());
// String homeName = StringKit.toString(villageHomeInfo.getHomeName());
// String homeState = StringKit.toString(villageHomeInfo.getHomeState());
//
// if ("".equals(buildingName)) {
// res = res + "<楼栋名称不能为空>";
// }
// if ("".equals(unitName)) {
// res = res + "<单元名称不能为空>";
// }
// if ("".equals(homeName)) {
// res = res + "<户室号码不能为空>";
// }
// if ("".equals(homeState)) {
// res = res + "<房屋状态不能为空>";
// }
//
// if (!"".equals(res)) {
// return res;
// }
//
//// VillageBaseInfo baseInfo = new VillageBaseInfo();
//// baseInfo.setVillageName(villageName);
//// baseInfo.setIsactive(1);
//// List<VillageBaseInfo> baseInfos = villageBaseInfoService.selectVillageBaseInfoList(baseInfo, true);
//// if (baseInfos.size() > 0) {
//// } else {
//// res = res + "<小区不存在>";
//// }
//
// String villageCode = StringKit.toString(villageHomeInfo.getVillageCode());
// if ("".equals(villageName)) {
// res = res + "<小区名称不能为空>";
// } else {
// villageCode = VillagecodeCatch.getInstance().getObj().get(villageName);
// villageHomeInfo.setVillageCode(villageCode);
// if ("".equals(StringKit.toString(villageCode))) {
// //重新加载缓存
// String sql = "select village_code,village_name from village_base_info where isactive = 1";
// catchService.getDictRes(sql);
// villageCode = VillagecodeCatch.getInstance().getObj().get(villageName);
// villageHomeInfo.setVillageCode(villageCode);
// }
// }
// if ("".equals(StringKit.toString(villageCode))) {
// res = res + "<小区名称不能为空/小区不存在>";
// }
//
//
// String gridName = StringKit.toString(villageHomeInfo.getGridName());
// if ("".equals(gridName)) {
// res = res + "<网格名称不能为空>";
// }
// VillageGridInfo gridInfo = new VillageGridInfo();
// gridInfo.setVillageName(villageName);
// gridInfo.setGridName(gridName);
// gridInfo.setIsactive(1);
// List<VillageGridInfo> villageGridInfos = villageGridInfoService.queryVillageGridInfoList(gridInfo);
// if (null != villageGridInfos && villageGridInfos.size() == 1) {
// villageHomeInfo.setGridCode(villageGridInfos.get(0).getGridCode());
// } else {
// res = res + "<数据库中该小区网格名称重复或者不存在,请先检查小区网格>";
// }
//
//
// VillageBuildInfo buildInfo = new VillageBuildInfo();
// buildInfo.setVillageName(villageName);
// buildInfo.setBuildingName(buildingName);
// buildInfo.setIsactive(1);
// List<VillageBuildInfo> buildInfos = villageBuildInfoService.selectVillageBuildInfoList(buildInfo);
// if (buildInfos.size() > 0) {
// } else {
// res = res + "<楼栋不存在>";
// }
//
// VillageUnitInfo unitInfo = new VillageUnitInfo();
// unitInfo.setVillageName(villageName);
// unitInfo.setBuildingName(buildingName);
// unitInfo.setUnitName(unitName);
// unitInfo.setIsactive(1);
// List<VillageUnitInfo> unitInfos = villageUnitInfoService.selectVillageUnitInfoList(unitInfo);
// if (unitInfos.size() > 0) {
// } else {
// res = res + "<单元不存在>";
// }
//
// return res;
// }
//
// /**
// * 关联生成编码
// * Created by 戴鹏涛 on 2023/3/15
// */
// private void generateData(VillageHomeInfo v) {
// String villageName = v.getVillageName().trim();
// String gridName = v.getGridName().trim();
// String buildingName = v.getBuildingName().trim();
// String unitName = v.getUnitName().trim();
// String homeName = v.getHomeName().trim();
//
// VillageUnitInfo query = new VillageUnitInfo();
// query.setVillageName(villageName);
//// query.setGridName(gridName);
// query.setBuildingName(buildingName);
// query.setUnitName(unitName);
// List<VillageUnitInfo> villageUnitInfos = villageUnitInfoMapper.selectVillageUnitInfoList(query);
//
// if (villageUnitInfos.size() != 1) {
// throw new RuntimeException(StrUtil.format("{}第{}网格{}栋{}单元不存在或小区名不准确", villageName, gridName, buildingName, unitName));
// }
//
// VillageUnitInfo villageUnitInfo = villageUnitInfos.get(0);
// String villageCode = villageUnitInfo.getVillageCode();
// String gridCode = villageUnitInfo.getGridCode();
// String buildingCode = villageUnitInfo.getBuildingCode();
// String unitCode = villageUnitInfo.getUnitCode();
// String homeCode = unitCode + String.format("%04d", Integer.parseInt(homeName));
//
// v.setVillageCode(villageCode);
// v.setGridCode(gridCode);
// v.setBuildingCode(buildingCode);
// v.setUnitCode(unitCode);
// v.setHomeCode(homeCode);
// }
}

@ -1,11 +1,16 @@
package com.wt.dataToDBs.v3.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.wt.dataToDBs.tool.CodeUtil;
import com.wt.dataToDBs.tool.NumKit;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.v3.mapper.VillageHomeInfoMapper;
import com.wt.dataToDBs.v3.pojo.VillageHomeInfo;
import com.wt.dataToDBs.v3.service.VillageHomeInfoService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -18,10 +23,10 @@ import java.util.List;
*/
@DS("syrkToDb")
@Service
@RequiredArgsConstructor
public class VillageHomeInfoServiceImpl implements VillageHomeInfoService {
private static final Logger log = LoggerFactory.getLogger(VillageHomeInfoServiceImpl.class);
@Resource
private VillageHomeInfoMapper villageHomeInfoMapper;
private static final Logger logger = LoggerFactory.getLogger(VillageHomeInfoServiceImpl.class);
private final VillageHomeInfoMapper villageHomeInfoMapper;
/**
@ -56,385 +61,65 @@ public class VillageHomeInfoServiceImpl implements VillageHomeInfoService {
return list;
}
/**
*
*
* @param villageHomeInfo
* @return
*/
// @Override
// public int insertVillageHomeInfo(VillageHomeInfo villageHomeInfo) {
//
// //加密存库
// aesEncrypt(villageHomeInfo);
// //编码生成
// generateData(villageHomeInfo);
// return villageHomeInfoMapper.insertVillageHomeInfo(villageHomeInfo);
//
// }
//
// public int saveOrUpdate(VillageHomeInfo villageHomeInfo) {
// //加密存库
// aesEncrypt(villageHomeInfo);
// return villageHomeInfoMapper.saveOrUpdate(villageHomeInfo);
// }
// /**
// * 修改房屋信息
// *
// * @param villageHomeInfo 房屋信息
// * @return 结果
// */
// @Override
// public int updateVillageHomeInfo(VillageHomeInfo villageHomeInfo) {
//
// try {
// //加密存库
// aesEncrypt(villageHomeInfo);
//
// return villageHomeInfoMapper.updateVillageHomeInfo(villageHomeInfo);
// } catch (Exception e) {
// log.info(StringKit.getTrace(e));
// return 0;
// }
// }
// /**
// * 批量删除房屋信息
// *
// * @param ids 需要删除的房屋信息主键
// * @return 结果
// */
// @Override
// public int deleteVillageHomeInfoByIds(String ids)
// {
// return villageHomeInfoMapper.deleteVillageHomeInfoByIds(Convert.toStrArray(ids));
// }
// /**
// * 批量删除信息
// */
// @Override
// public int deleteVillageHomeInfoByIds(String ids) {
//
// String idsArr[] = ids.split(",");
// for (String id : idsArr) {
// //获取当前最新的状态发送表的id
// Map map = new HashMap();
// map.put("tableName", tableName);
// map.put("manufactor", "10000");
// map.put("tableId", id);
// VillageSendRecord villageSendRecord = villageSendRecordDao.getMaxSendRecordByTableId(map);
// if (villageSendRecord != null) {
// //重置发送状态
// map.put("c2", "1");
// map.put("id", villageSendRecord.getId());
// map.put("isactive", "0");
// villageSendRecordDao.updateSendRecord(map);
// }
// }
// //逻辑删除
// return logicDelete(ids);
// }
// /**
// * 删除房屋信息信息
// *
// * @param id 房屋信息主键
// * @return 结果
// */
// @Override
// public int deleteVillageHomeInfoById(Long id) {
// return villageHomeInfoMapper.deleteVillageHomeInfoById(id);
// }
// @Override
// public void setDicData(VillageHomeInfo v) {
// String homeType = StringKit.toString(v.getHomeTypeCn());
// if (!"".equals(homeType)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_type-" + homeType);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeType(iv);
// }
// String homeCategoryCn = StringKit.toString(v.getHomeCategoryCn());
// if (!"".equals(homeCategoryCn)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_category-" + homeCategoryCn);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeCategory(iv);
// }
// String homeUseCn = StringKit.toString(v.getHomeUseCn());
// if (!"".equals(homeUseCn)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_use-" + homeUseCn);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeUse(iv);
// }
// String homeStateCn = StringKit.toString(v.getHomeStateCn());
// if (!"".equals(homeStateCn)) {
// String vi = DictCatchCn.getInstance().getObj().get("home_state-" + homeStateCn);
// Integer iv = 0;
// if (!"".equals(StringKit.toString(vi))) {
// iv = Integer.parseInt(vi);
// }
// v.setHomeState(iv);
// }
//
// //导入的时候加密
//// aesEncrypt(v);
//
// }
// /**
// * 逻辑删除
// */
// @Override
// public int logicDelete(String ids) {
// if ("".equals(StringKit.toString(ids))) {
// return 0;
// }
// String idsIn = "";
// if (ids.contains(",")) {
// String idsArr[] = ids.split(",");
// for (String id : idsArr) {
// if ("".equals(idsIn)) {
// idsIn = "'" + id + "'";
// } else {
// idsIn = idsIn + ",'" + id + "'";
// }
// }
// } else {
// idsIn = ids;
// }
// Map map = new HashMap();
// map.put("idsIn", idsIn);
// return villageHomeInfoMapper.logicDelete(map);
// }
// @Override
// public void getDict(List<VillageHomeInfo> list) {
// for (VillageHomeInfo v : list) {
// if (v == null) {
// return;
// }
//// setDictCn(v);
//
// aesDecrypt(v);
//
// }
// }
//
// public void getDictNoDesensitization(List<VillageHomeInfo> list) {
// for (VillageHomeInfo v : list) {
// if (v == null) {
// return;
// }
// setDictCn(v);
// v.setPropertyOwnerPhoneCn(v.getPropertyOwnerPhone());
// aesDecryptNoDesensitiza(v);
// }
// }
//
// private void setDictCn(VillageHomeInfo v) {
// String homeType = StringKit.toString(v.getHomeType());
// if (!"".equals(homeType)) {
// v.setHomeTypeCn(DictCatch.getInstance().getObj().get("home_type-" + homeType));
// }
// String homeCategory = StringKit.toString(v.getHomeCategory());
// if (!"".equals(homeCategory)) {
// v.setHomeCategoryCn(DictCatch.getInstance().getObj().get("home_category-" + homeCategory));
// }
// String homeUse = StringKit.toString(v.getHomeUse());
// if (!"".equals(homeUse)) {
// v.setHomeUseCn(DictCatch.getInstance().getObj().get("home_use-" + homeUse));
// }
// String homeState = StringKit.toString(v.getHomeState());
// if (!"".equals(homeState)) {
// v.setHomeStateCn(DictCatch.getInstance().getObj().get("home_state-" + homeState));
// }
// }
/**
*
* @param bean
* @return
*/
// @Override
// public void aesDecrypt(VillageHomeInfo v) {
// String desensitizationSwitch = PropertiesUtil.queryPropertiesByKey("desensitizationSwitch");
// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
// if (!"".equals(propertyOwnerPhone)) {
// if (desensitizationSwitch.equals("true")) {
// v.setPropertyOwnerPhone(desensitizationTool.dePhone(AESTools.decrypt(propertyOwnerPhone, AesConstant.AES_PHONE)));
// } else {
// v.setPropertyOwnerPhone(AESTools.decrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
// }
// }
// }
@Override
public VillageHomeInfo selectBeansByCode(VillageHomeInfo bean) {
VillageHomeInfo v = villageHomeInfoMapper.selectBeansByCode(bean);
return v;
}
// /**
// * 解密
// */
// @Override
// public void aesDecryptNoDesensitiza(VillageHomeInfo v) {
// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
// if (!"".equals(propertyOwnerPhone)) {
// v.setPropertyOwnerPhone(AESTools.decrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
// }
// }
@Override
public synchronized int updateBeansByCode(VillageHomeInfo bean) {
VillageHomeInfo beanCheck = selectBeansByCode(bean);
String versionCheck = StringKit.toString(beanCheck.getC1());
String c1 = "".equals(StringKit.toString(bean.getC1())) ? "1" : bean.getC1();
int version = NumKit.checkInt(c1);
bean.setC1(StringKit.toString(version));
bean.setC1New(StringKit.toString(version + 1));
if ("".equals(versionCheck) || c1.equals(versionCheck)) {
return villageHomeInfoMapper.updateBeansByCode(bean);
}
return 0;
}
/**
*
*/
// @Override
// public void aesEncrypt(VillageHomeInfo v) {
//// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
//// if (!"".equals(propertyOwnerPhone)) {
//// v.setPropertyOwnerPhone(AESTools.encrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
//// }
//
// String propertyOwnerPhone = StringKit.toString(v.getPropertyOwnerPhone());
// if (!"".equals(propertyOwnerPhone)) {
// if (propertyOwnerPhone.contains("*")) {
// v.setPropertyOwnerPhone(null);
// } else {
// v.setPropertyOwnerPhone(AESTools.encrypt(propertyOwnerPhone, AesConstant.AES_PHONE));
// }
// }
// }
@Override
public int saveOrUpdate(VillageHomeInfo beanToDb) {
try {
VillageHomeInfo bean = selectBeansByCode(beanToDb);
int res = 0;
if (bean == null) {
beanToDb.setC1("1");
String communityCode = beanToDb.getUnitCode();//小区编码
String lastDigits = villageHomeInfoMapper.getLastDigits(beanToDb);
int lastHomeNumberInDatabase = 0000;//网格最新的编码的后四位
if ("".equals(StringKit.toString(lastDigits))) {
} else {
lastHomeNumberInDatabase = NumKit.checkInt(lastDigits);
}
String homeNumber = CodeUtil.generateNumber(communityCode, "home", lastHomeNumberInDatabase);
beanToDb.setHomeCode(homeNumber);
res = villageHomeInfoMapper.insertVillageHomeInfo(beanToDb);
} else {
VillageHomeInfo beanUp = new VillageHomeInfo();
BeanUtils.copyProperties(beanToDb, beanUp);
updateBeansByCode(beanUp);
}
return res;
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
return 0;
}
}
@Override
public String getLastDigits(VillageHomeInfo bean) {
String v = villageHomeInfoMapper.getLastDigits(bean);
return v;
}
// @Override
// public String checkPara(VillageHomeInfo villageHomeInfo, String res) {
// String villageName = StringKit.toString(villageHomeInfo.getVillageName());
// String buildingName = StringKit.toString(villageHomeInfo.getBuildingName());
// String unitName = StringKit.toString(villageHomeInfo.getUnitName());
// String homeName = StringKit.toString(villageHomeInfo.getHomeName());
// String homeState = StringKit.toString(villageHomeInfo.getHomeState());
//
// if ("".equals(buildingName)) {
// res = res + "<楼栋名称不能为空>";
// }
// if ("".equals(unitName)) {
// res = res + "<单元名称不能为空>";
// }
// if ("".equals(homeName)) {
// res = res + "<户室号码不能为空>";
// }
// if ("".equals(homeState)) {
// res = res + "<房屋状态不能为空>";
// }
//
// if (!"".equals(res)) {
// return res;
// }
//
//// VillageBaseInfo baseInfo = new VillageBaseInfo();
//// baseInfo.setVillageName(villageName);
//// baseInfo.setIsactive(1);
//// List<VillageBaseInfo> baseInfos = villageBaseInfoService.selectVillageBaseInfoList(baseInfo, true);
//// if (baseInfos.size() > 0) {
//// } else {
//// res = res + "<小区不存在>";
//// }
//
// String villageCode = StringKit.toString(villageHomeInfo.getVillageCode());
// if ("".equals(villageName)) {
// res = res + "<小区名称不能为空>";
// } else {
// villageCode = VillagecodeCatch.getInstance().getObj().get(villageName);
// villageHomeInfo.setVillageCode(villageCode);
// if ("".equals(StringKit.toString(villageCode))) {
// //重新加载缓存
// String sql = "select village_code,village_name from village_base_info where isactive = 1";
// catchService.getDictRes(sql);
// villageCode = VillagecodeCatch.getInstance().getObj().get(villageName);
// villageHomeInfo.setVillageCode(villageCode);
// }
// }
// if ("".equals(StringKit.toString(villageCode))) {
// res = res + "<小区名称不能为空/小区不存在>";
// }
//
//
// String gridName = StringKit.toString(villageHomeInfo.getGridName());
// if ("".equals(gridName)) {
// res = res + "<网格名称不能为空>";
// }
// VillageGridInfo gridInfo = new VillageGridInfo();
// gridInfo.setVillageName(villageName);
// gridInfo.setGridName(gridName);
// gridInfo.setIsactive(1);
// List<VillageGridInfo> villageGridInfos = villageGridInfoService.queryVillageGridInfoList(gridInfo);
// if (null != villageGridInfos && villageGridInfos.size() == 1) {
// villageHomeInfo.setGridCode(villageGridInfos.get(0).getGridCode());
// } else {
// res = res + "<数据库中该小区网格名称重复或者不存在,请先检查小区网格>";
// }
//
//
// VillageBuildInfo buildInfo = new VillageBuildInfo();
// buildInfo.setVillageName(villageName);
// buildInfo.setBuildingName(buildingName);
// buildInfo.setIsactive(1);
// List<VillageBuildInfo> buildInfos = villageBuildInfoService.selectVillageBuildInfoList(buildInfo);
// if (buildInfos.size() > 0) {
// } else {
// res = res + "<楼栋不存在>";
// }
//
// VillageUnitInfo unitInfo = new VillageUnitInfo();
// unitInfo.setVillageName(villageName);
// unitInfo.setBuildingName(buildingName);
// unitInfo.setUnitName(unitName);
// unitInfo.setIsactive(1);
// List<VillageUnitInfo> unitInfos = villageUnitInfoService.selectVillageUnitInfoList(unitInfo);
// if (unitInfos.size() > 0) {
// } else {
// res = res + "<单元不存在>";
// }
//
// return res;
// }
//
// /**
// * 关联生成编码
// * Created by 戴鹏涛 on 2023/3/15
// */
// private void generateData(VillageHomeInfo v) {
// String villageName = v.getVillageName().trim();
// String gridName = v.getGridName().trim();
// String buildingName = v.getBuildingName().trim();
// String unitName = v.getUnitName().trim();
// String homeName = v.getHomeName().trim();
//
// VillageUnitInfo query = new VillageUnitInfo();
// query.setVillageName(villageName);
//// query.setGridName(gridName);
// query.setBuildingName(buildingName);
// query.setUnitName(unitName);
// List<VillageUnitInfo> villageUnitInfos = villageUnitInfoMapper.selectVillageUnitInfoList(query);
//
// if (villageUnitInfos.size() != 1) {
// throw new RuntimeException(StrUtil.format("{}第{}网格{}栋{}单元不存在或小区名不准确", villageName, gridName, buildingName, unitName));
// }
//
// VillageUnitInfo villageUnitInfo = villageUnitInfos.get(0);
// String villageCode = villageUnitInfo.getVillageCode();
// String gridCode = villageUnitInfo.getGridCode();
// String buildingCode = villageUnitInfo.getBuildingCode();
// String unitCode = villageUnitInfo.getUnitCode();
// String homeCode = unitCode + String.format("%04d", Integer.parseInt(homeName));
//
// v.setVillageCode(villageCode);
// v.setGridCode(gridCode);
// v.setBuildingCode(buildingCode);
// v.setUnitCode(unitCode);
// v.setHomeCode(homeCode);
// }
}

@ -0,0 +1,121 @@
package com.wt.dataToDBs.v3.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.v3.mapper.VillageJwzUserInfoDao;
import com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo;
import com.wt.dataToDBs.v3.service.VillageJwzUserInfoService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2023-04-17
*/
@DS("syrkFromDb")
@Service
@RequiredArgsConstructor
public class VillageJwzUserInfoServiceImpl implements VillageJwzUserInfoService {
private static final Logger logger = LoggerFactory.getLogger(VillageJwzUserInfoServiceImpl.class);
private final VillageJwzUserInfoDao jwzUserInfoDao;
/**
*
*/
@Override
public VillageJwzUserInfoDo selectVillageJwzUserInfoById(Long id) {
VillageJwzUserInfoDo v = jwzUserInfoDao.selectVillageJwzUserInfoById(id);
return v;
}
/**
*
*/
@Override
public VillageJwzUserInfoDo selectVillageJwzUserInfoByIdcard(String idcard) {
VillageJwzUserInfoDo v = jwzUserInfoDao.selectVillageJwzUserInfoByIdcard(idcard);
return v;
}
/**
*
*/
@Override
public List<VillageJwzUserInfoDo> selectVillageJwzUserInfoList(VillageJwzUserInfoDo VillageJwzUserInfo) {
List<VillageJwzUserInfoDo> list = jwzUserInfoDao.selectVillageJwzUserInfoList(VillageJwzUserInfo);
return list;
}
/**
*
*/
@Override
public int insertVillageJwzUserInfo(VillageJwzUserInfoDo VillageJwzUserInfo) {
return jwzUserInfoDao.insertVillageJwzUserInfo(VillageJwzUserInfo);
}
public int saveOrUpdate(VillageJwzUserInfoDo villageJwzUserInfo) {
try {
String idcard = StringKit.toString(villageJwzUserInfo.getIdCard());
VillageJwzUserInfoDo bean = selectVillageJwzUserInfoByIdcard(idcard);
int res = 0;
if (bean == null) {
res = jwzUserInfoDao.insertVillageJwzUserInfo(villageJwzUserInfo);
} else {
VillageJwzUserInfoDo beanUp = new VillageJwzUserInfoDo();
BeanUtils.copyProperties(villageJwzUserInfo, beanUp);
updateVillageJwzUserInfoByIdcard(beanUp);
}
return res;
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
return 0;
}
}
/**
*
*/
@Override
public int updateVillageJwzUserInfo(VillageJwzUserInfoDo VillageJwzUserInfo) {
return jwzUserInfoDao.updateVillageJwzUserInfo(VillageJwzUserInfo);
}
@Override
public synchronized int updateVillageJwzUserInfoByIdcard(VillageJwzUserInfoDo bean) {
return jwzUserInfoDao.updateVillageJwzUserInfoByIdcard(bean);
}
/**
*
*/
@Override
public int deleteVillageJwzUserInfoByIds(Long[] ids) {
return jwzUserInfoDao.deleteVillageJwzUserInfoByIds(ids);
}
/**
*
*/
@Override
public int deleteVillageJwzUserInfoById(Long id) {
return jwzUserInfoDao.deleteVillageJwzUserInfoById(id);
}
@Override
public int deleteVillageJwzUserInfoByUpdatetime(VillageJwzUserInfoDo bean) {
return jwzUserInfoDao.deleteVillageJwzUserInfoByUpdatetime(bean);
}
}

@ -0,0 +1,117 @@
package com.wt.dataToDBs.v3.service.impl;
import com.wt.dataToDBs.tool.CodeUtil;
import com.wt.dataToDBs.tool.NumKit;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.v3.mapper.VillageUnitInfoMapper;
import com.wt.dataToDBs.v3.pojo.VillageUnitInfo;
import com.wt.dataToDBs.v3.service.IVillageUnitInfoService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2022-05-17
*/
@Service
@RequiredArgsConstructor
public class VillageUnitInfoServiceImpl implements IVillageUnitInfoService {
private static final Logger logger = LoggerFactory.getLogger(VillageUnitInfoServiceImpl.class);
private final VillageUnitInfoMapper villageUnitInfoMapper;
// private static String tableName = "village_unit_info";
/**
*
*
* @param id
* @return
*/
@Override
public VillageUnitInfo selectVillageUnitInfoById(Long id) {
VillageUnitInfo v = villageUnitInfoMapper.selectVillageUnitInfoById(id);
return v;
}
/**
*
*
* @param villageUnitInfo
* @return
*/
@Override
public List<VillageUnitInfo> selectVillageUnitInfoList(VillageUnitInfo villageUnitInfo) {
return villageUnitInfoMapper.selectVillageUnitInfoList(villageUnitInfo);
}
/**
* @param bean
* @return
*/
@Override
public VillageUnitInfo selectBeansByCode(VillageUnitInfo bean) {
VillageUnitInfo v = villageUnitInfoMapper.selectBeansByCode(bean);
return v;
}
@Override
public synchronized int updateBeansByCode(VillageUnitInfo bean) {
VillageUnitInfo beanCheck = selectBeansByCode(bean);
String versionCheck = StringKit.toString(beanCheck.getC1());
String c1 = "".equals(StringKit.toString(bean.getC1())) ? "1" : bean.getC1();
int version = NumKit.checkInt(c1);
bean.setC1(StringKit.toString(version));
bean.setC1New(StringKit.toString(version + 1));
if ("".equals(versionCheck) || c1.equals(versionCheck)) {
return villageUnitInfoMapper.updateBeansByCode(bean);
}
return 0;
}
@Override
public int saveOrUpdate(VillageUnitInfo beanToDb) {
try {
VillageUnitInfo bean = selectBeansByCode(beanToDb);
int res = 0;
if (bean == null) {
beanToDb.setC1("1");
//楼栋编码
String communityCode = beanToDb.getBuildingCode();
String lastDigits = villageUnitInfoMapper.getLastDigits(beanToDb);
//网格最新的编码的后两位
int lastUnitNumberInDatabase = 00;
if ("".equals(StringKit.toString(lastDigits))) {
} else {
lastUnitNumberInDatabase = NumKit.checkInt(lastDigits);
}
String unitNumber = CodeUtil.generateNumber(communityCode, "unit", lastUnitNumberInDatabase);
beanToDb.setUnitCode(unitNumber);
res = villageUnitInfoMapper.insertVillageUnitInfo(beanToDb);
} else {
VillageUnitInfo beanUp = new VillageUnitInfo();
BeanUtils.copyProperties(beanToDb, beanUp);
updateBeansByCode(beanUp);
}
return res;
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
return 0;
}
}
@Override
public String getLastDigits(VillageUnitInfo bean) {
String v = villageUnitInfoMapper.getLastDigits(bean);
return v;
}
}

@ -3,11 +3,20 @@ package com.wt.dataToDBs.v3.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.wt.dataToDBs.tool.NumKit;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.tool.julong.DictUtil;
import com.wt.dataToDBs.tool.safe.AESTools;
import com.wt.dataToDBs.tool.safe.AesConstant;
import com.wt.dataToDBs.v3.mapper.VillageUserInfoMapper;
import com.wt.dataToDBs.v3.pojo.VillageHomeInfo;
import com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo;
import com.wt.dataToDBs.v3.pojo.VillageUserInfo;
import com.wt.dataToDBs.v3.service.VillageHomeInfoService;
import com.wt.dataToDBs.v3.service.VillageJwzUserInfoService;
import com.wt.dataToDBs.v3.service.VillageUserInfoService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -20,10 +29,14 @@ import java.util.List;
*/
@DS("syrkToDb")
@Service
@RequiredArgsConstructor
public class VillageUserInfoServiceImpl implements VillageUserInfoService {
private static final Logger logger = LoggerFactory.getLogger(VillageUserInfoServiceImpl.class);
@Resource
private VillageUserInfoMapper villageUserInfoMapper;
private final VillageUserInfoMapper villageUserInfoMapper;
private final VillageHomeInfoFromServiceImpl homeInfoService;
private final VillageJwzUserInfoService jwzUserInfoService;
private static String tableName = "village_user_info";
@ -53,114 +66,6 @@ public class VillageUserInfoServiceImpl implements VillageUserInfoService {
}
// public void getValuesFromVehicleBases(List<VillageUserInfo> list) {
// //从200w数据中取到值存到对象返回给前端
// for (VillageUserInfo v : list) {
// if (v == null) {
// return;
// }
// String tempIdcard = "";
// String tempPhone = "";
// String tempOwnerName = "";
// getValuesFromVehicleBase(v, tempIdcard, tempPhone, tempOwnerName);
//
// //imsi相关信息
// ModelUserImsiInfo modelUserImsiInfo = new ModelUserImsiInfo();
// modelUserImsiInfo.setIdcard(v.getIdcardCn());
// List<ModelUserImsiInfo> modelUserImsiInfos = modelUserImsiInfoService.selectModelUserImsiInfoList(modelUserImsiInfo);
// if (modelUserImsiInfos != null && modelUserImsiInfos.size() > 0) {
// String imsi = StringKit.toString(modelUserImsiInfos.get(0).getImsi());
// String c1 = StringKit.toString(modelUserImsiInfos.get(0).getC1());//可信度
// v.setImsi(imsi);
// v.setReliability(c1);
// }
//
// }
// }
//
// private void getValuesFromVehicleBase(VillageUserInfo v, String tempIdcard, String tempPhone, String tempOwnerName) {
// //获取200w数据 如果基础信息里没有从200w里面拿到填进去 人员根据身份证查询
// VillageVehicleBaseInfo villageVehicleBaseInfoPara = new VillageVehicleBaseInfo();
// villageVehicleBaseInfoPara.setIdcard(StringKit.toString(v.getIdcardCn()));
// if (!"".equals(StringKit.toString(v.getIdcardCn()))) {
// List<VillageVehicleBaseInfo> vehicleBaseInfos = vehicleBaseInfoService.queryVehicleBaseInfo(villageVehicleBaseInfoPara);
// if (vehicleBaseInfos != null && vehicleBaseInfos.size() > 0) {
// for (VillageVehicleBaseInfo villageVehicleBaseInfo : vehicleBaseInfos) {
//
// String dataSrcBase = StringKit.toString(villageVehicleBaseInfo.getDataSrc());
// String idcardBase = StringKit.toString(villageVehicleBaseInfo.getIdcard());
// String ownerNameBase = StringKit.toString(villageVehicleBaseInfo.getOwnerName());
// String phoneBase = StringKit.toString(villageVehicleBaseInfo.getPhone());
//
// String idcard = StringKit.toString(v.getIdcard());
// if (!"".equals(idcardBase) && "".equals(idcard)) {
// if ("1".equals(dataSrcBase)) {
// tempIdcard = idcardBase;
// } else if ("2".equals(dataSrcBase) && "".equals(tempIdcard)) {
// tempIdcard = idcardBase;
// } else if (!"1".equals(dataSrcBase) && !"2".equals(dataSrcBase) && "".equals(tempIdcard)) {
// tempIdcard = idcardBase;
// }
// }
//
// String phone = StringKit.toString(v.getPhone());
// if (!"".equals(phoneBase) && "".equals(phone)) {
// if ("1".equals(dataSrcBase)) {
// tempPhone = phoneBase;
// } else if ("2".equals(dataSrcBase) && "".equals(tempPhone)) {
// tempPhone = phoneBase;
// } else if (!"1".equals(dataSrcBase) && !"2".equals(dataSrcBase) && "".equals(tempPhone)) {
// tempPhone = phoneBase;
// }
// }
//
// String ownerName = StringKit.toString(v.getUserName());
// if (!"".equals(ownerNameBase) && "".equals(ownerName)) {
// if ("1".equals(dataSrcBase)) {
// tempOwnerName = ownerNameBase;
// } else if ("2".equals(dataSrcBase) && "".equals(tempOwnerName)) {
// tempOwnerName = ownerNameBase;
// } else if (!"1".equals(dataSrcBase) && !"2".equals(dataSrcBase) && "".equals(tempOwnerName)) {
// tempOwnerName = ownerNameBase;
// }
// }
// }
//
// }
// }
// if (!"".equals(tempOwnerName)) {
// v.setUserName(tempOwnerName);
// }
// if (!"".equals(tempPhone)) {
// v.setPhoneCn(tempPhone);
// v.setPhone(desensitizationTool.dePhone(AESTools.decrypt(tempPhone, AesConstant.AES_PHONE)));
// }
// if (!"".equals(tempIdcard)) {
// v.setIdcardCn(tempIdcard);
// v.setIdcard(desensitizationTool.deIdCard(AESTools.decrypt(tempIdcard, AesConstant.AES_ID_CARD)));
// }
// }
//
////
//// /**
//// * 查询住户信息列表
//// *
//// * @param villageUserInfo 住户信息
//// * @return 住户信息
//// */
//// @Override
//// public List<VillageUserInfo> selectVillageUserInfoListOrderByTomany(VillageUserInfo villageUserInfo) {
//// //查询之前加密
//// aesEncrypt(villageUserInfo);
//// List<VillageUserInfo> list = villageUserInfoMapper.selectVillageUserInfoList(villageUserInfo);
//// //如果为导出只解密不脱敏
//// if (villageUserInfo.getExport() != null && villageUserInfo.getExport()) {
//// getDictNoDesensitization(list);
//// return list;
//// }
//// getDict(list);
//// return list;
//// }
/**
*
@ -200,16 +105,60 @@ public class VillageUserInfoServiceImpl implements VillageUserInfoService {
VillageUserInfo v = villageUserInfoMapper.selectVillageUserInfoByIdcard(idcard);
return v;
}
public int saveOrUpdate(VillageUserInfo villageUserInfo) {
@Override
public synchronized int saveOrUpdate(VillageUserInfo villageUserInfo) {
try {
String idcard = StringKit.toString(villageUserInfo.getIdcard());
VillageUserInfo userInfo = new VillageUserInfo();
BeanUtils.copyProperties(villageUserInfo, userInfo);
//默认全部中国籍
userInfo.setNationality(17);
String villageCode = userInfo.getVillageCode();
String build = userInfo.getBuildingName();
// String unit = userInfo.getUnitName();
String home = userInfo.getHomeName();
VillageHomeInfo homeInfoPara = new VillageHomeInfo();
homeInfoPara.setVillageCode(villageCode);
homeInfoPara.setBuildingName(build);
homeInfoPara.setHomeName(home);
List<VillageHomeInfo> homeInfosFilter = null;
if (!"".equals(StringKit.toString(villageCode)) && !"".equals(StringKit.toString(build)) && !"".equals(StringKit.toString(home))) {
homeInfosFilter = homeInfoService.selectVillageHomeInfoList(homeInfoPara);
}
if (homeInfosFilter != null && homeInfosFilter.size() > 0) {
VillageHomeInfo homeInfo = homeInfosFilter.get(0);
userInfo.setGridCode(homeInfo.getGridCode());
userInfo.setGridName(homeInfo.getGridName());
userInfo.setBuildingCode(homeInfo.getBuildingCode());
userInfo.setBuildingName(homeInfo.getBuildingName());
userInfo.setUnitCode(homeInfo.getUnitCode());
userInfo.setUnitName(homeInfo.getUnitName());
userInfo.setHomeCode(homeInfo.getHomeCode());
userInfo.setHomeName(homeInfo.getHomeName());
}
String idcard = StringKit.toString(userInfo.getIdcard());
String idcardDec = AESTools.decrypt(idcard, AesConstant.AES_ID_CARD);
VillageJwzUserInfoDo jwzUserInfo = jwzUserInfoService.selectVillageJwzUserInfoByIdcard(idcardDec);
if (jwzUserInfo != null) {
//户籍地址
userInfo.setHouseHoldAddress(StringKit.toString(jwzUserInfo.getHouseHoldAddress()));
//关系
userInfo.setHouseholderRelation(DictUtil.convertRelation(StringKit.toString(jwzUserInfo.getHouseholderRelation())));
}
VillageUserInfo bean = selectVillageUserInfoByIdcard(idcard);
int res = 0;
if (bean == null) {
villageUserInfo.setC2("1");
res = villageUserInfoMapper.insertVillageUserInfo(villageUserInfo);
userInfo.setC2("1");
res = villageUserInfoMapper.insertVillageUserInfo(userInfo);
} else {
updateVillageUserInfoByIdcard(bean);
userInfo.setC2(bean.getC2());
userInfo.setId(bean.getId());
updateVillageUserInfoByIdcard(userInfo);
}
return res;
} catch (Exception e) {
@ -239,11 +188,11 @@ public class VillageUserInfoServiceImpl implements VillageUserInfoService {
// * @param ids 需要删除的住户信息主键
// * @return 结果
// */
// @Override
// public int deleteVillageUserInfoByIds(String ids)
// {
// return villageUserInfoMapper.deleteVillageUserInfoByIds(Convert.toStrArray(ids));
// }
@Override
public int deleteVillageUserInfoByUpdatetime(VillageUserInfo bean)
{
return villageUserInfoMapper.deleteVillageUserInfoByUpdatetime(bean);
}
//
// /**
// * 批量删除信息

@ -0,0 +1,65 @@
package com.wt.dataToDBs.v3.task;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.v3.catchs.VillageCatch;
import com.wt.dataToDBs.v3.pojo.VillageBaseInfo;
import com.wt.dataToDBs.v3.service.VillageBaseInfoService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;
/**
*
*/
@Component
@RequiredArgsConstructor
public class CatchV3Task {
private static final Logger logger = LoggerFactory.getLogger(CatchV3Task.class);
private final VillageBaseInfoService villageBaseInfoService;
/**
*
*/
@Scheduled(cron = "0 0 * * * *")
public void transBaseInfo() {
try {
List<VillageBaseInfo> baseInfos = villageBaseInfoService.selectVillageBaseInfoList(new VillageBaseInfo(), false);
VillageCatch.getInstance().setObj(baseInfos);
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
}
}
/**
*
*
* @param baseInfos
* @return
*/
public static List<VillageBaseInfo> getVillageBaseInfoByAddress(List<VillageBaseInfo> baseInfos, String villageAddress ) {
// 假设你有一个名为homeInfos的List<VillageHomeInfo>对象
if ("".equals(StringKit.toString(villageAddress))) {
return null;
}
try {
// 使用流过滤数据
//不需要匹配单元
List<VillageBaseInfo> filteredList = baseInfos.stream()
.filter(village -> village.getVillageAddress().contains(villageAddress))
.collect(Collectors.toList());
return filteredList;
} catch (Exception e) {
return null;
}
}
}

@ -0,0 +1,38 @@
package com.wt.dataToDBs.v3.task;
import com.wt.dataToDBs.tool.ConfigParam;
import com.wt.dataToDBs.v3.pojo.OdsStandardAddress;
import com.wt.dataToDBs.v3.service.IOdsStandardAddressService;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
/**
*
*/
@Component
@RequiredArgsConstructor
public class OdsAddressTask {
private final IOdsStandardAddressService addressService;
/**
* , user_info user_record
*/
@Scheduled(initialDelay = 100, fixedDelay = 3000)
public void handleOdsStandardAddress() {
if (!"true".equals(ConfigParam.dtOdsStandardAddressSwitch)) {
return;
}
//获取尚未处理的数据
List<OdsStandardAddress> addresses = addressService.selectAddressByStatus();
for (OdsStandardAddress bean : addresses) {
addressService.handleOdsStandardAddress(bean);
}
}
}

@ -1,6 +1,8 @@
package com.wt.dataToDBs.v3.task;
import com.wt.dataToDBs.tool.ConfigParam;
import com.wt.dataToDBs.tool.DateUtil;
import com.wt.dataToDBs.tool.NumKit;
import com.wt.dataToDBs.tool.StringKit;
import com.wt.dataToDBs.tool.safe.AESTools;
import com.wt.dataToDBs.tool.safe.AesConstant;
@ -20,11 +22,10 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
*
@ -40,12 +41,8 @@ public class SyrkFromDbV3Task {
private VillageBaseInfoService villageBaseInfoService;
@Resource
private VillageUserInfoService villageUserInfoService;
// @Autowired
// private VillageSendRecordStaticDao sendRecordStaticDao;
@Resource
private VillageSendRecordStaticDao sendRecordStaticDao;
@Resource
private JdbcTemplate jdbcTemplate;
/**
* ---- 1
* //
@ -58,12 +55,16 @@ public class SyrkFromDbV3Task {
try {
// 获取当前时间戳(毫秒)
long timestamp = System.currentTimeMillis();
String strDate = DateUtil.convertTimeToString(timestamp / 1000, "YYYYMMdd");
//设置任务执行时间
if (setTaskTimes(strDate)) {
return;
}
long timestamp = System.currentTimeMillis(); // 获取当前时间戳(毫秒)
// 将时间戳转换为LocalDate对象
LocalDate date = LocalDate.ofEpochDay(timestamp / 86400000);
// 将LocalDate对象格式化为"YYYY-MM-dd"格式的日期字符串
String strDate = date.format(DateTimeFormatter.ofPattern("YYYYMMdd"));
//查询数据库是否存在 每天执行一次
Map mapStaticPara = new HashMap();
mapStaticPara.put("manufactorNo", "888888");
@ -86,38 +87,74 @@ public class SyrkFromDbV3Task {
//首先查询小区数据 查到实际地址循环
List<VillageBaseInfo> baseInfos = villageBaseInfoService.selectVillageBaseInfoList(new VillageBaseInfo(), true);
for (VillageBaseInfo b : baseInfos) {
String address = b.getVillageAddress();
String villageAddress = b.getVillageAddress();
if ("".equals(StringKit.toString(address))) {
if ("".equals(StringKit.toString(villageAddress))) {
logger.info("当前小区地址尚未添加:" + b.getVillageName());
continue;
}
if (villageAddress.contains("号") || villageAddress.contains("组") ) {
}else {
logger.info("当前小区地址不正确:" + b.getVillageName());
continue;
}
//每天执行一次
//根据小区的实际地址去 东台的库表查询如果查得到就是这个小区的基础数据.
VillageActualUserInfoDo actualUserInfoDo = new VillageActualUserInfoDo();
actualUserInfoDo.setHabitation(address);
actualUserInfoDo.setHabitation(villageAddress);
List<VillageActualUserInfoDo> actualUserInfoDos = actualUserInfoService.selectVillageActualUserInfoList(actualUserInfoDo);
logger.info("当前小区:" + b.getVillageName() + ",查询到" + actualUserInfoDos.size()+"条记录");
if (actualUserInfoDos != null && actualUserInfoDos.size() > 0) {
} else {
logger.info("小区编码:" + b.getVillageCode() + ",当前地址未查询到数据:" + address);
logger.info("小区编码:" + b.getVillageCode() + ",当前地址未查询到数据:" + villageAddress);
continue;
}
for (VillageActualUserInfoDo actualUserInfo : actualUserInfoDos) {
String personCategory = "3";//默认是流动人员
//默认是流动人员
String personCategory = "3";
String rylx = StringKit.toString(actualUserInfo.getPersonCategory());
if ("101".equals(rylx)) {//人户一致
//人户一致
if ("101".equals(rylx)) {
personCategory = "1";
} else if ("102".equals(rylx)) {//流动人口
//流动人口
} else if ("102".equals(rylx)) {
personCategory = "3";
} else if ("124".equals(rylx)) {//人在户不在
//人在户不在
} else if ("124".equals(rylx)) {
personCategory = "2";
}
//现居行政区名称
String xjzdxz_dzmc = actualUserInfo.getHabitation();
String home = "";
try {
home = StringKit.extractDigits(xjzdxz_dzmc.substring(0, xjzdxz_dzmc.indexOf("室")));
} catch (Exception e) {
home = "";
}
String unit = "";
try {
unit = StringKit.extractDigits(xjzdxz_dzmc.substring(0, xjzdxz_dzmc.indexOf("单元")));
} catch (Exception e) {
unit = "";
}
String build = "";
try {
build = StringKit.extractDigits(xjzdxz_dzmc.substring(0, xjzdxz_dzmc.indexOf("幢")));
} catch (Exception e) {
build = "";
}
VillageUserInfo userInfo = new VillageUserInfo();
userInfo.setVillageCode(b.getVillageCode());
userInfo.setVillageName(b.getVillageName());
userInfo.setBuildingName(build);
userInfo.setUnitName(unit);
userInfo.setHomeName(home);
userInfo.setUserName(actualUserInfo.getUserName());
userInfo.setIdentityType(1);
userInfo.setIdcard(AESTools.encrypt(actualUserInfo.getIdcard(), AesConstant.AES_ID_CARD));
@ -125,19 +162,9 @@ public class SyrkFromDbV3Task {
userInfo.setHouseHoldAddress(actualUserInfo.getHouseHoldAddress());
userInfo.setHabitation(actualUserInfo.getHabitation());
userInfo.setPersonCategory(Integer.valueOf(personCategory));
VillageUserInfo userinfoPara = new VillageUserInfo();
userinfoPara.setIdcard(AESTools.encrypt(actualUserInfo.getIdcard(), AesConstant.AES_ID_CARD));
logger.info("记录变更:" + actualUserInfo.getIdcard() );
villageUserInfoService.saveOrUpdate(userInfo);
// List<VillageUserInfo> userInfos = villageUserInfoService.selectVillageUserInfoList(userinfoPara);
// if (userInfos != null && userInfos.size() > 0) {
// //如果已存在先不插入
// } else {
// villageUserInfoService.insertVillageUserInfo(userInfo);
// }
}
//查询到实有人口的数据之后 将数据匹配到 住户表里面去
}
//处理完毕设置处理结束状态
@ -154,19 +181,13 @@ public class SyrkFromDbV3Task {
if (!"true".equals(ConfigParam.syrkV3Switch)) {
return;
}
//首先检查
long timestamp = System.currentTimeMillis(); // 获取当前时间戳(毫秒)
//首先检查 获取当前时间戳(毫秒)
long timestamp = System.currentTimeMillis();
// 将时间戳转换为LocalDate对象
LocalDate date = LocalDate.ofEpochDay(timestamp / 86400000);
// 将LocalDate对象格式化为"YYYY-MM-dd"格式的日期字符串
String strDate = date.format(DateTimeFormatter.ofPattern("YYYYMMdd"));
// String strDateD = date.format(DateTimeFormatter.ofPattern("YYYY-MM-dd"));
// 获取当前日期前一天的日期
LocalDate localDate = LocalDate.now().minusDays(1);
// 将日期转换为指定格式的字符串
String formattedDate = localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String strDateD = date.format(DateTimeFormatter.ofPattern("YYYY-MM-dd"));
//查询数据库是否存在 每天执行一次
Map mapStaticPara = new HashMap();
@ -179,9 +200,11 @@ public class SyrkFromDbV3Task {
VillageSendRecordStatic sendRecordStatic = sendRecordStatics.get(0);
String resultStatus = sendRecordStatic.getResultStatus();
if("1".equals(resultStatus)){
String sql = "delete from village_user_info where building_code is null and updatetime like '"+formattedDate+"%'";
//删除人员表数据
jdbcTemplate.execute(sql);
VillageUserInfo userInfoPara = new VillageUserInfo();
userInfoPara.setUpdatetimeV(strDateD);
villageUserInfoService.deleteVillageUserInfoByUpdatetime(userInfoPara);
sendRecordStatic.setResultStatus("2");
sendRecordStatic.setResultRemark(strDate);
sendRecordStaticDao.updateRecord(sendRecordStatic);
@ -193,4 +216,64 @@ public class SyrkFromDbV3Task {
}
private boolean setTaskTimes(String strDate) {
try {
String lastTime = "";
VillageSendRecordStatic bean = new VillageSendRecordStatic();
bean.setTableName(Config.tablenameSyrk);
List<VillageSendRecordStatic> maps = sendRecordStaticDao.getLastRecord(bean);
if (maps != null && maps.size() > 0) {
lastTime = StringKit.toString(maps.get(0).getResultRemark());
} else {
return false;
}
Integer times = NumKit.checkInt(ConfigParam.dtJwzTimes);
if(times == 0){
times = 3;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
Date date1 = sdf.parse(strDate);
Date date2 = sdf.parse(lastTime);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date2);
calendar.add(Calendar.DAY_OF_MONTH, times);
Date date2Plus3Days = calendar.getTime();
if (date1.after(date2Plus3Days)) {
// System.out.println("20230706 大于 20230701 三天");
} else {
// System.out.println("20230706 不大于 20230701 三天");
return true;
}
return false;
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
return true;
}
}
/**
*
* @param input
* @return
*/
public static String convertChineseUnitToDigit(String input) {
input = input.replaceAll("一单元", "1单元")
.replaceAll("二单元", "2单元")
.replaceAll("三单元", "3单元")
.replaceAll("四单元", "4单元")
.replaceAll("五单元", "5单元")
.replaceAll("六单元", "6单元")
.replaceAll("七单元", "7单元")
.replaceAll("八单元", "8单元")
.replaceAll("九单元", "9单元");
return input;
}
}

@ -5,17 +5,17 @@ spring:
strict: false
datasource:
master:
url: jdbc:mysql://localhost:55306/watu3?characterEncoding=utf8&useSSL=false
url: jdbc:mysql://121.41.91.94:12036/watu3?characterEncoding=utf8&useSSL=false
username: root
password: '!QAZ1qaz'
driverClassName: com.mysql.cj.jdbc.Driver
master1:
url: jdbc:mysql://localhost:55306/watu3?characterEncoding=utf8&useSSL=false
url: jdbc:mysql://121.41.91.94:12036/watu3?characterEncoding=utf8&useSSL=false
username: root
password: '!QAZ1qaz'
driverClassName: com.mysql.cj.jdbc.Driver
sourceA:
url: jdbc:mysql://localhost:55306/watu3?characterEncoding=utf8&useSSL=false
url: jdbc:mysql://121.41.91.94:12036/watu3?characterEncoding=utf8&useSSL=false
username: root
password: '!QAZ1qaz'
driverClassName: com.mysql.cj.jdbc.Driver
@ -25,7 +25,7 @@ spring:
password: '!QAZ1qaz'
driverClassName: com.mysql.cj.jdbc.Driver
syrkToDb:
url: jdbc:mysql://localhost:55306/watu3?characterEncoding=utf8&useSSL=false
url: jdbc:mysql://121.41.91.94:12036/watu3?characterEncoding=utf8&useSSL=false
username: root
password: '!QAZ1qaz'
driverClassName: com.mysql.cj.jdbc.Driver
@ -47,7 +47,7 @@ mybatis-plus:
mapper-locations: classpath:mapper/*/*.xml
configuration:
jdbc-type-for-null: null
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
# 关闭 mybatis-plus的 banner
banner: false

@ -0,0 +1,173 @@
<?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.wt.dataToDBs.v3.mapper.OdsStandardAddressMapper">
<resultMap type="com.wt.dataToDBs.v3.pojo.OdsStandardAddress" id="OdsStandardAddressResult">
<result property="id" column="id" />
<result property="cjry" column="cjry" />
<result property="dzdxmc" column="dzdxmc" />
<result property="rys" column="rys" />
<result property="dzdxid" column="dzdxid" />
<result property="qtyrq" column="qtyrq" />
<result property="dwdwdzb" column="dwdwdzb" />
<result property="dwdjdzb" column="dwdjdzb" />
<result property="zb" column="zb" />
<result property="dzysid" column="dzysid" />
<result property="qtybz" column="qtybz" />
<result property="ssjgdm" column="ssjgdm" />
<result property="dzdxtymc" column="dzdxtymc" />
<result property="dzyslx" column="dzyslx" />
<result property="shry" column="shry" />
<result property="zrqdm" column="zrqdm" />
<result property="sjdzysid" column="sjdzysid" />
<result property="shzt" column="shzt" />
<result property="whzt" column="whzt" />
<result property="dzysjb" column="dzysjb" />
<result property="dzyszt" column="dzyszt" />
<result property="isactive" column="isactive" />
<result property="isdelete" column="isdelete" />
<result property="status" column="status" />
</resultMap>
<sql id="selectOdsStandardAddressVo">
select id, cjry, dzdxmc, status,rys, dzdxid,isdelete, qtyrq, dwdwdzb, dwdjdzb, zb, dzysid, qtybz, ssjgdm, dzdxtymc, dzyslx, shry, zrqdm, sjdzysid, shzt, whzt, dzysjb, dzyszt, createtime, createby, updatetime, updateby, isactive from ods_standard_address
</sql>
<select id="selectOdsStandardAddressList" parameterType="com.wt.dataToDBs.v3.pojo.OdsStandardAddress" resultMap="OdsStandardAddressResult">
<include refid="selectOdsStandardAddressVo"/>
<where>
and status =1
<if test="cjry != null and cjry != ''"> and cjry = #{cjry}</if>
<if test="dzdxmc != null and dzdxmc != ''"> and dzdxmc = #{dzdxmc}</if>
<if test="rys != null and rys != ''"> and rys = #{rys}</if>
<if test="dzdxid != null and dzdxid != ''"> and dzdxid = #{dzdxid}</if>
<if test="qtyrq != null and qtyrq != ''"> and qtyrq = #{qtyrq}</if>
<if test="dwdwdzb != null and dwdwdzb != ''"> and dwdwdzb = #{dwdwdzb}</if>
<if test="dwdjdzb != null and dwdjdzb != ''"> and dwdjdzb = #{dwdjdzb}</if>
<if test="zb != null and zb != ''"> and zb = #{zb}</if>
<if test="dzysid != null and dzysid != ''"> and dzysid = #{dzysid}</if>
<if test="qtybz != null and qtybz != ''"> and qtybz = #{qtybz}</if>
<if test="ssjgdm != null and ssjgdm != ''"> and ssjgdm = #{ssjgdm}</if>
<if test="dzdxtymc != null and dzdxtymc != ''"> and dzdxtymc = #{dzdxtymc}</if>
<if test="dzyslx != null and dzyslx != ''"> and dzyslx = #{dzyslx}</if>
<if test="shry != null and shry != ''"> and shry = #{shry}</if>
<if test="zrqdm != null and zrqdm != ''"> and zrqdm = #{zrqdm}</if>
<if test="sjdzysid != null and sjdzysid != ''"> and sjdzysid = #{sjdzysid}</if>
<if test="shzt != null and shzt != ''"> and shzt = #{shzt}</if>
<if test="whzt != null and whzt != ''"> and whzt = #{whzt}</if>
<if test="dzysjb != null and dzysjb != ''"> and dzysjb = #{dzysjb}</if>
<if test="dzyszt != null and dzyszt != ''"> and dzyszt = #{dzyszt}</if>
<if test="isactive != null "> and isactive = #{isactive}</if>
<if test="isdelete != null "> and isdelete = #{isdelete}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectOdsStandardAddressById" parameterType="Long" resultMap="OdsStandardAddressResult">
<include refid="selectOdsStandardAddressVo"/>
where id = #{id}
</select>
<insert id="insertOdsStandardAddress" parameterType="com.wt.dataToDBs.v3.pojo.OdsStandardAddress" useGeneratedKeys="true" keyProperty="id">
insert into ods_standard_address
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cjry != null">cjry,</if>
<if test="dzdxmc != null">dzdxmc,</if>
<if test="rys != null">rys,</if>
<if test="dzdxid != null">dzdxid,</if>
<if test="qtyrq != null">qtyrq,</if>
<if test="dwdwdzb != null">dwdwdzb,</if>
<if test="dwdjdzb != null">dwdjdzb,</if>
<if test="zb != null">zb,</if>
<if test="dzysid != null">dzysid,</if>
<if test="qtybz != null">qtybz,</if>
<if test="ssjgdm != null">ssjgdm,</if>
<if test="dzdxtymc != null">dzdxtymc,</if>
<if test="dzyslx != null">dzyslx,</if>
<if test="shry != null">shry,</if>
<if test="zrqdm != null">zrqdm,</if>
<if test="sjdzysid != null">sjdzysid,</if>
<if test="shzt != null">shzt,</if>
<if test="whzt != null">whzt,</if>
<if test="dzysjb != null">dzysjb,</if>
<if test="dzyszt != null">dzyszt,</if>
<if test="isactive != null">isactive,</if>
<if test="isdelete != null">isdelete,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cjry != null">#{cjry},</if>
<if test="dzdxmc != null">#{dzdxmc},</if>
<if test="rys != null">#{rys},</if>
<if test="dzdxid != null">#{dzdxid},</if>
<if test="qtyrq != null">#{qtyrq},</if>
<if test="dwdwdzb != null">#{dwdwdzb},</if>
<if test="dwdjdzb != null">#{dwdjdzb},</if>
<if test="zb != null">#{zb},</if>
<if test="dzysid != null">#{dzysid},</if>
<if test="qtybz != null">#{qtybz},</if>
<if test="ssjgdm != null">#{ssjgdm},</if>
<if test="dzdxtymc != null">#{dzdxtymc},</if>
<if test="dzyslx != null">#{dzyslx},</if>
<if test="shry != null">#{shry},</if>
<if test="zrqdm != null">#{zrqdm},</if>
<if test="sjdzysid != null">#{sjdzysid},</if>
<if test="shzt != null">#{shzt},</if>
<if test="whzt != null">#{whzt},</if>
<if test="dzysjb != null">#{dzysjb},</if>
<if test="dzyszt != null">#{dzyszt},</if>
<if test="isactive != null">#{isactive},</if>
<if test="isdelete != null">#{isdelete},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateOdsStandardAddress" parameterType="com.wt.dataToDBs.v3.pojo.OdsStandardAddress">
update ods_standard_address
<trim prefix="SET" suffixOverrides=",">
<if test="cjry != null">cjry = #{cjry},</if>
<if test="dzdxmc != null">dzdxmc = #{dzdxmc},</if>
<if test="rys != null">rys = #{rys},</if>
<if test="dzdxid != null">dzdxid = #{dzdxid},</if>
<if test="qtyrq != null">qtyrq = #{qtyrq},</if>
<if test="dwdwdzb != null">dwdwdzb = #{dwdwdzb},</if>
<if test="dwdjdzb != null">dwdjdzb = #{dwdjdzb},</if>
<if test="zb != null">zb = #{zb},</if>
<if test="dzysid != null">dzysid = #{dzysid},</if>
<if test="qtybz != null">qtybz = #{qtybz},</if>
<if test="ssjgdm != null">ssjgdm = #{ssjgdm},</if>
<if test="dzdxtymc != null">dzdxtymc = #{dzdxtymc},</if>
<if test="dzyslx != null">dzyslx = #{dzyslx},</if>
<if test="shry != null">shry = #{shry},</if>
<if test="zrqdm != null">zrqdm = #{zrqdm},</if>
<if test="sjdzysid != null">sjdzysid = #{sjdzysid},</if>
<if test="shzt != null">shzt = #{shzt},</if>
<if test="whzt != null">whzt = #{whzt},</if>
<if test="dzysjb != null">dzysjb = #{dzysjb},</if>
<if test="dzyszt != null">dzyszt = #{dzyszt},</if>
<if test="isactive != null">isactive = #{isactive},</if>
<if test="isdelete != null">isdelete = #{isdelete},</if>
<if test="status != null">status = #{status},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOdsStandardAddressById" parameterType="Long">
delete from ods_standard_address where id = #{id}
</delete>
<delete id="deleteOdsStandardAddressByIds" parameterType="String">
delete from ods_standard_address where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectAddressByStatus" parameterType="com.wt.dataToDBs.v3.pojo.OdsStandardAddress" resultMap="OdsStandardAddressResult">
<include refid="selectOdsStandardAddressVo"/>
where status is null limit 100
</select>
</mapper>

@ -0,0 +1,205 @@
<?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.wt.dataToDBs.v3.mapper.VillageBuildInfoMapper">
<resultMap type="com.wt.dataToDBs.v3.pojo.VillageBuildInfo" id="VillageBuildInfoResult">
<result property="id" column="id"/>
<result property="villageCode" column="village_code"/>
<result property="villageName" column="village_name"/>
<result property="gridCode" column="grid_code"/>
<result property="gridName" column="grid_name"/>
<result property="buildingCode" column="building_code"/>
<result property="buildingName" column="building_name"/>
<result property="buildingType" column="building_type"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<result property="upFloor" column="up_floor"/>
<result property="belowFloor" column="below_floor"/>
<result property="floorAcreage" column="floor_acreage"/>
<result property="buildingAddress" column="building_address"/>
<result property="buildingStatus" column="building_status"/>
<result property="unitNum" column="unit_num"/>
<result property="homeNum" column="home_num"/>
<result property="isactive" column="isactive"/>
</resultMap>
<sql id="selectVillageBuildInfoVo">
select id,
village_code,
village_name,
grid_code,
grid_name,
building_code,
building_name,
building_type,
longitude,
latitude,
up_floor,
below_floor,
floor_acreage,
building_address,
building_status,
isactive,
c1,
c2,
c3,
c4,
c5,
unit_num,
home_num
from village_build_info
</sql>
<select id="selectVillageBuildInfoList" parameterType="com.wt.dataToDBs.v3.pojo.VillageBuildInfo"
resultMap="VillageBuildInfoResult">
<include refid="selectVillageBuildInfoVo"/>
<where>
and isactive = '1'
<if test="id != null and id != ''">and id = #{id}</if>
<if test="villageCode != null and villageCode != ''">and village_code = #{villageCode}</if>
<if test="villageName != null and villageName != ''">and village_name like concat('%', #{villageName},
'%')
</if>
<if test="gridCode != null and gridCode != ''">and grid_code = #{gridCode}</if>
<if test="gridName != null and gridName != ''">and grid_name like concat('%', #{gridName}, '%')</if>
<if test="buildingCode != null and buildingCode != ''">and building_code = #{buildingCode}</if>
<if test="buildingName != null and buildingName != ''">and building_name = #{buildingName}</if>
<if test="buildingType != null ">and building_type = #{buildingType}</if>
<if test="longitude != null ">and longitude = #{longitude}</if>
<if test="latitude != null ">and latitude = #{latitude}</if>
<if test="upFloor != null ">and up_floor = #{upFloor}</if>
<if test="belowFloor != null ">and below_floor = #{belowFloor}</if>
<if test="floorAcreage != null and floorAcreage != ''">and floor_acreage = #{floorAcreage}</if>
<if test="buildingAddress != null and buildingAddress != ''">and building_address = #{buildingAddress}</if>
<if test="buildingStatus != null ">and building_status = #{buildingStatus}</if>
</where>
</select>
<select id="selectVillageBuildInfoById" parameterType="Long" resultMap="VillageBuildInfoResult">
<include refid="selectVillageBuildInfoVo"/>
where id = #{id}
</select>
<insert id="insertVillageBuildInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageBuildInfo"
useGeneratedKeys="true" keyProperty="id">
insert into village_build_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="villageCode != null">village_code,</if>
<if test="villageName != null">village_name,</if>
<if test="gridCode != null">grid_code,</if>
<if test="gridName != null">grid_name,</if>
<if test="buildingCode != null">building_code,</if>
<if test="buildingName != null">building_name,</if>
<if test="buildingType != null">building_type,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="upFloor != null">up_floor,</if>
<if test="belowFloor != null">below_floor,</if>
<if test="floorAcreage != null">floor_acreage,</if>
<if test="buildingAddress != null">building_address,</if>
<if test="buildingStatus != null">building_status,</if>
<if test="isactive != null">isactive,</if>
<if test="unitNum != null">unit_num,</if>
<if test="homeNum != null">home_num,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="villageCode != null">#{villageCode},</if>
<if test="villageName != null">#{villageName},</if>
<if test="gridCode != null">#{gridCode},</if>
<if test="gridName != null">#{gridName},</if>
<if test="buildingCode != null">#{buildingCode},</if>
<if test="buildingName != null">#{buildingName},</if>
<if test="buildingType != null">#{buildingType},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="upFloor != null">#{upFloor},</if>
<if test="belowFloor != null">#{belowFloor},</if>
<if test="floorAcreage != null">#{floorAcreage},</if>
<if test="buildingAddress != null">#{buildingAddress},</if>
<if test="buildingStatus != null">#{buildingStatus},</if>
<if test="isactive != null">#{isactive},</if>
<if test="unitNum != null">#{unitNum},</if>
<if test="homeNum != null">#{homeNum},</if>
</trim>
</insert>
<update id="updateVillageBuildInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageBuildInfo">
update village_build_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
<if test="buildingType != null and buildingType != ''">building_type = #{buildingType},</if>
<if test="longitude != null and longitude != ''">longitude = #{longitude},</if>
<if test="latitude != null and latitude != ''">latitude = #{latitude},</if>
<if test="upFloor != null and upFloor != ''">up_floor = #{upFloor},</if>
<if test="belowFloor != null and belowFloor != ''">below_floor = #{belowFloor},</if>
<if test="floorAcreage != null and floorAcreage != ''">floor_acreage = #{floorAcreage},</if>
<if test="buildingAddress != null and buildingAddress != ''">building_address = #{buildingAddress},</if>
<if test="buildingStatus != null and buildingStatus != ''">building_status = #{buildingStatus},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="unitNum != null and unitNum != ''">unit_num = #{unitNum},</if>
<if test="homeNum != null and homeNum != ''">home_num = #{homeNum},</if>
</trim>
where id = #{id}
</update>
<select id="selectBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageBuildInfo"
resultMap="VillageBuildInfoResult">
<include refid="selectVillageBuildInfoVo"/>
where village_code = #{villageCode}
and building_name = #{buildingName}
limit 1
</select>
<update id="updateBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageBuildInfo">
update village_build_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
<if test="buildingType != null and buildingType != ''">building_type = #{buildingType},</if>
<if test="longitude != null and longitude != ''">longitude = #{longitude},</if>
<if test="latitude != null and latitude != ''">latitude = #{latitude},</if>
<if test="upFloor != null and upFloor != ''">up_floor = #{upFloor},</if>
<if test="belowFloor != null and belowFloor != ''">below_floor = #{belowFloor},</if>
<if test="floorAcreage != null and floorAcreage != ''">floor_acreage = #{floorAcreage},</if>
<if test="buildingAddress != null and buildingAddress != ''">building_address = #{buildingAddress},</if>
<if test="buildingStatus != null and buildingStatus != ''">building_status = #{buildingStatus},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="unitNum != null and unitNum != ''">unit_num = #{unitNum},</if>
<if test="homeNum != null and homeNum != ''">home_num = #{homeNum},</if>
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
</trim>
where village_code = #{villageCode}
and building_name = #{buildingName}
</update>
<select id="getLastDigits" parameterType="com.wt.dataToDBs.v3.pojo.VillageBuildInfo"
resultType="java.lang.String">
SELECT RIGHT(building_code, 3) AS last_two_digits
FROM village_build_info
where village_code = #{villageCode}
and grid_code = #{gridCode}
ORDER BY id DESC
LIMIT 1;
</select>
</mapper>

@ -0,0 +1,217 @@
<?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.wt.dataToDBs.v3.mapper.VillageGridInfoMapper">
<resultMap type="com.wt.dataToDBs.v3.pojo.VillageGridInfo" id="VillageGridInfoResult">
<result property="id" column="id"/>
<result property="villageCode" column="village_code"/>
<result property="villageName" column="village_name"/>
<result property="provinceCode" column="province_code"/>
<result property="provinceName" column="province_name"/>
<result property="cityCode" column="city_code"/>
<result property="cityName" column="city_name"/>
<result property="areaCode" column="area_code"/>
<result property="areaName" column="area_name"/>
<result property="streetCode" column="street_code"/>
<result property="streetName" column="street_name"/>
<result property="blockCode" column="block_code"/>
<result property="blockName" column="block_name"/>
<result property="gridCode" column="grid_code"/>
<result property="gridName" column="grid_name"/>
<result property="isactive" column="isactive"/>
<result property="c1" column="c1"/>
<result property="c2" column="c2"/>
<result property="c3" column="c3"/>
<result property="c4" column="c4"/>
<result property="c5" column="c5"/>
</resultMap>
<sql id="selectVillageGridInfoVo">
select id,
village_code,
village_name,
province_code,
province_name,
city_code,
city_name,
area_code,
area_name,
street_code,
street_name,
block_code,
block_name,
grid_code,
grid_name,
isactive,
c1,
c2,
c3,
c4,
c5
from village_grid_info
</sql>
<select id="selectVillageGridInfoList" parameterType="com.wt.dataToDBs.v3.pojo.VillageGridInfo"
resultMap="VillageGridInfoResult">
<include refid="selectVillageGridInfoVo"/>
<where>
and isactive = '1'
<if test="id != null and id != ''">and id = #{id}</if>
<if test="villageCode != null and villageCode != ''">and village_code = #{villageCode}</if>
<if test="villageName != null and villageName != ''">and village_name like concat('%', #{villageName},
'%')
</if>
<if test="provinceCode != null and provinceCode != ''">and province_code = #{provinceCode}</if>
<if test="provinceName != null and provinceName != ''">and province_name like concat('%', #{provinceName},
'%')
</if>
<if test="cityCode != null and cityCode != ''">and city_code = #{cityCode}</if>
<if test="cityName != null and cityName != ''">and city_name like concat('%', #{cityName}, '%')</if>
<if test="areaCode != null and areaCode != ''">and area_code = #{areaCode}</if>
<if test="areaName != null and areaName != ''">and area_name like concat('%', #{areaName}, '%')</if>
<if test="streetCode != null and streetCode != ''">and street_code = #{streetCode}</if>
<if test="streetName != null and streetName != ''">and street_name like concat('%', #{streetName}, '%')
</if>
<if test="blockCode != null and blockCode != ''">and block_code = #{blockCode}</if>
<if test="blockName != null and blockName != ''">and block_name like concat('%', #{blockName}, '%')</if>
<if test="gridCode != null and gridCode != ''">and grid_code = #{gridCode}</if>
<if test="gridName != null and gridName != ''">and grid_name like concat('%', #{gridName}, '%')</if>
<if test="c1 != null and c1 != ''">and c1 = #{c1}</if>
<if test="c2 != null and c2 != ''">and c2 = #{c2}</if>
<if test="c3 != null and c3 != ''">and c3 = #{c3}</if>
<if test="c4 != null and c4 != ''">and c4 = #{c4}</if>
<if test="c5 != null and c5 != ''">and c5 = #{c5}</if>
</where>
</select>
<select id="selectVillageGridInfoById" parameterType="Long" resultMap="VillageGridInfoResult">
<include refid="selectVillageGridInfoVo"/>
where id = #{id}
</select>
<insert id="insertVillageGridInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageGridInfo"
useGeneratedKeys="true" keyProperty="id">
insert into village_grid_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="villageCode != null">village_code,</if>
<if test="villageName != null">village_name,</if>
<if test="provinceCode != null">province_code,</if>
<if test="provinceName != null">province_name,</if>
<if test="cityCode != null">city_code,</if>
<if test="cityName != null">city_name,</if>
<if test="areaCode != null">area_code,</if>
<if test="areaName != null">area_name,</if>
<if test="streetCode != null">street_code,</if>
<if test="streetName != null">street_name,</if>
<if test="blockCode != null">block_code,</if>
<if test="blockName != null">block_name,</if>
<if test="gridCode != null">grid_code,</if>
<if test="gridName != null">grid_name,</if>
<if test="isactive != null">isactive,</if>
<if test="c1 != null">c1,</if>
<if test="c2 != null">c2,</if>
<if test="c3 != null">c3,</if>
<if test="c4 != null">c4,</if>
<if test="c5 != null">c5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="villageCode != null">#{villageCode},</if>
<if test="villageName != null">#{villageName},</if>
<if test="provinceCode != null">#{provinceCode},</if>
<if test="provinceName != null">#{provinceName},</if>
<if test="cityCode != null">#{cityCode},</if>
<if test="cityName != null">#{cityName},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="areaName != null">#{areaName},</if>
<if test="streetCode != null">#{streetCode},</if>
<if test="streetName != null">#{streetName},</if>
<if test="blockCode != null">#{blockCode},</if>
<if test="blockName != null">#{blockName},</if>
<if test="gridCode != null">#{gridCode},</if>
<if test="gridName != null">#{gridName},</if>
<if test="isactive != null">#{isactive},</if>
<if test="c1 != null">#{c1},</if>
<if test="c2 != null">#{c2},</if>
<if test="c3 != null">#{c3},</if>
<if test="c4 != null">#{c4},</if>
<if test="c5 != null">#{c5},</if>
</trim>
</insert>
<update id="updateVillageGridInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageGridInfo">
update village_grid_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="provinceCode != null and provinceCode != ''">province_code = #{provinceCode},</if>
<if test="provinceName != null and provinceName != ''">province_name = #{provinceName},</if>
<if test="cityCode != null and cityCode != ''">city_code = #{cityCode},</if>
<if test="cityName != null and cityName != ''">city_name = #{cityName},</if>
<if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
<if test="streetCode != null and streetCode != ''">street_code = #{streetCode},</if>
<if test="streetName != null and streetName != ''">street_name = #{streetName},</if>
<if test="blockCode != null and blockCode != ''">block_code = #{blockCode},</if>
<if test="blockName != null and blockName != ''">block_name = #{blockName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="c1 != null and c1 != ''">c1 = #{c1},</if>
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
</trim>
where id = #{id}
</update>
<select id="selectBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageGridInfo"
resultMap="VillageGridInfoResult">
<include refid="selectVillageGridInfoVo"/>
where village_code = #{villageCode}
limit 1
</select>
<update id="updateBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageGridInfo">
update village_grid_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="provinceCode != null and provinceCode != ''">province_code = #{provinceCode},</if>
<if test="provinceName != null and provinceName != ''">province_name = #{provinceName},</if>
<if test="cityCode != null and cityCode != ''">city_code = #{cityCode},</if>
<if test="cityName != null and cityName != ''">city_name = #{cityName},</if>
<if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
<if test="streetCode != null and streetCode != ''">street_code = #{streetCode},</if>
<if test="streetName != null and streetName != ''">street_name = #{streetName},</if>
<if test="blockCode != null and blockCode != ''">block_code = #{blockCode},</if>
<if test="blockName != null and blockName != ''">block_name = #{blockName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
</trim>
where village_code = #{villageCode}
</update>
<select id="getLastDigits" parameterType="com.wt.dataToDBs.v3.pojo.VillageGridInfo"
resultType="java.lang.String">
SELECT RIGHT(grid_code, 2) AS last_two_digits
FROM village_grid_info
where village_code = #{villageCode}
ORDER BY id DESC
LIMIT 1;
</select>
</mapper>

@ -0,0 +1,314 @@
<?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.wt.dataToDBs.v3.mapper.VillageHomeInfoMapper">
<resultMap type="com.wt.dataToDBs.v3.pojo.VillageHomeInfo" id="VillageHomeInfoResult">
<result property="id" column="id"/>
<result property="villageCode" column="village_code"/>
<result property="villageName" column="village_name"/>
<result property="gridCode" column="grid_code"/>
<result property="gridName" column="grid_name"/>
<result property="buildingCode" column="building_code"/>
<result property="buildingName" column="building_name"/>
<result property="unitCode" column="unit_code"/>
<result property="unitName" column="unit_name"/>
<result property="homeCode" column="home_code"/>
<result property="homeName" column="home_name"/>
<result property="homeFloor" column="home_floor"/>
<result property="homeAdddress" column="home_adddress"/>
<result property="homeAcreage" column="home_acreage"/>
<result property="insideAcreage" column="inside_acreage"/>
<result property="homeType" column="home_type"/>
<result property="homeCategory" column="home_category"/>
<result property="homeUse" column="home_use"/>
<result property="homePersonNum" column="home_person_num"/>
<result property="homeDoorModel" column="home_door_model"/>
<result property="homeState" column="home_state"/>
<result property="certificateCode" column="certificate_code"/>
<result property="propertyOwner" column="property_owner"/>
<result property="propertyOwnerPhone" column="property_owner_phone"/>
<result property="isactive" column="isactive"/>
<result property="c1" column="c1"/>
<result property="c2" column="c2"/>
<result property="c3" column="c3"/>
<result property="c4" column="c4"/>
<result property="c5" column="c5"/>
<result property="roomNum" column="room_num"/>
<result property="caringLabelCn" column="caring_label_cn"/>
<result property="caringLabel" column="caring_label"/>
</resultMap>
<sql id="selectVillageHomeInfoVo">
select id,
village_code,
village_name,
grid_code,
grid_name,
building_code,
building_name,
unit_code,
unit_name,
home_code,
home_name,
home_floor,
home_adddress,
home_acreage,
inside_acreage,
home_type,
home_category,
home_use,
home_person_num,
home_door_model,
home_state,
certificate_code,
property_owner,
property_owner_phone,
isactive,
c1,
c2,
c3,
c4,
c5,
room_num
from village_home_info
</sql>
<select id="selectVillageHomeInfoList" parameterType="com.wt.dataToDBs.v3.pojo.VillageHomeInfo" resultMap="VillageHomeInfoResult">
<include refid="selectVillageHomeInfoVo"/>
<where>
and isactive = '1'
<if test="id != null and id != ''">and id = #{id}</if>
<if test="villageCode != null and villageCode != ''">and village_code = #{villageCode}</if>
<if test="villageName != null and villageName != ''">and village_name = #{villageName}</if>
<if test="gridName != null and gridName != ''">and grid_name = #{gridName}</if>
<if test="gridCode != null and gridCode != ''">and grid_code = #{gridCode}</if>
<if test="buildingCode != null and buildingCode != ''">and building_code = #{buildingCode}</if>
<if test="buildingName != null and buildingName != ''"> and building_name = #{buildingName}</if>
<if test="unitName != null and unitName != ''"> and unit_name = #{unitName}</if>
<if test="homeName != null and homeName != ''"> and home_name = #{homeName}</if>
<if test="unitCode != null and unitCode != ''">and unit_code = #{unitCode}</if>
<if test="homeCode != null and homeCode != ''">and home_code = #{homeCode}</if>
<if test="homeFloor != null ">and home_floor = #{homeFloor}</if>
<if test="homeAdddress != null and homeAdddress != ''">and home_adddress = #{homeAdddress}</if>
<if test="homeAcreage != null and homeAcreage != ''">and home_acreage = #{homeAcreage}</if>
<if test="insideAcreage != null and insideAcreage != ''">and inside_acreage = #{insideAcreage}</if>
<if test="homeType != null ">and home_type = #{homeType}</if>
<if test="homeCategory != null ">and home_category = #{homeCategory}</if>
<if test="homeUse != null ">and home_use = #{homeUse}</if>
<if test="homePersonNum != null ">and home_person_num = #{homePersonNum}</if>
<if test="homeDoorModel != null and homeDoorModel != ''">and home_door_model = #{homeDoorModel}</if>
<if test="homeState != null ">and home_state = #{homeState}</if>
<if test="certificateCode != null and certificateCode != ''">and certificate_code = #{certificateCode}</if>
<if test="propertyOwner != null and propertyOwner != ''">and property_owner = #{propertyOwner}</if>
<if test="propertyOwnerPhone != null and propertyOwnerPhone != ''">and property_owner_phone =
#{propertyOwnerPhone}
</if>
<if test="c1 != null and c1 != ''">and c1 = #{c1}</if>
<if test="c2 != null and c2 != ''">and c2 = #{c2}</if>
<if test="c3 != null and c3 != ''">and c3 = #{c3}</if>
<if test="c4 != null and c4 != ''">and c4 = #{c4}</if>
<if test="c5 != null and c5 != ''">and c5 = #{c5}</if>
</where>
</select>
<select id="selectVillageHomeInfoById" parameterType="Long" resultMap="VillageHomeInfoResult">
<include refid="selectVillageHomeInfoVo"/>
where id = #{id}
</select>
<insert id="insertVillageHomeInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageHomeInfo" useGeneratedKeys="true" keyProperty="id">
insert into village_home_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="villageCode != null">village_code,</if>
<if test="villageName != null">village_name,</if>
<if test="gridCode != null">grid_code,</if>
<if test="gridName != null">grid_name,</if>
<if test="buildingCode != null">building_code,</if>
<if test="buildingName != null">building_name,</if>
<if test="unitCode != null">unit_code,</if>
<if test="unitName != null">unit_name,</if>
<if test="homeCode != null">home_code,</if>
<if test="homeName != null">home_name,</if>
<if test="homeFloor != null">home_floor,</if>
<if test="homeAdddress != null">home_adddress,</if>
<if test="homeAcreage != null">home_acreage,</if>
<if test="insideAcreage != null">inside_acreage,</if>
<if test="homeType != null">home_type,</if>
<if test="homeCategory != null">home_category,</if>
<if test="homeUse != null">home_use,</if>
<if test="homePersonNum != null">home_person_num,</if>
<if test="homeDoorModel != null">home_door_model,</if>
<if test="homeState != null">home_state,</if>
<if test="certificateCode != null">certificate_code,</if>
<if test="propertyOwner != null">property_owner,</if>
<if test="propertyOwnerPhone != null and propertyOwnerPhone != ''">property_owner_phone,</if>
<if test="isactive != null">isactive,</if>
<if test="c1 != null">c1,</if>
<if test="c2 != null">c2,</if>
<if test="c3 != null">c3,</if>
<if test="c4 != null">c4,</if>
<if test="c5 != null">c5,</if>
<if test="roomNum != null">room_num,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="villageCode != null">#{villageCode},</if>
<if test="villageName != null">#{villageName},</if>
<if test="gridCode != null">#{gridCode},</if>
<if test="gridName != null">#{gridName},</if>
<if test="buildingCode != null">#{buildingCode},</if>
<if test="buildingName != null">#{buildingName},</if>
<if test="unitCode != null">#{unitCode},</if>
<if test="unitName != null">#{unitName},</if>
<if test="homeCode != null">#{homeCode},</if>
<if test="homeName != null">#{homeName},</if>
<if test="homeFloor != null">#{homeFloor},</if>
<if test="homeAdddress != null">#{homeAdddress},</if>
<if test="homeAcreage != null">#{homeAcreage},</if>
<if test="insideAcreage != null">#{insideAcreage},</if>
<if test="homeType != null">#{homeType},</if>
<if test="homeCategory != null">#{homeCategory},</if>
<if test="homeUse != null">#{homeUse},</if>
<if test="homePersonNum != null">#{homePersonNum},</if>
<if test="homeDoorModel != null">#{homeDoorModel},</if>
<if test="homeState != null">#{homeState},</if>
<if test="certificateCode != null">#{certificateCode},</if>
<if test="propertyOwner != null">#{propertyOwner},</if>
<if test="propertyOwnerPhone != null and propertyOwnerPhone != ''">#{propertyOwnerPhone},</if>
<if test="isactive != null">#{isactive},</if>
<if test="c1 != null">#{c1},</if>
<if test="c2 != null">#{c2},</if>
<if test="c3 != null">#{c3},</if>
<if test="c4 != null">#{c4},</if>
<if test="c5 != null">#{c5},</if>
<if test="roomNum != null">#{roomNum},</if>
</trim>
</insert>
<update id="updateVillageHomeInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageHomeInfo">
update village_home_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
<if test="unitCode != null and unitCode != ''">unit_code = #{unitCode},</if>
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
<if test="homeCode != null and homeCode != ''">home_code = #{homeCode},</if>
<if test="homeName != null and homeName != ''">home_name = #{homeName},</if>
<if test="homeFloor != null and homeFloor != ''">home_floor = #{homeFloor},</if>
<if test="homeAdddress != null and homeAdddress != ''">home_adddress = #{homeAdddress},</if>
<if test="homeAcreage != null and homeAcreage != ''">home_acreage = #{homeAcreage},</if>
<if test="insideAcreage != null and insideAcreage != ''">inside_acreage = #{insideAcreage},</if>
<if test="homeType != null and homeType != ''">home_type = #{homeType},</if>
<if test="homeCategory != null and homeCategory!= ''">home_category = #{homeCategory},</if>
<if test="homeUse != null and homeUse != ''">home_use = #{homeUse},</if>
<if test="homePersonNum != null and homePersonNum != ''">home_person_num = #{homePersonNum},</if>
<if test="homeDoorModel != null and homeDoorModel != ''">home_door_model = #{homeDoorModel},</if>
<if test="homeState != null and homeState != ''">home_state = #{homeState},</if>
<if test="certificateCode != null and certificateCode != ''">certificate_code = #{certificateCode},</if>
<if test="propertyOwner != null and propertyOwner != ''">property_owner = #{propertyOwner},</if>
<if test="propertyOwnerPhone != null and propertyOwnerPhone != ''">property_owner_phone = #{propertyOwnerPhone},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="c1 != null and c1 != ''">c1 = #{c1},</if>
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
<if test="roomNum != null and roomNum != ''">room_num = #{roomNum},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteVillageHomeInfoById" parameterType="Long">
delete
from village_home_info
where id = #{id}
</delete>
<delete id="deleteVillageHomeInfoByIds" parameterType="String">
delete from village_home_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="logicDelete">
update village_home_info
set isactive='0'
where id in (${idsIn})
</update>
<delete id="deleteVillageHomeInfoByVillageCode" parameterType="string">
delete
from village_home_info
where village_code = #{villageCode}
</delete>
<select id="selectBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageHomeInfo"
resultMap="VillageHomeInfoResult">
<include refid="selectVillageHomeInfoVo"/>
where village_code = #{villageCode}
and building_name = #{buildingName}
and unit_name = #{unitName}
and home_name = #{homeName}
limit 1
</select>
<update id="updateBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageHomeInfo">
update village_home_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
<if test="unitCode != null and unitCode != ''">unit_code = #{unitCode},</if>
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
<if test="homeCode != null and homeCode != ''">home_code = #{homeCode},</if>
<if test="homeName != null and homeName != ''">home_name = #{homeName},</if>
<if test="homeFloor != null and homeFloor != ''">home_floor = #{homeFloor},</if>
<if test="homeAdddress != null and homeAdddress != ''">home_adddress = #{homeAdddress},</if>
<if test="homeAcreage != null and homeAcreage != ''">home_acreage = #{homeAcreage},</if>
<if test="insideAcreage != null and insideAcreage != ''">inside_acreage = #{insideAcreage},</if>
<if test="homeType != null and homeType != ''">home_type = #{homeType},</if>
<if test="homeCategory != null and homeCategory!= ''">home_category = #{homeCategory},</if>
<if test="homeUse != null and homeUse != ''">home_use = #{homeUse},</if>
<if test="homePersonNum != null and homePersonNum != ''">home_person_num = #{homePersonNum},</if>
<if test="homeDoorModel != null and homeDoorModel != ''">home_door_model = #{homeDoorModel},</if>
<if test="homeState != null and homeState != ''">home_state = #{homeState},</if>
<if test="certificateCode != null and certificateCode != ''">certificate_code = #{certificateCode},</if>
<if test="propertyOwner != null and propertyOwner != ''">property_owner = #{propertyOwner},</if>
<if test="propertyOwnerPhone != null and propertyOwnerPhone != ''">property_owner_phone = #{propertyOwnerPhone},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
<if test="roomNum != null and roomNum != ''">room_num = #{roomNum},</if>
</trim>
where village_code = #{villageCode}
and building_name = #{buildingName}
and unit_name = #{unitName}
and home_name = #{homeName}
</update>
<select id="getLastDigits" parameterType="com.wt.dataToDBs.v3.pojo.VillageHomeInfo"
resultType="java.lang.String">
SELECT RIGHT(home_code, 4) AS last_two_digits
FROM village_home_info
where village_code = #{villageCode}
and building_code = #{buildingCode}
and unit_code = #{unitCode}
ORDER BY id DESC
LIMIT 1;
</select>
</mapper>

@ -0,0 +1,240 @@
<?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.wt.dataToDBs.v3.mapper.VillageJwzUserInfoDao">
<resultMap type="com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo" id="VillageJwzUserInfoDoResult">
<result property="id" column="id" />
<result property="householderRelation" column="householder_relation" />
<result property="education" column="education" />
<result property="religious" column="religious" />
<result property="marriage" column="marriage" />
<result property="politicalOutlook" column="political_outlook" />
<result property="managementStatus" column="management_status" />
<result property="userPic" column="user_pic" />
<result property="userName" column="user_name" />
<result property="phone" column="phone" />
<result property="accountNumber" column="account_number" />
<result property="landline" column="landline" />
<result property="idCard" column="id_card" />
<result property="houseHoldRegister" column="house_hold_register" />
<result property="houseHoldAddress" column="house_hold_address" />
<result property="spouseName" column="spouse_name" />
<result property="spouseIdCard" column="spouse_id_card" />
<result property="fatherName" column="father_name" />
<result property="fatherIdCard" column="father_id_card" />
<result property="motherName" column="mother_name" />
<result property="motherIdCard" column="mother_id_card" />
<result property="policeDistrictCode" column="police_district_code" />
<result property="isactive" column="isactive" />
</resultMap>
<sql id="selectVillageJwzUserInfoDoVo">
select
id,
householder_relation,
education,
religious,
marriage,
political_outlook,
management_status,
user_pic,
user_name,
phone,
account_number,
landline,
id_card,
house_hold_register,
house_hold_address,
spouse_name,
spouse_id_card,
father_name,
father_id_card,
mother_name,
mother_id_card,
police_district_code,
isactive
from village_jwz_user_info
</sql>
<select id="selectVillageJwzUserInfoList" parameterType="com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo" resultMap="VillageJwzUserInfoDoResult">
<include refid="selectVillageJwzUserInfoDoVo"/>
<where>
<if test="userName != null and userName != ''"> and user_name = #{userName}</if>
</where>
</select>
<select id="selectVillageJwzUserInfoById" parameterType="Long" resultMap="VillageJwzUserInfoDoResult">
<include refid="selectVillageJwzUserInfoDoVo"/>
where id = #{id}
</select>
<select id="selectVillageJwzUserInfoByIdcard" parameterType="String" resultMap="VillageJwzUserInfoDoResult">
<include refid="selectVillageJwzUserInfoDoVo"/>
where id_card = #{idCard} limit 1
</select>
<insert id="insertVillageJwzUserInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo" useGeneratedKeys="true" keyProperty="id">
insert into village_jwz_user_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="householderRelation != null and householderRelation != ''">householder_relation,</if>
<if test="education != null and education != ''">education,</if>
<if test="religious != null and religious != ''">religious,</if>
<if test="marriage != null and marriage != ''">marriage,</if>
<if test="politicalOutlook != null and politicalOutlook != ''">political_outlook,</if>
<if test="managementStatus != null and managementStatus != ''">management_status,</if>
<if test="userPic != null and userPic != ''">user_pic,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="accountNumber != null and accountNumber != ''">account_number,</if>
<if test="landline != null and landline != ''">landline,</if>
<if test="idCard != null and idCard != ''">id_card,</if>
<if test="houseHoldRegister != null and houseHoldRegister != ''">house_hold_register,</if>
<if test="houseHoldAddress != null and houseHoldAddress != ''">house_hold_address,</if>
<if test="spouseName != null and spouseName != ''">spouse_name,</if>
<if test="spouseIdCard != null and spouseIdCard != ''">spouse_id_card,</if>
<if test="fatherName != null and fatherName != ''">father_name,</if>
<if test="fatherIdCard != null and fatherIdCard != ''">father_id_card,</if>
<if test="motherName != null and motherName != ''">mother_name,</if>
<if test="motherIdCard != null and motherIdCard != ''">mother_id_card,</if>
<if test="policeDistrictCode != null and policeDistrictCode != ''">police_district_code,</if>
<if test="isactive != null and isactive != ''">isactive,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="householderRelation != null and householderRelation != ''">#{householderRelation},</if>
<if test="education != null and education != ''">#{education},</if>
<if test="religious != null and religious != ''">#{religious},</if>
<if test="marriage != null and marriage != ''">#{marriage},</if>
<if test="politicalOutlook != null and politicalOutlook != ''">#{politicalOutlook},</if>
<if test="managementStatus != null and managementStatus != ''">#{managementStatus},</if>
<if test="userPic != null and userPic != ''">#{userPic},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="accountNumber != null and accountNumber != ''">#{accountNumber},</if>
<if test="landline != null and landline != ''">#{landline},</if>
<if test="idCard != null and idCard != ''">#{idCard},</if>
<if test="houseHoldRegister != null and houseHoldRegister != ''">#{houseHoldRegister},</if>
<if test="houseHoldAddress != null and houseHoldAddress != ''">#{houseHoldAddress},</if>
<if test="spouseName != null and spouseName != ''">#{spouseName},</if>
<if test="spouseIdCard != null and spouseIdCard != ''">#{spouseIdCard},</if>
<if test="fatherName != null and fatherName != ''">#{fatherName},</if>
<if test="fatherIdCard != null and fatherIdCard != ''">#{fatherIdCard},</if>
<if test="motherName != null and motherName != ''">#{motherName},</if>
<if test="motherIdCard != null and motherIdCard != ''">#{motherIdCard},</if>
<if test="policeDistrictCode != null and policeDistrictCode != ''">#{policeDistrictCode},</if>
<if test="isactive != null and isactive != ''">#{isactive},</if>
</trim>
</insert>
<update id="updateVillageJwzUserInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo">
update village_jwz_user_info
<trim prefix="SET" suffixOverrides=",">
<if test="householderRelation != null and householderRelation != ''">householder_relation = #{householderRelation},</if>
<if test="education != null and education != ''">education = #{education},</if>
<if test="religious != null and religious != ''">religious = #{religious},</if>
<if test="marriage != null and marriage != ''">marriage = #{marriage},</if>
<if test="politicalOutlook != null and politicalOutlook != ''">political_outlook = #{politicalOutlook},</if>
<if test="managementStatus != null and managementStatus != ''">management_status = #{managementStatus},</if>
<if test="userPic != null and userPic != ''">user_pic = #{userPic},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="accountNumber != null and accountNumber != ''">account_number = #{accountNumber},</if>
<if test="landline != null and landline != ''">landline = #{landline},</if>
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
<if test="houseHoldRegister != null and houseHoldRegister != ''">house_hold_register = #{houseHoldRegister},</if>
<if test="houseHoldAddress != null and houseHoldAddress != ''">house_hold_address = #{houseHoldAddress},</if>
<if test="spouseName != null and spouseName != ''">spouse_name = #{spouseName},</if>
<if test="spouseIdCard != null and spouseIdCard != ''">spouse_id_card = #{spouseIdCard},</if>
<if test="fatherName != null and fatherName != ''">father_name = #{fatherName},</if>
<if test="fatherIdCard != null and fatherIdCard != ''">father_id_card = #{fatherIdCard},</if>
<if test="motherName != null and motherName != ''">mother_name = #{motherName},</if>
<if test="motherIdCard != null and motherIdCard != ''">mother_id_card = #{motherIdCard},</if>
<if test="policeDistrictCode != null and policeDistrictCode != ''">police_district_code = #{policeDistrictCode},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
</trim>
where id = #{id}
</update>
<update id="updateVillageJwzUserInfoByIdcard" parameterType="com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo">
update village_jwz_user_info
<trim prefix="SET" suffixOverrides=",">
<if test="householderRelation != null and householderRelation != ''">householder_relation = #{householderRelation},</if>
<if test="education != null and education != ''">education = #{education},</if>
<if test="religious != null and religious != ''">religious = #{religious},</if>
<if test="marriage != null and marriage != ''">marriage = #{marriage},</if>
<if test="politicalOutlook != null and politicalOutlook != ''">political_outlook = #{politicalOutlook},</if>
<if test="managementStatus != null and managementStatus != ''">management_status = #{managementStatus},</if>
<if test="userPic != null and userPic != ''">user_pic = #{userPic},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="accountNumber != null and accountNumber != ''">account_number = #{accountNumber},</if>
<if test="landline != null and landline != ''">landline = #{landline},</if>
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
<if test="houseHoldRegister != null and houseHoldRegister != ''">house_hold_register = #{houseHoldRegister},</if>
<if test="houseHoldAddress != null and houseHoldAddress != ''">house_hold_address = #{houseHoldAddress},</if>
<if test="spouseName != null and spouseName != ''">spouse_name = #{spouseName},</if>
<if test="spouseIdCard != null and spouseIdCard != ''">spouse_id_card = #{spouseIdCard},</if>
<if test="fatherName != null and fatherName != ''">father_name = #{fatherName},</if>
<if test="fatherIdCard != null and fatherIdCard != ''">father_id_card = #{fatherIdCard},</if>
<if test="motherName != null and motherName != ''">mother_name = #{motherName},</if>
<if test="motherIdCard != null and motherIdCard != ''">mother_id_card = #{motherIdCard},</if>
<if test="policeDistrictCode != null and policeDistrictCode != ''">police_district_code = #{policeDistrictCode},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
</trim>
where id_card = #{idCard}
</update>
<delete id="deleteVillageJwzUserInfoById" parameterType="Long">
delete from village_jwz_user_info where id = #{id}
</delete>
<delete id="deleteVillageJwzUserInfoByUpdatetime" parameterType="com.wt.dataToDBs.v3.pojo.VillageJwzUserInfoDo">
delete from village_jwz_user_info where DATE_FORMAT(updatetime, '%Y-%m-%d') != '${updatetimeV}'
</delete>
<delete id="deleteVillageJwzUserInfoByIds" parameterType="String">
delete from village_jwz_user_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="list" resultMap="VillageJwzUserInfoDoResult">
select * from village_jwz_user_info
where
1=1
and id > ${first}
limit 200
</select>
</mapper>

@ -168,5 +168,10 @@
limit 200;
</select>
<select id="getLastRecord" resultMap="VillageSendStaticRecordResult">
select * from village_send_static_record where table_name =#{tableName} and manufactor_no = '888888'
and table_id is null order by id desc limit 1
</select>
</mapper>

@ -0,0 +1,180 @@
<?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.wt.dataToDBs.v3.mapper.VillageUnitInfoMapper">
<resultMap type="com.wt.dataToDBs.v3.pojo.VillageUnitInfo" id="VillageUnitInfoResult">
<result property="id" column="id"/>
<result property="villageCode" column="village_code"/>
<result property="villageName" column="village_name"/>
<result property="gridCode" column="grid_code"/>
<result property="gridName" column="grid_name"/>
<result property="buildingCode" column="building_code"/>
<result property="buildingName" column="building_name"/>
<result property="unitCode" column="unit_code"/>
<result property="unitName" column="unit_name"/>
<result property="unitAddress" column="unit_address"/>
<result property="isactive" column="isactive"/>
<result property="c1" column="c1"/>
<result property="c2" column="c2"/>
<result property="c3" column="c3"/>
<result property="c4" column="c4"/>
<result property="c5" column="c5"/>
</resultMap>
<sql id="selectVillageUnitInfoVo">
select id,
village_code,
village_name,
grid_code,
grid_name,
building_code,
building_name,
unit_code,
unit_name,
unit_address,
isactive,
c1,
c2,
c3,
c4,
c5
from village_unit_info
</sql>
<select id="selectVillageUnitInfoList" parameterType="com.wt.dataToDBs.v3.pojo.VillageUnitInfo" resultMap="VillageUnitInfoResult">
<include refid="selectVillageUnitInfoVo"/>
<where>
and isactive = '1'
<if test="id != null and id != ''">and id = #{id}</if>
<if test="villageCode != null and villageCode != ''">and village_code = #{villageCode}</if>
<if test="villageName != null and villageName != ''">and village_name like concat('%', #{villageName},
'%')
</if>
<if test="gridCode != null and gridCode != ''">and grid_code = #{villageCode}</if>
<if test="gridName != null and gridName != ''">and village_code = #{villageCode}</if>
<if test="buildingCode != null and buildingCode != ''">and building_code = #{buildingCode}</if>
<if test="unitCode != null and unitCode != ''">and unit_code = #{unitCode}</if>
<if test="buildingName != null and buildingName != ''"> and building_name = #{buildingName}</if>
<if test="unitName != null and unitName != ''"> and unit_name = #{unitName}</if>
<if test="unitAddress != null and unitAddress != ''">and unit_address = #{unitAddress}</if>
<if test="c1 != null and c1 != ''">and c1 = #{c1}</if>
<if test="c2 != null and c2 != ''">and c2 = #{c2}</if>
<if test="c3 != null and c3 != ''">and c3 = #{c3}</if>
<if test="c4 != null and c4 != ''">and c4 = #{c4}</if>
<if test="c5 != null and c5 != ''">and c5 = #{c5}</if>
</where>
</select>
<select id="selectVillageUnitInfoById" parameterType="Long" resultMap="VillageUnitInfoResult">
<include refid="selectVillageUnitInfoVo"/>
where id = #{id}
</select>
<insert id="insertVillageUnitInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageUnitInfo" useGeneratedKeys="true" keyProperty="id">
insert into village_unit_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="villageCode != null">village_code,</if>
<if test="villageName != null">village_name,</if>
<if test="gridCode != null">grid_code,</if>
<if test="gridName != null">grid_name,</if>
<if test="buildingCode != null">building_code,</if>
<if test="buildingName != null">building_name,</if>
<if test="unitCode != null">unit_code,</if>
<if test="unitName != null">unit_name,</if>
<if test="unitAddress != null">unit_address,</if>
<if test="isactive != null">isactive,</if>
<if test="c1 != null">c1,</if>
<if test="c2 != null">c2,</if>
<if test="c3 != null">c3,</if>
<if test="c4 != null">c4,</if>
<if test="c5 != null">c5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="villageCode != null">#{villageCode},</if>
<if test="villageName != null">#{villageName},</if>
<if test="gridCode != null">#{gridCode},</if>
<if test="gridName != null">#{gridName},</if>
<if test="buildingCode != null">#{buildingCode},</if>
<if test="buildingName != null">#{buildingName},</if>
<if test="unitCode != null">#{unitCode},</if>
<if test="unitName != null">#{unitName},</if>
<if test="unitAddress != null">#{unitAddress},</if>
<if test="isactive != null">#{isactive},</if>
<if test="c1 != null">#{c1},</if>
<if test="c2 != null">#{c2},</if>
<if test="c3 != null">#{c3},</if>
<if test="c4 != null">#{c4},</if>
<if test="c5 != null">#{c5},</if>
</trim>
</insert>
<update id="updateVillageUnitInfo" parameterType="com.wt.dataToDBs.v3.pojo.VillageUnitInfo">
update village_unit_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
<if test="unitCode != null and unitCode != ''">unit_code = #{unitCode},</if>
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
<if test="unitAddress != null and unitAddress != ''">unit_address = #{unitAddress},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="c1 != null and c1 != ''">c1 = #{c1},</if>
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
</trim>
where id = #{id}
</update>
<select id="selectBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageUnitInfo"
resultMap="VillageUnitInfoResult">
<include refid="selectVillageUnitInfoVo"/>
where village_code = #{villageCode}
and building_name = #{buildingName}
and unit_name = #{unitName}
limit 1
</select>
<update id="updateBeansByCode" parameterType="com.wt.dataToDBs.v3.pojo.VillageUnitInfo">
update village_unit_info
<trim prefix="SET" suffixOverrides=",">
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
<if test="unitCode != null and unitCode != ''">unit_code = #{unitCode},</if>
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
<if test="unitAddress != null and unitAddress != ''">unit_address = #{unitAddress},</if>
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
</trim>
where village_code = #{villageCode}
and building_name = #{buildingName}
and unit_name = #{unitName}
</update>
<select id="getLastDigits" parameterType="com.wt.dataToDBs.v3.pojo.VillageUnitInfo"
resultType="java.lang.String">
SELECT RIGHT(unit_code, 2) AS last_two_digits
FROM village_unit_info
where village_code = #{villageCode}
and building_code = #{buildingCode}
ORDER BY id DESC
LIMIT 1;
</select>
</mapper>

@ -679,4 +679,5 @@
where idcard = #{idcard} limit 1
</select>
</mapper>

@ -1,50 +0,0 @@
package com.wt.dataToDBs;
import com.wt.dataToDBs.v2.pojo.EtcRecordV2;
import com.wt.dataToDBs.v2.service.EtcRecordV2Service;
import org.junit.jupiter.api.Test;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SpringBootTest
@MapperScan("com.wt.dataToDBs.*.mapper")
class DatatoDBsApplicationTests {
private static final Logger logger = LoggerFactory.getLogger(DatatoDBsApplicationTests.class);
@Autowired
EtcRecordV2Service etcRecordV2Service;
@Test
void contextLoads() {
// EtcRecordV2 etcRecordV2 = new EtcRecordV2();
// etcRecordV2.setVillagecode("11234443");
// etcRecordV2.setPartition_field("2022-09-17 12:12:12");
// etcRecordV2Service.save(etcRecordV2);
Map<String, Object> map = new HashMap<>();
map.put("startTime", "2022-09-16 12:12:12");
map.put("endTime", "2022-09-18 12:12:12");
List<EtcRecordV2> list = etcRecordV2Service.findEtcRecords(map);
// List<EtcRecordV2> listTmp = new ArrayList<>();
// listTmp.addAll(list);
// Map<Long, EtcRecordV2> etcMap = listTmp.stream().collect(Collectors.toMap(EtcRecordV2::getId, a -> a,(k1, k2)->k1));
// for (EtcRecordV2 etcRecordV2 : list) {
// EtcRecordV2SourceA etcRecordV2SourceA = new EtcRecordV2SourceA();
// etcRecordV2SourceA.setId(etcRecordV2.getId());
// etcRecordV2SourceA.setVillageCode(etcRecordV2.getVillageCode());
// etcRecordV2SourceA.setPartitionField(etcRecordV2.getPartitionField());
// etcRecordV2SourceA.setPassTime(etcRecordV2.getPassTime());
// etcRecordV2SourceAService.save(etcRecordV2SourceA);
// etcRecordV2.setPassTime("1");
// etcRecordV2Service.updateById(etcRecordV2);
// }
logger.info("1121234");
}
}
Loading…
Cancel
Save