parent
0c59c2e1ed
commit
509e3728d6
@ -1,20 +1,22 @@
|
|||||||
package com.ssf.mysqloracletest.mapper;
|
package com.ssf.mysqloracletest.mapper;
|
||||||
|
|
||||||
import com.ssf.mysqloracletest.domain.MetaHuntersInfo;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ssf.mysqloracletest.domain.MetaHuntersInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 10503
|
* 非法狩猎人员信息表(MetaHuntersInfo)Mapper
|
||||||
* @description 针对表【meta_hunters_info(非法狩猎人员信息表)】的数据库操作Mapper
|
*
|
||||||
* @createDate 2023-12-08 23:11:18
|
* @author makejava
|
||||||
* @Entity com.ssf.mysqloracletest.domain.MetaHuntersInfo
|
* @since 2023-12-09 17:22:06
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface MetaHuntersInfoMapper extends BaseMapper<MetaHuntersInfo> {
|
public interface MetaHuntersInfoMapper extends BaseMapper<MetaHuntersInfo> {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Select(" select * from meta_hunters_info where user_pic is null ")
|
||||||
|
public List<MetaHuntersInfo> getHuntersList() ;
|
||||||
|
}
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ssf.mysqloracletest.mapper;
|
||||||
|
|
||||||
|
import com.ssf.mysqloracletest.domain.VillageJwzUserInfo;
|
||||||
|
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 VillageJwzUserInfoMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public VillageJwzUserInfo selectVillageJwzUserInfoById(Long id);
|
||||||
|
|
||||||
|
public VillageJwzUserInfo selectVillageJwzUserInfoByIdcard(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<VillageJwzUserInfo> selectVillageJwzUserInfoList(VillageJwzUserInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int insertVillageJwzUserInfo(VillageJwzUserInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int updateVillageJwzUserInfo(VillageJwzUserInfo bean);
|
||||||
|
|
||||||
|
public int updateVillageJwzUserInfoByIdcard(VillageJwzUserInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int deleteVillageJwzUserInfoById(Long id);
|
||||||
|
|
||||||
|
public int deleteVillageJwzUserInfoByUpdatetime(VillageJwzUserInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除形体抓拍记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteVillageJwzUserInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
public List<VillageJwzUserInfo> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,13 +1,19 @@
|
|||||||
package com.ssf.mysqloracletest.service;
|
package com.ssf.mysqloracletest.service;
|
||||||
|
|
||||||
import com.ssf.mysqloracletest.domain.MetaHuntersInfo;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ssf.mysqloracletest.domain.MetaHuntersInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 10503
|
* 非法狩猎人员信息表(MetaHuntersInfo)Service
|
||||||
* @description 针对表【meta_hunters_info(非法狩猎人员信息表)】的数据库操作Service
|
*
|
||||||
* @createDate 2023-12-08 23:11:18
|
* @author makejava
|
||||||
*/
|
* @since 2023-12-09 17:22:06
|
||||||
|
*/
|
||||||
public interface MetaHuntersInfoService extends IService<MetaHuntersInfo> {
|
public interface MetaHuntersInfoService extends IService<MetaHuntersInfo> {
|
||||||
|
|
||||||
|
public List<MetaHuntersInfo> getHuntersList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.ssf.mysqloracletest.service;
|
||||||
|
|
||||||
|
import com.ssf.mysqloracletest.domain.VillageJwzUserInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章内容
|
||||||
|
*
|
||||||
|
* @author chglee
|
||||||
|
* @email 1992lcg@163.com
|
||||||
|
* @date 2017-09-09 10:03:34
|
||||||
|
*/
|
||||||
|
public interface VillageJwzUserInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public VillageJwzUserInfo selectVillageJwzUserInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<VillageJwzUserInfo> selectVillageJwzUserInfoList(VillageJwzUserInfo VillageJwzUserInfo);
|
||||||
|
|
||||||
|
public VillageJwzUserInfo selectVillageJwzUserInfoByIdcard(String idcard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int insertVillageJwzUserInfo(VillageJwzUserInfo VillageJwzUserInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int updateVillageJwzUserInfo(VillageJwzUserInfo VillageJwzUserInfo);
|
||||||
|
|
||||||
|
public int updateVillageJwzUserInfoByIdcard(VillageJwzUserInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int deleteVillageJwzUserInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int deleteVillageJwzUserInfoById(Long id);
|
||||||
|
|
||||||
|
public int deleteVillageJwzUserInfoByUpdatetime(VillageJwzUserInfo bean);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,24 +1,31 @@
|
|||||||
package com.ssf.mysqloracletest.service.impl;
|
package com.ssf.mysqloracletest.service.impl;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ssf.mysqloracletest.domain.MetaHuntersInfo;
|
import com.ssf.mysqloracletest.domain.MetaHuntersInfo;
|
||||||
import com.ssf.mysqloracletest.service.MetaHuntersInfoService;
|
|
||||||
import com.ssf.mysqloracletest.mapper.MetaHuntersInfoMapper;
|
import com.ssf.mysqloracletest.mapper.MetaHuntersInfoMapper;
|
||||||
|
import com.ssf.mysqloracletest.service.MetaHuntersInfoService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 10503
|
* 非法狩猎人员信息表(MetaHuntersInfo)ServiceImpl
|
||||||
* @description 针对表【meta_hunters_info(非法狩猎人员信息表)】的数据库操作Service实现
|
*
|
||||||
* @createDate 2023-12-08 23:11:18
|
* @author makejava
|
||||||
*/
|
* @since 2023-12-09 17:22:06
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
@DS("mysql")
|
@DS("mysql")
|
||||||
public class MetaHuntersInfoServiceImpl extends ServiceImpl<MetaHuntersInfoMapper, MetaHuntersInfo>
|
public class MetaHuntersInfoServiceImpl extends ServiceImpl<MetaHuntersInfoMapper, MetaHuntersInfo> implements MetaHuntersInfoService {
|
||||||
implements MetaHuntersInfoService{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final MetaHuntersInfoMapper huntersInfoMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MetaHuntersInfo> getHuntersList() {
|
||||||
|
return huntersInfoMapper.getHuntersList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -0,0 +1,122 @@
|
|||||||
|
package com.ssf.mysqloracletest.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.ssf.mysqloracletest.domain.VillageJwzUserInfo;
|
||||||
|
import com.ssf.mysqloracletest.mapper.VillageJwzUserInfoMapper;
|
||||||
|
import com.ssf.mysqloracletest.service.VillageJwzUserInfoService;
|
||||||
|
import com.ssf.mysqloracletest.utils.StringKit;
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@DS("mysql")
|
||||||
|
public class VillageJwzUserInfoServiceImpl implements VillageJwzUserInfoService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(VillageJwzUserInfoServiceImpl.class);
|
||||||
|
|
||||||
|
|
||||||
|
private final VillageJwzUserInfoMapper jwzUserInfoDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public VillageJwzUserInfo selectVillageJwzUserInfoById(Long id) {
|
||||||
|
VillageJwzUserInfo v = jwzUserInfoDao.selectVillageJwzUserInfoById(id);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public VillageJwzUserInfo selectVillageJwzUserInfoByIdcard(String idcard) {
|
||||||
|
VillageJwzUserInfo v = jwzUserInfoDao.selectVillageJwzUserInfoByIdcard(idcard);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<VillageJwzUserInfo> selectVillageJwzUserInfoList(VillageJwzUserInfo VillageJwzUserInfo) {
|
||||||
|
List<VillageJwzUserInfo> list = jwzUserInfoDao.selectVillageJwzUserInfoList(VillageJwzUserInfo);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertVillageJwzUserInfo(VillageJwzUserInfo VillageJwzUserInfo) {
|
||||||
|
return jwzUserInfoDao.insertVillageJwzUserInfo(VillageJwzUserInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int saveOrUpdate(VillageJwzUserInfo villageJwzUserInfo) {
|
||||||
|
try {
|
||||||
|
String idcard = StringKit.toString(villageJwzUserInfo.getIdCard());
|
||||||
|
VillageJwzUserInfo bean = selectVillageJwzUserInfoByIdcard(idcard);
|
||||||
|
int res = 0;
|
||||||
|
if (bean == null) {
|
||||||
|
res = jwzUserInfoDao.insertVillageJwzUserInfo(villageJwzUserInfo);
|
||||||
|
} else {
|
||||||
|
VillageJwzUserInfo beanUp = new VillageJwzUserInfo();
|
||||||
|
BeanUtils.copyProperties(villageJwzUserInfo, beanUp);
|
||||||
|
updateVillageJwzUserInfoByIdcard(beanUp);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info(StringKit.getTrace(e));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateVillageJwzUserInfo(VillageJwzUserInfo VillageJwzUserInfo) {
|
||||||
|
return jwzUserInfoDao.updateVillageJwzUserInfo(VillageJwzUserInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized int updateVillageJwzUserInfoByIdcard(VillageJwzUserInfo 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(VillageJwzUserInfo bean) {
|
||||||
|
return jwzUserInfoDao.deleteVillageJwzUserInfoByUpdatetime(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
package com.ssf.mysqloracletest.task;
|
||||||
|
|
||||||
|
import com.ssf.mysqloracletest.domain.MetaActualUserInfo;
|
||||||
|
import com.ssf.mysqloracletest.domain.VillageActualUserInfo;
|
||||||
|
import com.ssf.mysqloracletest.domain.VillageJwzUserInfo;
|
||||||
|
import com.ssf.mysqloracletest.service.MetaActualUserInfoService;
|
||||||
|
import com.ssf.mysqloracletest.service.VillageActualUserInfoService;
|
||||||
|
import com.ssf.mysqloracletest.service.VillageJwzUserInfoService;
|
||||||
|
import com.ssf.mysqloracletest.utils.ConfigParam;
|
||||||
|
import com.ssf.mysqloracletest.utils.IdcardUtil;
|
||||||
|
import com.ssf.mysqloracletest.utils.NumKit;
|
||||||
|
import com.ssf.mysqloracletest.utils.StringKit;
|
||||||
|
import com.ssf.mysqloracletest.utils.util.DictUtil;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据实有人口中带房屋号的数据从 户籍信息中清洗数据到 实有人口表
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class JwzUserInfoToActualTask {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(JwzUserInfoToActualTask.class);
|
||||||
|
|
||||||
|
private final MetaActualUserInfoService actualUserInfoService;
|
||||||
|
private final VillageJwzUserInfoService jwzUserInfoService;
|
||||||
|
private final VillageActualUserInfoService villageActualUserInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理实有人口中的记录
|
||||||
|
*/
|
||||||
|
@Scheduled(initialDelay = 100, fixedDelay = 3000)
|
||||||
|
public void actualInfoRebaseHomeId() {
|
||||||
|
|
||||||
|
if (!"true".equals(StringKit.toString(ConfigParam.jwzUserInfoToActual))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MetaActualUserInfo> userInfos = actualUserInfoService.selectListByHomeIdSuccess(new MetaActualUserInfo());
|
||||||
|
|
||||||
|
for (MetaActualUserInfo bean : userInfos) {
|
||||||
|
|
||||||
|
String idcard = StringKit.toString(bean.getIdCard());
|
||||||
|
//首先根据身份证在 户籍信息查到这个人
|
||||||
|
VillageJwzUserInfo jwzUserInfo = jwzUserInfoService.selectVillageJwzUserInfoByIdcard(idcard);
|
||||||
|
|
||||||
|
if (jwzUserInfo == null) {
|
||||||
|
bean.setHouseholderRelation(0);
|
||||||
|
actualUserInfoService.saveOrUpdate(bean);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//查到这个人之后 在根据这个人的户号查询跟他同一户的人然后循环
|
||||||
|
VillageJwzUserInfo userInfoPara = new VillageJwzUserInfo();
|
||||||
|
|
||||||
|
userInfoPara.setAccountNumber(jwzUserInfo.getAccountNumber());
|
||||||
|
List<VillageJwzUserInfo> jwzUserInfoDos = jwzUserInfoService.selectVillageJwzUserInfoList(userInfoPara);
|
||||||
|
//遍历查询到的户籍信息数据
|
||||||
|
for (VillageJwzUserInfo userInfoDo : jwzUserInfoDos) {
|
||||||
|
String jwzRelation = userInfoDo.getHouseholderRelation();
|
||||||
|
int convortRelation = DictUtil.convertRelationJwzUserInfo(jwzRelation);
|
||||||
|
MetaActualUserInfo saveBean = new MetaActualUserInfo();
|
||||||
|
|
||||||
|
// String filePath = VillageActualUserInfoServiceImpl.getFolderPath(ConfigParam.wsDownloadPicPath) + idcard + StringKit.toString(UUID.randomUUID()).replaceAll("-", "") + ".jpg";
|
||||||
|
// try {
|
||||||
|
// boolean b = WsOkHttpUtils.wsImageDownload(idcard, filePath);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// filePath = "";
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
VillageActualUserInfo actUserInfoPara = new VillageActualUserInfo();
|
||||||
|
actUserInfoPara.setIdcard(StringKit.toString(idcard));
|
||||||
|
List<VillageActualUserInfo> actualUserInfos = villageActualUserInfoService.selectVillageActualUserInfoListLimit1(actUserInfoPara);
|
||||||
|
String userPic = "";
|
||||||
|
if (actualUserInfos != null && actualUserInfos.size() > 0) {
|
||||||
|
userPic = StringKit.toString(actualUserInfos.get(0).getUserPic());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
saveBean.setUserPic(userPic);
|
||||||
|
saveBean.setHouseholderRelation(convortRelation);
|
||||||
|
//如果循环中的身份证 跟 开始查询的身份证一样 更新即可
|
||||||
|
if (idcard.equals(StringKit.toString(userInfoDo.getIdCard()))) {
|
||||||
|
saveBean.setId(bean.getId());
|
||||||
|
actualUserInfoService.saveOrUpdate(saveBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
saveBean.setUserName(StringKit.toString(userInfoDo.getUserName()));
|
||||||
|
saveBean.setIdCard(StringKit.toString(userInfoDo.getIdCard()));
|
||||||
|
saveBean.setSex(NumKit.checkInt(IdcardUtil.getGenderFromIDCard(userInfoDo.getIdCard())));
|
||||||
|
saveBean.setPhone(StringKit.toString(userInfoDo.getPhone()));
|
||||||
|
saveBean.setLandline(StringKit.toString(userInfoDo.getLandline()));
|
||||||
|
//todo 类型全部改成人户不一致
|
||||||
|
saveBean.setActualUserType(124);
|
||||||
|
// saveBean.setHouseHoldRegister();
|
||||||
|
saveBean.setHouseHoldAddress(StringKit.toString(userInfoDo.getHouseHoldAddress()));
|
||||||
|
saveBean.setHabitationAddress(StringKit.toString(userInfoDo.getHouseHoldAddress()));
|
||||||
|
// saveBean.setPoliceStationCode();
|
||||||
|
// saveBean.setPoliceStationName();
|
||||||
|
saveBean.setPoliceDistrictCode(StringKit.toString(userInfoDo.getPoliceDistrictCode()));
|
||||||
|
// saveBean.setPoliceDistrictName();
|
||||||
|
saveBean.setManagementStatus("Y");
|
||||||
|
saveBean.setHomeId(StringKit.toString(bean.getHomeId()));
|
||||||
|
// saveBean.setHomeCode();
|
||||||
|
// saveBean.setAccountNumber();
|
||||||
|
saveBean.setMetaCreateTime(cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.date(), "yyyyMMddHHmmss"));
|
||||||
|
saveBean.setMetaUpdateTime(cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.date(), "yyyyMMddHHmmss"));
|
||||||
|
|
||||||
|
if ("".equals(userInfoDo.getIdCard())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//如果循环中的身份证 跟 开始查询的身份证一样 更新即可
|
||||||
|
if (idcard.equals(StringKit.toString(userInfoDo.getIdCard()))) {
|
||||||
|
saveBean.setId(bean.getId());
|
||||||
|
}
|
||||||
|
actualUserInfoService.saveOrUpdate(saveBean);
|
||||||
|
|
||||||
|
logger.info("更新或新增成功:" + saveBean.getIdCard());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package com.ssf.mysqloracletest.utils;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class IdcardUtil {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(IdcardUtil.class);
|
||||||
|
|
||||||
|
// 从身份证号码中获取性别
|
||||||
|
public static String getGenderFromIDCard(String idCard) {
|
||||||
|
String gender = "";
|
||||||
|
try {
|
||||||
|
if (idCard.length() == 18) {
|
||||||
|
int genderCode = Integer.parseInt(idCard.substring(16, 17));
|
||||||
|
//1男 2女
|
||||||
|
gender = genderCode % 2 == 0 ? "2" : "1";
|
||||||
|
// gender = genderCode % 2 == 0 ? "女" : "男";
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info(idCard + ":提取性别失败");
|
||||||
|
}
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从身份证号码中获取生日
|
||||||
|
public static String getBirthdayFromIDCard(String idCard) {
|
||||||
|
String birthday = "";
|
||||||
|
if (idCard.length() == 18) {
|
||||||
|
String year = idCard.substring(6, 10);
|
||||||
|
String month = idCard.substring(10, 12);
|
||||||
|
String day = idCard.substring(12, 14);
|
||||||
|
birthday = year + "-" + month + "-" + day;
|
||||||
|
}
|
||||||
|
return birthday;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将身份证中的生日转成date
|
||||||
|
*
|
||||||
|
* @param dateString
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Date convertStringToDate(String dateString) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
try {
|
||||||
|
return sdf.parse(dateString);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.ssf.mysqloracletest.utils;
|
||||||
|
|
||||||
|
import com.squareup.okhttp.OkHttpClient;
|
||||||
|
import com.squareup.okhttp.Request;
|
||||||
|
import com.squareup.okhttp.Response;
|
||||||
|
import com.squareup.okhttp.ResponseBody;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
public class WsOkHttpUtils {
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(WsOkHttpUtils.class);
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean wsImageDownload(String idcard, String toPath) {
|
||||||
|
String url = ConfigParam.wshttpurl + idcard;
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(url)
|
||||||
|
.get()
|
||||||
|
.addHeader("User-Agent", "PostmanRuntime/7.15.2")
|
||||||
|
.addHeader("Accept", "*/*")
|
||||||
|
.addHeader("Cache-Control", "no-cache")
|
||||||
|
.addHeader("Postman-Token", "7c9d31e5-31af-462b-a139-1d8e708f3754,66cb412d-20dd-42e2-930f-ea1f746d890d")
|
||||||
|
.addHeader("Accept-Encoding", "gzip, deflate")
|
||||||
|
.addHeader("Referer", url)
|
||||||
|
.addHeader("Connection", "keep-alive")
|
||||||
|
.addHeader("cache-control", "no-cache")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Response response = client.newCall(request).execute();
|
||||||
|
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
// 获取响应体
|
||||||
|
ResponseBody responseBody = response.body();
|
||||||
|
|
||||||
|
long length = responseBody.contentLength();
|
||||||
|
if (0 == length) {
|
||||||
|
logger.info("pic length is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取输入流
|
||||||
|
InputStream inputStream = responseBody.byteStream();
|
||||||
|
|
||||||
|
// 指定本地保存路径
|
||||||
|
// String localFilePath = "path/to/save/image.jpg";
|
||||||
|
|
||||||
|
// 使用输出流将输入流写入本地文件
|
||||||
|
try (OutputStream outputStream = new FileOutputStream(toPath)) {
|
||||||
|
byte[] buffer = new byte[8192];
|
||||||
|
int bytesRead;
|
||||||
|
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||||
|
outputStream.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("Image saved successfully!");
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
logger.info("Request failed with code: " + response.code());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,551 @@
|
|||||||
|
package com.ssf.mysqloracletest.utils.util;
|
||||||
|
|
||||||
|
import com.ssf.mysqloracletest.utils.StringKit;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class DictUtil {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(DictUtil.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 与户主关系字典转换
|
||||||
|
*
|
||||||
|
* @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 非亲属
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int convertRelationJwzUserInfo(String value) {
|
||||||
|
value = StringKit.toString(value);
|
||||||
|
int result = 99;
|
||||||
|
|
||||||
|
//1 本人
|
||||||
|
if ("01".equals(value)) {
|
||||||
|
result = 99;
|
||||||
|
}
|
||||||
|
//2 户主
|
||||||
|
else if ("02".equals(value)) {
|
||||||
|
result = 1;
|
||||||
|
}
|
||||||
|
//3 小集体户户主
|
||||||
|
else if ("03".equals(value)) {
|
||||||
|
result = 1;
|
||||||
|
}
|
||||||
|
//10 配偶
|
||||||
|
else if ("10".equals(value)) {
|
||||||
|
result = 2;
|
||||||
|
}
|
||||||
|
//11 夫
|
||||||
|
else if ("11".equals(value)) {
|
||||||
|
result = 2;
|
||||||
|
}
|
||||||
|
//12 妻
|
||||||
|
else if ("12".equals(value)) {
|
||||||
|
result = 2;
|
||||||
|
}
|
||||||
|
//20 子
|
||||||
|
else if ("20".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//21 独生子
|
||||||
|
else if ("21".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//22 长子
|
||||||
|
else if ("22".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//23 次子
|
||||||
|
else if ("23".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//24 三子
|
||||||
|
else if ("24".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//25 四子
|
||||||
|
else if ("25".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//26 五子
|
||||||
|
else if ("26".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//27 养子或继子
|
||||||
|
else if ("27".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//29 其它儿子
|
||||||
|
else if ("28".equals(value)) {
|
||||||
|
result = 3;
|
||||||
|
}
|
||||||
|
//30 女
|
||||||
|
else if ("30".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//31 独生女
|
||||||
|
else if ("31".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//32 长女
|
||||||
|
else if ("32".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//33 二女
|
||||||
|
else if ("33".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//34 三女
|
||||||
|
else if ("34".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//35 四女
|
||||||
|
else if ("35".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//36 五女
|
||||||
|
else if ("36".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//37 养女
|
||||||
|
else if ("37".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//39 其它女儿
|
||||||
|
else if ("39".equals(value)) {
|
||||||
|
result = 4;
|
||||||
|
}
|
||||||
|
//40 孙子,孙女或外孙子,外孙女
|
||||||
|
else if ("40".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//41 孙子
|
||||||
|
else if ("41".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//42 孙女
|
||||||
|
else if ("42".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//43 外孙子
|
||||||
|
else if ("43".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//44 外孙女
|
||||||
|
else if ("44".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//47 曾孙子或曾外孙子
|
||||||
|
else if ("47".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//48 曾孙女或曾外孙女
|
||||||
|
else if ("48".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//49 其他孙子,孙女或外孙子
|
||||||
|
else if ("49".equals(value)) {
|
||||||
|
result = 5;
|
||||||
|
}
|
||||||
|
//50 父母
|
||||||
|
else if ("50".equals(value)) {
|
||||||
|
result = 6;
|
||||||
|
}
|
||||||
|
//51 父亲
|
||||||
|
else if ("51".equals(value)) {
|
||||||
|
result = 6;
|
||||||
|
}
|
||||||
|
//52 母亲
|
||||||
|
else if ("52".equals(value)) {
|
||||||
|
result = 6;
|
||||||
|
}
|
||||||
|
//57 继父或养父
|
||||||
|
else if ("57".equals(value)) {
|
||||||
|
result = 6;
|
||||||
|
}
|
||||||
|
//58 继母或养母
|
||||||
|
else if ("58".equals(value)) {
|
||||||
|
result = 6;
|
||||||
|
}
|
||||||
|
//59 其它父母关系
|
||||||
|
else if ("59".equals(value)) {
|
||||||
|
result = 6;
|
||||||
|
}
|
||||||
|
//60 祖父母或外祖父母
|
||||||
|
else if ("60".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//61 祖父
|
||||||
|
else if ("61".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//62 祖母
|
||||||
|
else if ("62".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//63 外祖父
|
||||||
|
else if ("63".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//64 外祖母
|
||||||
|
else if ("64".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//65 配偶的祖父母或外祖父母
|
||||||
|
else if ("65".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//66 曾祖父
|
||||||
|
else if ("66".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//67 曾祖母
|
||||||
|
else if ("67".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//68 配偶的曾祖父母
|
||||||
|
else if ("68".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//69 其它祖父母或外祖父母关系
|
||||||
|
else if ("69".equals(value)) {
|
||||||
|
result = 7;
|
||||||
|
}
|
||||||
|
//70 兄弟姐妹
|
||||||
|
else if ("70".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
}
|
||||||
|
//71 兄
|
||||||
|
else if ("71".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
}
|
||||||
|
//73 弟
|
||||||
|
else if ("73".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
}
|
||||||
|
//75 姐姐
|
||||||
|
else if ("75".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
}
|
||||||
|
//76 姐夫
|
||||||
|
else if ("76".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
}
|
||||||
|
//77 妹妹
|
||||||
|
else if ("77".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
}
|
||||||
|
//78 妹夫
|
||||||
|
else if ("78".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
}
|
||||||
|
//79 其它兄弟姐妹
|
||||||
|
else if ("79".equals(value)) {
|
||||||
|
result = 8;
|
||||||
|
} else {
|
||||||
|
//下面的关系都是其他
|
||||||
|
result = 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,243 @@
|
|||||||
|
<?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.ssf.mysqloracletest.mapper.VillageJwzUserInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ssf.mysqloracletest.domain.VillageJwzUserInfo" id="VillageJwzUserInfoResult">
|
||||||
|
<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" />
|
||||||
|
<result property="householderRelation" column="householder_relation" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectVillageJwzUserInfoVo">
|
||||||
|
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.ssf.mysqloracletest.domain.VillageJwzUserInfo" resultMap="VillageJwzUserInfoResult">
|
||||||
|
<include refid="selectVillageJwzUserInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="userName != null and userName != ''"> and user_name = #{userName}</if>
|
||||||
|
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
|
||||||
|
<if test="accountNumber != null and accountNumber != ''"> and account_number = #{accountNumber}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectVillageJwzUserInfoById" parameterType="Long" resultMap="VillageJwzUserInfoResult">
|
||||||
|
<include refid="selectVillageJwzUserInfoVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectVillageJwzUserInfoByIdcard" parameterType="String" resultMap="VillageJwzUserInfoResult">
|
||||||
|
<include refid="selectVillageJwzUserInfoVo"/>
|
||||||
|
where id_card = #{idCard} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertVillageJwzUserInfo" parameterType="com.ssf.mysqloracletest.domain.VillageJwzUserInfo" 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.ssf.mysqloracletest.domain.VillageJwzUserInfo">
|
||||||
|
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.ssf.mysqloracletest.domain.VillageJwzUserInfo">
|
||||||
|
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.ssf.mysqloracletest.domain.VillageJwzUserInfo">
|
||||||
|
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="VillageJwzUserInfoResult">
|
||||||
|
select * from village_jwz_user_info
|
||||||
|
where
|
||||||
|
1=1
|
||||||
|
and id > ${first}
|
||||||
|
limit 200
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in new issue