Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
cyFeng | caefde8b47 | 12 months ago |
cyFeng | ae65d648fe | 12 months ago |
cyFeng | 021b6c4230 | 1 year ago |
@ -1,2 +1,8 @@
|
||||
##该工程用
|
||||
多数据源的情况 数据清洗
|
||||
多数据源的情况 数据清洗
|
||||
|
||||
|
||||
etc2.0清洗到3.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;
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
|
||||
|
||||
}
|
@ -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);
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
|
||||
|
||||
}
|
@ -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);
|
||||
// }
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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>
|
@ -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>
|
@ -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…
Reference in new issue