个人消费贷款业务-录入客户信息&开设活期账户

main
@t2652009480 2 months ago
parent f1cb145706
commit 99347f821a

@ -0,0 +1,90 @@
package com.sztzjy.bank.controller.stu;
import com.sztzjy.bank.annotation.AnonymousAccess;
import com.sztzjy.bank.entity.CustomerInformation;
import com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount;
import com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo;
import com.sztzjy.bank.service.PersonalLoanService;
import com.sztzjy.bank.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* @author tz
* @date 2025/1/15 15:40
*/
@Api(tags = "个人消费贷款业务")
@RequestMapping("api/personalLoan")
@RestController
@Validated
public class PersonalLoanController {
@Autowired
PersonalLoanService loanService;
@AnonymousAccess
@ApiOperation("录入客户信息-提交/保存")
@PostMapping("submitCustomerInfo")
public ResultEntity submitCustomerInfo(@Valid @RequestBody PerConsumerLoanCustomerInfo loanCustomerInfo) {
Integer i = loanService.submitCustomerInfo(loanCustomerInfo);
String type;
if(loanCustomerInfo.getSubmitStatus()==1){
type="提交";
}else {
type="保存";
}
if(i>0){
return new ResultEntity<>(HttpStatus.OK,type+"成功");
}else {
return new ResultEntity<>(HttpStatus.OK,type+"失败");
}
}
@AnonymousAccess
@ApiOperation("录入客户信息-操作记录回显")
@GetMapping("getCustomerInfo")
public ResultEntity getCustomerInfo(@ApiParam("用户ID") String userId,
@ApiParam("案例序号") Integer number) {
return new ResultEntity(loanService.getCustomerInfo(userId,number));
}
@AnonymousAccess
@ApiOperation("开设活期账户-提交/保存")
@PostMapping("submitCurrentAccount")
public ResultEntity submitCurrentAccount(@Valid @RequestBody PerConsumerLoanCurrentAccount currentAccount) {
Integer i = loanService.submitCurrentAccount(currentAccount);
String type;
if(currentAccount.getSubmitStatus()==1){
type="提交";
}else {
type="保存";
}
if(i>0){
return new ResultEntity<>(HttpStatus.OK,type+"成功");
}else {
return new ResultEntity<>(HttpStatus.OK,type+"失败");
}
}
@AnonymousAccess
@ApiOperation("开设活期账户-操作记录回显")
@GetMapping("getCustomerInfo")
public ResultEntity getCurrentAccount(@ApiParam("用户ID") String userId,
@ApiParam("案例序号") Integer number) {
return new ResultEntity(loanService.getCurrentAccount(userId,number));
}
}

@ -0,0 +1,221 @@
package com.sztzjy.bank.entity;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
* -
*
* @author whb
* per_consumer_loan_current_account
*/
public class PerConsumerLoanCurrentAccount {
@ApiModelProperty(notes = "ID")
private String id;
@ApiModelProperty(notes = "客户姓名")
private String customerName;
@ApiModelProperty(notes = "客户号")
private Integer customerNo;
@ApiModelProperty(notes = "币种")
private String currency;
@ApiModelProperty(notes = "钞汇标志")
private String currencyExchangeSymbol;
@ApiModelProperty(notes = "分级类型")
private String classificationType;
@ApiModelProperty(notes = "账户性质")
private String natureOfAccount;
@ApiModelProperty(notes = "凭证类型")
private String voucherType;
@ApiModelProperty(notes = "支取方式")
private String withdrawalMethod;
@ApiModelProperty(notes = "支取密码")
private String withdrawalPassword;
@ApiModelProperty(notes = "确认密码")
private String confirmPassword;
@ApiModelProperty(notes = "银行卡号")
private Integer bankCardNumber;
@ApiModelProperty(notes = "创建时间")
private Date createTime;
@ApiModelProperty(notes = "更新时间")
private Date updateTime;
@ApiModelProperty(notes = "保存状态(0未保存、1已保存)")
private Integer saveStatus;
@ApiModelProperty(notes = "提交状态(0未提交、1已提交)")
private Integer submitStatus;
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "错误次数")
private Integer errorNumber;
@ApiModelProperty(notes = "第几套案例1、2、3")
private Integer number;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName == null ? null : customerName.trim();
}
public Integer getCustomerNo() {
return customerNo;
}
public void setCustomerNo(Integer customerNo) {
this.customerNo = customerNo;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency == null ? null : currency.trim();
}
public String getCurrencyExchangeSymbol() {
return currencyExchangeSymbol;
}
public void setCurrencyExchangeSymbol(String currencyExchangeSymbol) {
this.currencyExchangeSymbol = currencyExchangeSymbol == null ? null : currencyExchangeSymbol.trim();
}
public String getClassificationType() {
return classificationType;
}
public void setClassificationType(String classificationType) {
this.classificationType = classificationType == null ? null : classificationType.trim();
}
public String getNatureOfAccount() {
return natureOfAccount;
}
public void setNatureOfAccount(String natureOfAccount) {
this.natureOfAccount = natureOfAccount == null ? null : natureOfAccount.trim();
}
public String getVoucherType() {
return voucherType;
}
public void setVoucherType(String voucherType) {
this.voucherType = voucherType == null ? null : voucherType.trim();
}
public String getWithdrawalMethod() {
return withdrawalMethod;
}
public void setWithdrawalMethod(String withdrawalMethod) {
this.withdrawalMethod = withdrawalMethod == null ? null : withdrawalMethod.trim();
}
public String getWithdrawalPassword() {
return withdrawalPassword;
}
public void setWithdrawalPassword(String withdrawalPassword) {
this.withdrawalPassword = withdrawalPassword == null ? null : withdrawalPassword.trim();
}
public String getConfirmPassword() {
return confirmPassword;
}
public void setConfirmPassword(String confirmPassword) {
this.confirmPassword = confirmPassword == null ? null : confirmPassword.trim();
}
public Integer getBankCardNumber() {
return bankCardNumber;
}
public void setBankCardNumber(Integer bankCardNumber) {
this.bankCardNumber = bankCardNumber;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getSaveStatus() {
return saveStatus;
}
public void setSaveStatus(Integer saveStatus) {
this.saveStatus = saveStatus;
}
public Integer getSubmitStatus() {
return submitStatus;
}
public void setSubmitStatus(Integer submitStatus) {
this.submitStatus = submitStatus;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public Integer getErrorNumber() {
return errorNumber;
}
public void setErrorNumber(Integer errorNumber) {
this.errorNumber = errorNumber;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
}

@ -0,0 +1,305 @@
package com.sztzjy.bank.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
/**
* -
*
* @author whb
* per_consumer_loan_customer_info
*/
public class PerConsumerLoanCustomerInfo {
@ApiModelProperty(notes = "ID")
private String id;
@ApiModelProperty(notes = "客户姓名")
private String customerName;
@ApiModelProperty(notes = "客户号")
private Integer customerNo;
@ApiModelProperty(notes = "民族")
private String nationality;
@ApiModelProperty(notes = "证件类型")
private String idType;
@ApiModelProperty(notes = "证件号码")
private String idNumber;
@ApiModelProperty(notes = "婚姻状况")
private String maritalStatus;
@ApiModelProperty(notes = "职业")
private String career;
@ApiModelProperty(notes = "联系电话")
private String contactNumber;
@ApiModelProperty(notes = "职位")
private String position;
@ApiModelProperty(notes = "在职年限")
private String yearsOfEmployment;
@ApiModelProperty(notes = "月薪")
private String monthlyPay;
@ApiModelProperty(notes = "年收入")
private String annualIncome;
@ApiModelProperty(notes = "就职公司")
private String employmentCompany;
@ApiModelProperty(notes = "通讯地址")
private String mailAddress;
@ApiModelProperty(notes = "户籍地址")
private String residenceAddress;
@ApiModelProperty(notes = "第一联系人")
private String firstContactPerson;
@ApiModelProperty(notes = "关系")
private String relationship;
@ApiModelProperty(notes = "联系人电话")
private String contactPhone;
@ApiModelProperty(notes = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createTime;
@ApiModelProperty(notes = "更新时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateTime;
@ApiModelProperty(notes = "保存状态(0未保存、1已保存)")
private Integer saveStatus;
@ApiModelProperty(notes = "提交状态(0未提交、1已提交)")
private Integer submitStatus;
@ApiModelProperty(notes = "用户ID")
private String userId;
@ApiModelProperty(notes = "错误次数")
private Integer errorNumber;
@ApiModelProperty(notes = "第几套案例1、2、3")
private Integer number;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName == null ? null : customerName.trim();
}
public Integer getCustomerNo() {
return customerNo;
}
public void setCustomerNo(Integer customerNo) {
this.customerNo = customerNo;
}
public String getNationality() {
return nationality;
}
public void setNationality(String nationality) {
this.nationality = nationality == null ? null : nationality.trim();
}
public String getIdType() {
return idType;
}
public void setIdType(String idType) {
this.idType = idType == null ? null : idType.trim();
}
public String getIdNumber() {
return idNumber;
}
public void setIdNumber(String idNumber) {
this.idNumber = idNumber == null ? null : idNumber.trim();
}
public String getMaritalStatus() {
return maritalStatus;
}
public void setMaritalStatus(String maritalStatus) {
this.maritalStatus = maritalStatus == null ? null : maritalStatus.trim();
}
public String getCareer() {
return career;
}
public void setCareer(String career) {
this.career = career == null ? null : career.trim();
}
public String getContactNumber() {
return contactNumber;
}
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber == null ? null : contactNumber.trim();
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position == null ? null : position.trim();
}
public String getYearsOfEmployment() {
return yearsOfEmployment;
}
public void setYearsOfEmployment(String yearsOfEmployment) {
this.yearsOfEmployment = yearsOfEmployment == null ? null : yearsOfEmployment.trim();
}
public String getMonthlyPay() {
return monthlyPay;
}
public void setMonthlyPay(String monthlyPay) {
this.monthlyPay = monthlyPay == null ? null : monthlyPay.trim();
}
public String getAnnualIncome() {
return annualIncome;
}
public void setAnnualIncome(String annualIncome) {
this.annualIncome = annualIncome == null ? null : annualIncome.trim();
}
public String getEmploymentCompany() {
return employmentCompany;
}
public void setEmploymentCompany(String employmentCompany) {
this.employmentCompany = employmentCompany == null ? null : employmentCompany.trim();
}
public String getMailAddress() {
return mailAddress;
}
public void setMailAddress(String mailAddress) {
this.mailAddress = mailAddress == null ? null : mailAddress.trim();
}
public String getResidenceAddress() {
return residenceAddress;
}
public void setResidenceAddress(String residenceAddress) {
this.residenceAddress = residenceAddress == null ? null : residenceAddress.trim();
}
public String getFirstContactPerson() {
return firstContactPerson;
}
public void setFirstContactPerson(String firstContactPerson) {
this.firstContactPerson = firstContactPerson == null ? null : firstContactPerson.trim();
}
public String getRelationship() {
return relationship;
}
public void setRelationship(String relationship) {
this.relationship = relationship == null ? null : relationship.trim();
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone == null ? null : contactPhone.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getSaveStatus() {
return saveStatus;
}
public void setSaveStatus(Integer saveStatus) {
this.saveStatus = saveStatus;
}
public Integer getSubmitStatus() {
return submitStatus;
}
public void setSubmitStatus(Integer submitStatus) {
this.submitStatus = submitStatus;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public Integer getErrorNumber() {
return errorNumber;
}
public void setErrorNumber(Integer errorNumber) {
this.errorNumber = errorNumber;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
}

@ -0,0 +1,31 @@
package com.sztzjy.bank.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author tz
* @date 2025/1/16 10:16
*/
@Data
public class PerConsumerLoanCurrentAccountAnswerDTO {
@ApiModelProperty(notes = "币种")
private String currency;
@ApiModelProperty(notes = "钞汇标志")
private String currencyExchangeSymbol;
@ApiModelProperty(notes = "分级类型")
private String classificationType;
@ApiModelProperty(notes = "账户性质")
private String natureOfAccount;
@ApiModelProperty(notes = "凭证类型")
private String voucherType;
@ApiModelProperty(notes = "支取密码")
private String withdrawalPassword;
@ApiModelProperty(notes = "确认密码")
private String confirmPassword;
}

@ -0,0 +1,38 @@
package com.sztzjy.bank.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author tz
* @date 2025/1/15 18:22
*/
@Data
public class PerConsumerLoanCustomerInfoAnswerDTO {
@ApiModelProperty(notes = "客户姓名")
private String customerName;
@ApiModelProperty(notes = "民族")
private String nationality;
@ApiModelProperty(notes = "证件类型")
private String idType;
@ApiModelProperty(notes = "证件号码")
private String idNumber;
@ApiModelProperty(notes = "联系电话")
private String contactNumber;
@ApiModelProperty(notes = "就职公司")
private String employmentCompany;
@ApiModelProperty(notes = "通讯地址")
private String mailAddress;
@ApiModelProperty(notes = "第一联系人")
private String firstContactPerson;
@ApiModelProperty(notes = "联系人电话")
private String contactPhone;
}

@ -0,0 +1,30 @@
package com.sztzjy.bank.mapper;
import com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount;
import com.sztzjy.bank.entity.PerConsumerLoanCurrentAccountExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PerConsumerLoanCurrentAccountMapper {
long countByExample(PerConsumerLoanCurrentAccountExample example);
int deleteByExample(PerConsumerLoanCurrentAccountExample example);
int deleteByPrimaryKey(String id);
int insert(PerConsumerLoanCurrentAccount record);
int insertSelective(PerConsumerLoanCurrentAccount record);
List<PerConsumerLoanCurrentAccount> selectByExample(PerConsumerLoanCurrentAccountExample example);
PerConsumerLoanCurrentAccount selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") PerConsumerLoanCurrentAccount record, @Param("example") PerConsumerLoanCurrentAccountExample example);
int updateByExample(@Param("record") PerConsumerLoanCurrentAccount record, @Param("example") PerConsumerLoanCurrentAccountExample example);
int updateByPrimaryKeySelective(PerConsumerLoanCurrentAccount record);
int updateByPrimaryKey(PerConsumerLoanCurrentAccount record);
}

@ -0,0 +1,30 @@
package com.sztzjy.bank.mapper;
import com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo;
import com.sztzjy.bank.entity.PerConsumerLoanCustomerInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PerConsumerLoanCustomerInfoMapper {
long countByExample(PerConsumerLoanCustomerInfoExample example);
int deleteByExample(PerConsumerLoanCustomerInfoExample example);
int deleteByPrimaryKey(String id);
int insert(PerConsumerLoanCustomerInfo record);
int insertSelective(PerConsumerLoanCustomerInfo record);
List<PerConsumerLoanCustomerInfo> selectByExample(PerConsumerLoanCustomerInfoExample example);
PerConsumerLoanCustomerInfo selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") PerConsumerLoanCustomerInfo record, @Param("example") PerConsumerLoanCustomerInfoExample example);
int updateByExample(@Param("record") PerConsumerLoanCustomerInfo record, @Param("example") PerConsumerLoanCustomerInfoExample example);
int updateByPrimaryKeySelective(PerConsumerLoanCustomerInfo record);
int updateByPrimaryKey(PerConsumerLoanCustomerInfo record);
}

@ -0,0 +1,22 @@
package com.sztzjy.bank.service;
import cn.hutool.core.util.IdUtil;
import com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount;
import com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo;
import com.sztzjy.bank.util.ResultEntity;
import org.springframework.http.HttpStatus;
/**
* @author tz
* @date 2025/1/15 17:12
*/
public interface PersonalLoanService {
Integer submitCustomerInfo(PerConsumerLoanCustomerInfo loanCustomerInfo);
PerConsumerLoanCustomerInfo getCustomerInfo(String userId, Integer number);
Integer submitCurrentAccount(PerConsumerLoanCurrentAccount currentAccount);
PerConsumerLoanCurrentAccount getCurrentAccount(String userId, Integer number);
}

@ -0,0 +1,297 @@
package com.sztzjy.bank.service.impl;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
import com.sztzjy.bank.entity.*;
import com.sztzjy.bank.entity.dto.CustomerInformationAnswerDTO;
import com.sztzjy.bank.entity.dto.PerConsumerLoanCurrentAccountAnswerDTO;
import com.sztzjy.bank.entity.dto.PerConsumerLoanCustomerInfoAnswerDTO;
import com.sztzjy.bank.mapper.CaseAnswerInfoMapper;
import com.sztzjy.bank.mapper.CaseInfoMapper;
import com.sztzjy.bank.mapper.PerConsumerLoanCurrentAccountMapper;
import com.sztzjy.bank.mapper.PerConsumerLoanCustomerInfoMapper;
import com.sztzjy.bank.service.PersonalLoanService;
import com.sztzjy.bank.util.ConvertUtil;
import com.sztzjy.bank.util.RedisUtil;
import com.sztzjy.bank.util.ResultEntity;
import com.sztzjy.bank.util.compute.ObjectComparatorUtil;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
import java.util.Random;
/**
* @author tz
* @date 2025/1/15 17:12
*/
@Service
public class PersonalLoanServiceImpl implements PersonalLoanService {
@Autowired
PerConsumerLoanCustomerInfoMapper loanCustomerInfoMapper;
@Autowired
PerConsumerLoanCurrentAccountMapper currentAccountMapper;
@Autowired
RedisUtil redisUtil;
@Autowired
CaseInfoMapper caseInfoMapper;
@Autowired
CaseAnswerInfoMapper caseAnswerInfoMapper;
@Autowired
ConvertUtil convertUtil;
@Override
public Integer submitCustomerInfo(PerConsumerLoanCustomerInfo loanCustomerInfo) {
PerConsumerLoanCustomerInfoExample loanCustomerInfoExample=new PerConsumerLoanCustomerInfoExample();
loanCustomerInfoExample.createCriteria().andUserIdEqualTo(loanCustomerInfo.getUserId())
.andNumberEqualTo(loanCustomerInfo.getNumber());
List<PerConsumerLoanCustomerInfo> loanCustomerInfos = loanCustomerInfoMapper.selectByExample(loanCustomerInfoExample);
if(CollectionUtils.isEmpty(loanCustomerInfos)){ //添加数据
loanCustomerInfo.setId(IdUtil.simpleUUID());
loanCustomerInfo.setCreateTime(new Date());
//检验是提交还是保存
if(loanCustomerInfo.getSubmitStatus()==1){ //提交则计算错误次数
//计算错误次数
loanCustomerInfo = submitByCustomerInfoCaculate(loanCustomerInfo);
//生成唯一的九位数的客户号,去重
int random;
List<PerConsumerLoanCustomerInfo> loanCustomerInfoList;
do {
random = getRandom();
loanCustomerInfoExample.clear();//清空之前的条件,以便重新使用
loanCustomerInfoExample.createCriteria().andNumberEqualTo(loanCustomerInfo.getNumber())
.andCareerNotEqualTo(Integer.toString(random));
loanCustomerInfoList = loanCustomerInfoMapper.selectByExample(loanCustomerInfoExample);
}while (loanCustomerInfoList!=null && loanCustomerInfoList.isEmpty()); // 如果存在相同的客户号,则继续生成
loanCustomerInfo.setCustomerNo(random);
}
//否则保存不计算,直接添加
return loanCustomerInfoMapper.insert(loanCustomerInfo);
}else { //已有操作记录
PerConsumerLoanCustomerInfo perConsumerLoanCustomerInfo = loanCustomerInfos.get(0);
//取出id以防被覆盖
String id = perConsumerLoanCustomerInfo.getId();
//判断是否已经提交,已提交保存记录不计分,未提交保存记录并计分
if(perConsumerLoanCustomerInfo.getSubmitStatus()!=1){
//检验本次是提交还是保存
if(loanCustomerInfo.getSubmitStatus()==1){ //提交则计算错误次数
//计算错误次数
loanCustomerInfo = submitByCustomerInfoCaculate(loanCustomerInfo);
//生成唯一的九位数的客户号,去重
int random;
List<PerConsumerLoanCustomerInfo> loanCustomerInfoList;
do {
random = getRandom();
loanCustomerInfoExample.clear();//清空之前的条件,以便重新使用
loanCustomerInfoExample.createCriteria().andNumberEqualTo(loanCustomerInfo.getNumber())
.andCareerNotEqualTo(Integer.toString(random));
loanCustomerInfoList = loanCustomerInfoMapper.selectByExample(loanCustomerInfoExample);
}while (loanCustomerInfoList!=null && loanCustomerInfoList.isEmpty()); // 如果存在相同的客户号,则继续生成
loanCustomerInfo.setCustomerNo(random);
}
}
loanCustomerInfo.setId(id);
loanCustomerInfo.setUpdateTime(new Date());
return loanCustomerInfoMapper.updateByPrimaryKeySelective(loanCustomerInfo);
}
}
@Override
public PerConsumerLoanCustomerInfo getCustomerInfo(String userId, Integer number) {
PerConsumerLoanCustomerInfoExample loanCustomerInfoExample=new PerConsumerLoanCustomerInfoExample();
loanCustomerInfoExample.createCriteria().andUserIdEqualTo(userId).andNumberEqualTo(number);
return loanCustomerInfoMapper.selectByExample(loanCustomerInfoExample).get(0);
}
@Override
public Integer submitCurrentAccount(PerConsumerLoanCurrentAccount currentAccount) {
PerConsumerLoanCurrentAccountExample currentAccountExample=new PerConsumerLoanCurrentAccountExample();
currentAccountExample.createCriteria().andUserIdEqualTo(currentAccount.getUserId())
.andNumberEqualTo(currentAccount.getNumber());
//查询生成的客户号
PerConsumerLoanCustomerInfoExample loanCustomerInfoExample=new PerConsumerLoanCustomerInfoExample();
loanCustomerInfoExample.createCriteria().andUserIdEqualTo(currentAccount.getUserId())
.andNumberEqualTo(currentAccount.getNumber());
List<PerConsumerLoanCustomerInfo> loanCustomerInfos = loanCustomerInfoMapper.selectByExample(loanCustomerInfoExample);
List<PerConsumerLoanCurrentAccount> currentAccounts = currentAccountMapper.selectByExample(currentAccountExample);
if(CollectionUtils.isEmpty(currentAccounts)){ //添加数据
currentAccount.setId(IdUtil.simpleUUID());
currentAccount.setCreateTime(new Date());
//检验是提交还是保存
if(currentAccount.getSubmitStatus()==1){ //提交则计算错误次数
//计算错误次数
currentAccount = submitByCurrentAccountCaculate(currentAccount);
//生成银行账号
Random random = new Random();
// 生成六位随机数字,再拼接客户号
int i = 100000 + random.nextInt(900000);
int bankCardNumber= Integer.parseInt(loanCustomerInfos.get(0).getCustomerNo()+String.valueOf(i));
currentAccount.setCustomerNo(bankCardNumber);
}
//否则保存不计算,直接添加
return currentAccountMapper.insert(currentAccount);
}else { //已有操作记录
PerConsumerLoanCurrentAccount consumerLoanCurrentAccount = currentAccounts.get(0);
//取出id以防被覆盖
String id = consumerLoanCurrentAccount.getId();
//判断是否已经提交,已提交保存记录不计分,未提交保存记录并计分
if(consumerLoanCurrentAccount.getSubmitStatus()!=1){
//检验本次是提交还是保存
if(currentAccount.getSubmitStatus()==1){ //提交则计算错误次数
//计算错误次数
currentAccount = submitByCurrentAccountCaculate(currentAccount);
//生成银行账号
Random random = new Random();
// 生成六位随机数字,再拼接客户号
int i = 100000 + random.nextInt(900000);
int bankCardNumber= Integer.parseInt(loanCustomerInfos.get(0).getCustomerNo()+String.valueOf(i));
currentAccount.setCustomerNo(bankCardNumber);
}
}
currentAccount.setId(id);
currentAccount.setUpdateTime(new Date());
return currentAccountMapper.updateByPrimaryKeySelective(currentAccount);
}
}
@Override
public PerConsumerLoanCurrentAccount getCurrentAccount(String userId, Integer number) {
PerConsumerLoanCurrentAccountExample loanCurrentAccountExample=new PerConsumerLoanCurrentAccountExample();
loanCurrentAccountExample.createCriteria().andUserIdEqualTo(userId).andNumberEqualTo(number);
return currentAccountMapper.selectByExample(loanCurrentAccountExample).get(0);
}
//录入客户信息计算
private PerConsumerLoanCustomerInfo submitByCustomerInfoCaculate(PerConsumerLoanCustomerInfo loanCustomerInfo) {
String answer = redisUtil.get("bank" + "-个人贷款业务" + "-录入客户信息");
if (answer == null) {
CaseInfoExample caseInfoExample = new CaseInfoExample();
caseInfoExample.createCriteria().andLargeModuleEqualTo("个人贷款业务").andModuleEqualTo("录入客户信息").andNumberEqualTo(loanCustomerInfo.getNumber());
List<CaseInfo> caseInfoList = caseInfoMapper.selectByExampleWithBLOBs(caseInfoExample);
if (!CollectionUtils.isEmpty(caseInfoList)) {
CaseInfo caseInfo = caseInfoList.get(0);
CaseAnswerInfoExample caseAnswerInfoExample = new CaseAnswerInfoExample();
caseAnswerInfoExample.createCriteria().andCaseIdEqualTo(caseInfo.getCaseId());
List<CaseAnswerInfo> answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample);
if (!CollectionUtils.isEmpty(answerInfoList)) {
String info = answerInfoList.get(0).getAnswer();
redisUtil.set("bank" + "-个人贷款业务" + "-录入客户信息",info,3600);
}
}
}
// 解析 JSON 字符串
PerConsumerLoanCustomerInfoAnswerDTO answerDTO = JSON.parseObject(answer, PerConsumerLoanCustomerInfoAnswerDTO.class);
PerConsumerLoanCustomerInfoAnswerDTO loanCustomerInfoAnswerDTO = convertUtil.entityToDTO(loanCustomerInfo, PerConsumerLoanCustomerInfoAnswerDTO.class);
try {
int update = ObjectComparatorUtil.countDifferences(answerDTO, loanCustomerInfoAnswerDTO);
//错误次数
loanCustomerInfo.setErrorNumber(update);
return loanCustomerInfo;
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
//开设活期账户计算
private PerConsumerLoanCurrentAccount submitByCurrentAccountCaculate(PerConsumerLoanCurrentAccount currentAccount) {
String answer = redisUtil.get("bank" + "-个人贷款业务" + "-开设活期账户");
if (answer == null) {
CaseInfoExample caseInfoExample = new CaseInfoExample();
caseInfoExample.createCriteria().andLargeModuleEqualTo("个人贷款业务").andModuleEqualTo("开设活期账户")
.andNumberEqualTo(currentAccount.getNumber());
List<CaseInfo> caseInfoList = caseInfoMapper.selectByExampleWithBLOBs(caseInfoExample);
if (!CollectionUtils.isEmpty(caseInfoList)) {
CaseInfo caseInfo = caseInfoList.get(0);
CaseAnswerInfoExample caseAnswerInfoExample = new CaseAnswerInfoExample();
caseAnswerInfoExample.createCriteria().andCaseIdEqualTo(caseInfo.getCaseId());
List<CaseAnswerInfo> answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample);
if (!CollectionUtils.isEmpty(answerInfoList)) {
String info = answerInfoList.get(0).getAnswer();
redisUtil.set("bank" + "-个人贷款业务" + "-开设活期账户",info,3600);
}
}
}
// 解析 JSON 字符串
PerConsumerLoanCurrentAccountAnswerDTO answerDTO = JSON.parseObject(answer, PerConsumerLoanCurrentAccountAnswerDTO.class);
PerConsumerLoanCurrentAccountAnswerDTO currentAccountAnswerDTO = convertUtil.entityToDTO(currentAccount, PerConsumerLoanCurrentAccountAnswerDTO.class);
try {
int update = ObjectComparatorUtil.countDifferences(answerDTO, currentAccountAnswerDTO);
//错误次数
currentAccount.setErrorNumber(update);
return currentAccount;
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
private Integer getRandom(){
Random random = new Random();
// 生成九位随机数字
return 100000000 + random.nextInt(900000000);
}
}

@ -0,0 +1,42 @@
package com.sztzjy.bank.util.compute;
import org.springframework.stereotype.Component;
import java.lang.reflect.Field;
/**
* @author tz
* @date 2025/1/15 18:31
*/
@Component
public class ObjectComparatorUtil {
//比较两个对象属性值,返回不同属性值的个数
public static int countDifferences(Object obj1, Object obj2) throws IllegalAccessException {
if (obj1 == null || obj2 == null) {
throw new IllegalArgumentException("Objects must not be null");
}
if (!obj1.getClass().equals(obj2.getClass())) {
throw new IllegalArgumentException("Objects must be of the same class");
}
int differenceCount = 0;
Field[] fields = obj1.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
Object value1 = field.get(obj1);
Object value2 = field.get(obj2);
if (value1 == null) {
if (value2 != null) {
differenceCount++;
}
} else if (!value1.equals(value2)) {
differenceCount++;
}
}
return differenceCount;
}
}

@ -0,0 +1,434 @@
<?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.sztzjy.bank.mapper.PerConsumerLoanCurrentAccountMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="customer_name" jdbcType="VARCHAR" property="customerName" />
<result column="customer_no" jdbcType="INTEGER" property="customerNo" />
<result column="currency" jdbcType="VARCHAR" property="currency" />
<result column="currency_exchange_symbol" jdbcType="VARCHAR" property="currencyExchangeSymbol" />
<result column="classification_type" jdbcType="VARCHAR" property="classificationType" />
<result column="nature_of_account" jdbcType="VARCHAR" property="natureOfAccount" />
<result column="voucher_type" jdbcType="VARCHAR" property="voucherType" />
<result column="withdrawal_method" jdbcType="VARCHAR" property="withdrawalMethod" />
<result column="withdrawal_password" jdbcType="VARCHAR" property="withdrawalPassword" />
<result column="confirm_password" jdbcType="VARCHAR" property="confirmPassword" />
<result column="bank_card_number" jdbcType="INTEGER" property="bankCardNumber" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="save_status" jdbcType="INTEGER" property="saveStatus" />
<result column="submit_status" jdbcType="INTEGER" property="submitStatus" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="error_number" jdbcType="INTEGER" property="errorNumber" />
<result column="number" jdbcType="INTEGER" property="number" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, customer_name, customer_no, currency, currency_exchange_symbol, classification_type,
nature_of_account, voucher_type, withdrawal_method, withdrawal_password, confirm_password,
bank_card_number, create_time, update_time, save_status, submit_status, user_id,
error_number, number
</sql>
<select id="selectByExample" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccountExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from per_consumer_loan_current_account
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from per_consumer_loan_current_account
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from per_consumer_loan_current_account
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccountExample">
delete from per_consumer_loan_current_account
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount">
insert into per_consumer_loan_current_account (id, customer_name, customer_no,
currency, currency_exchange_symbol, classification_type,
nature_of_account, voucher_type, withdrawal_method,
withdrawal_password, confirm_password, bank_card_number,
create_time, update_time, save_status,
submit_status, user_id, error_number,
number)
values (#{id,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, #{customerNo,jdbcType=INTEGER},
#{currency,jdbcType=VARCHAR}, #{currencyExchangeSymbol,jdbcType=VARCHAR}, #{classificationType,jdbcType=VARCHAR},
#{natureOfAccount,jdbcType=VARCHAR}, #{voucherType,jdbcType=VARCHAR}, #{withdrawalMethod,jdbcType=VARCHAR},
#{withdrawalPassword,jdbcType=VARCHAR}, #{confirmPassword,jdbcType=VARCHAR}, #{bankCardNumber,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{saveStatus,jdbcType=INTEGER},
#{submitStatus,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{errorNumber,jdbcType=INTEGER},
#{number,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount">
insert into per_consumer_loan_current_account
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="customerName != null">
customer_name,
</if>
<if test="customerNo != null">
customer_no,
</if>
<if test="currency != null">
currency,
</if>
<if test="currencyExchangeSymbol != null">
currency_exchange_symbol,
</if>
<if test="classificationType != null">
classification_type,
</if>
<if test="natureOfAccount != null">
nature_of_account,
</if>
<if test="voucherType != null">
voucher_type,
</if>
<if test="withdrawalMethod != null">
withdrawal_method,
</if>
<if test="withdrawalPassword != null">
withdrawal_password,
</if>
<if test="confirmPassword != null">
confirm_password,
</if>
<if test="bankCardNumber != null">
bank_card_number,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="saveStatus != null">
save_status,
</if>
<if test="submitStatus != null">
submit_status,
</if>
<if test="userId != null">
user_id,
</if>
<if test="errorNumber != null">
error_number,
</if>
<if test="number != null">
number,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="customerName != null">
#{customerName,jdbcType=VARCHAR},
</if>
<if test="customerNo != null">
#{customerNo,jdbcType=INTEGER},
</if>
<if test="currency != null">
#{currency,jdbcType=VARCHAR},
</if>
<if test="currencyExchangeSymbol != null">
#{currencyExchangeSymbol,jdbcType=VARCHAR},
</if>
<if test="classificationType != null">
#{classificationType,jdbcType=VARCHAR},
</if>
<if test="natureOfAccount != null">
#{natureOfAccount,jdbcType=VARCHAR},
</if>
<if test="voucherType != null">
#{voucherType,jdbcType=VARCHAR},
</if>
<if test="withdrawalMethod != null">
#{withdrawalMethod,jdbcType=VARCHAR},
</if>
<if test="withdrawalPassword != null">
#{withdrawalPassword,jdbcType=VARCHAR},
</if>
<if test="confirmPassword != null">
#{confirmPassword,jdbcType=VARCHAR},
</if>
<if test="bankCardNumber != null">
#{bankCardNumber,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="saveStatus != null">
#{saveStatus,jdbcType=INTEGER},
</if>
<if test="submitStatus != null">
#{submitStatus,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="errorNumber != null">
#{errorNumber,jdbcType=INTEGER},
</if>
<if test="number != null">
#{number,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccountExample" resultType="java.lang.Long">
select count(*) from per_consumer_loan_current_account
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update per_consumer_loan_current_account
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.customerName != null">
customer_name = #{record.customerName,jdbcType=VARCHAR},
</if>
<if test="record.customerNo != null">
customer_no = #{record.customerNo,jdbcType=INTEGER},
</if>
<if test="record.currency != null">
currency = #{record.currency,jdbcType=VARCHAR},
</if>
<if test="record.currencyExchangeSymbol != null">
currency_exchange_symbol = #{record.currencyExchangeSymbol,jdbcType=VARCHAR},
</if>
<if test="record.classificationType != null">
classification_type = #{record.classificationType,jdbcType=VARCHAR},
</if>
<if test="record.natureOfAccount != null">
nature_of_account = #{record.natureOfAccount,jdbcType=VARCHAR},
</if>
<if test="record.voucherType != null">
voucher_type = #{record.voucherType,jdbcType=VARCHAR},
</if>
<if test="record.withdrawalMethod != null">
withdrawal_method = #{record.withdrawalMethod,jdbcType=VARCHAR},
</if>
<if test="record.withdrawalPassword != null">
withdrawal_password = #{record.withdrawalPassword,jdbcType=VARCHAR},
</if>
<if test="record.confirmPassword != null">
confirm_password = #{record.confirmPassword,jdbcType=VARCHAR},
</if>
<if test="record.bankCardNumber != null">
bank_card_number = #{record.bankCardNumber,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.saveStatus != null">
save_status = #{record.saveStatus,jdbcType=INTEGER},
</if>
<if test="record.submitStatus != null">
submit_status = #{record.submitStatus,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.errorNumber != null">
error_number = #{record.errorNumber,jdbcType=INTEGER},
</if>
<if test="record.number != null">
number = #{record.number,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update per_consumer_loan_current_account
set id = #{record.id,jdbcType=VARCHAR},
customer_name = #{record.customerName,jdbcType=VARCHAR},
customer_no = #{record.customerNo,jdbcType=INTEGER},
currency = #{record.currency,jdbcType=VARCHAR},
currency_exchange_symbol = #{record.currencyExchangeSymbol,jdbcType=VARCHAR},
classification_type = #{record.classificationType,jdbcType=VARCHAR},
nature_of_account = #{record.natureOfAccount,jdbcType=VARCHAR},
voucher_type = #{record.voucherType,jdbcType=VARCHAR},
withdrawal_method = #{record.withdrawalMethod,jdbcType=VARCHAR},
withdrawal_password = #{record.withdrawalPassword,jdbcType=VARCHAR},
confirm_password = #{record.confirmPassword,jdbcType=VARCHAR},
bank_card_number = #{record.bankCardNumber,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
save_status = #{record.saveStatus,jdbcType=INTEGER},
submit_status = #{record.submitStatus,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
error_number = #{record.errorNumber,jdbcType=INTEGER},
number = #{record.number,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount">
update per_consumer_loan_current_account
<set>
<if test="customerName != null">
customer_name = #{customerName,jdbcType=VARCHAR},
</if>
<if test="customerNo != null">
customer_no = #{customerNo,jdbcType=INTEGER},
</if>
<if test="currency != null">
currency = #{currency,jdbcType=VARCHAR},
</if>
<if test="currencyExchangeSymbol != null">
currency_exchange_symbol = #{currencyExchangeSymbol,jdbcType=VARCHAR},
</if>
<if test="classificationType != null">
classification_type = #{classificationType,jdbcType=VARCHAR},
</if>
<if test="natureOfAccount != null">
nature_of_account = #{natureOfAccount,jdbcType=VARCHAR},
</if>
<if test="voucherType != null">
voucher_type = #{voucherType,jdbcType=VARCHAR},
</if>
<if test="withdrawalMethod != null">
withdrawal_method = #{withdrawalMethod,jdbcType=VARCHAR},
</if>
<if test="withdrawalPassword != null">
withdrawal_password = #{withdrawalPassword,jdbcType=VARCHAR},
</if>
<if test="confirmPassword != null">
confirm_password = #{confirmPassword,jdbcType=VARCHAR},
</if>
<if test="bankCardNumber != null">
bank_card_number = #{bankCardNumber,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="saveStatus != null">
save_status = #{saveStatus,jdbcType=INTEGER},
</if>
<if test="submitStatus != null">
submit_status = #{submitStatus,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="errorNumber != null">
error_number = #{errorNumber,jdbcType=INTEGER},
</if>
<if test="number != null">
number = #{number,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCurrentAccount">
update per_consumer_loan_current_account
set customer_name = #{customerName,jdbcType=VARCHAR},
customer_no = #{customerNo,jdbcType=INTEGER},
currency = #{currency,jdbcType=VARCHAR},
currency_exchange_symbol = #{currencyExchangeSymbol,jdbcType=VARCHAR},
classification_type = #{classificationType,jdbcType=VARCHAR},
nature_of_account = #{natureOfAccount,jdbcType=VARCHAR},
voucher_type = #{voucherType,jdbcType=VARCHAR},
withdrawal_method = #{withdrawalMethod,jdbcType=VARCHAR},
withdrawal_password = #{withdrawalPassword,jdbcType=VARCHAR},
confirm_password = #{confirmPassword,jdbcType=VARCHAR},
bank_card_number = #{bankCardNumber,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
save_status = #{saveStatus,jdbcType=INTEGER},
submit_status = #{submitStatus,jdbcType=INTEGER},
user_id = #{userId,jdbcType=VARCHAR},
error_number = #{errorNumber,jdbcType=INTEGER},
number = #{number,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

@ -0,0 +1,544 @@
<?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.sztzjy.bank.mapper.PerConsumerLoanCustomerInfoMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="customer_name" jdbcType="VARCHAR" property="customerName" />
<result column="customer_no" jdbcType="INTEGER" property="customerNo" />
<result column="nationality" jdbcType="VARCHAR" property="nationality" />
<result column="id_type" jdbcType="VARCHAR" property="idType" />
<result column="id_number" jdbcType="VARCHAR" property="idNumber" />
<result column="marital_status" jdbcType="VARCHAR" property="maritalStatus" />
<result column="career" jdbcType="VARCHAR" property="career" />
<result column="contact_number" jdbcType="VARCHAR" property="contactNumber" />
<result column="position" jdbcType="VARCHAR" property="position" />
<result column="years_of_employment" jdbcType="VARCHAR" property="yearsOfEmployment" />
<result column="monthly_pay" jdbcType="VARCHAR" property="monthlyPay" />
<result column="annual_income" jdbcType="VARCHAR" property="annualIncome" />
<result column="employment_company" jdbcType="VARCHAR" property="employmentCompany" />
<result column="mail_address" jdbcType="VARCHAR" property="mailAddress" />
<result column="residence_address" jdbcType="VARCHAR" property="residenceAddress" />
<result column="first_contact_person" jdbcType="VARCHAR" property="firstContactPerson" />
<result column="relationship" jdbcType="VARCHAR" property="relationship" />
<result column="contact_phone" jdbcType="VARCHAR" property="contactPhone" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="save_status" jdbcType="INTEGER" property="saveStatus" />
<result column="submit_status" jdbcType="INTEGER" property="submitStatus" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="error_number" jdbcType="INTEGER" property="errorNumber" />
<result column="number" jdbcType="INTEGER" property="number" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, customer_name, customer_no, nationality, id_type, id_number, marital_status,
career, contact_number, position, years_of_employment, monthly_pay, annual_income,
employment_company, mail_address, residence_address, first_contact_person, relationship,
contact_phone, create_time, update_time, save_status, submit_status, user_id, error_number,
number
</sql>
<select id="selectByExample" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from per_consumer_loan_customer_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from per_consumer_loan_customer_info
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from per_consumer_loan_customer_info
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfoExample">
delete from per_consumer_loan_customer_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo">
insert into per_consumer_loan_customer_info (id, customer_name, customer_no,
nationality, id_type, id_number,
marital_status, career, contact_number,
position, years_of_employment, monthly_pay,
annual_income, employment_company, mail_address,
residence_address, first_contact_person, relationship,
contact_phone, create_time, update_time,
save_status, submit_status, user_id,
error_number, number)
values (#{id,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, #{customerNo,jdbcType=INTEGER},
#{nationality,jdbcType=VARCHAR}, #{idType,jdbcType=VARCHAR}, #{idNumber,jdbcType=VARCHAR},
#{maritalStatus,jdbcType=VARCHAR}, #{career,jdbcType=VARCHAR}, #{contactNumber,jdbcType=VARCHAR},
#{position,jdbcType=VARCHAR}, #{yearsOfEmployment,jdbcType=VARCHAR}, #{monthlyPay,jdbcType=VARCHAR},
#{annualIncome,jdbcType=VARCHAR}, #{employmentCompany,jdbcType=VARCHAR}, #{mailAddress,jdbcType=VARCHAR},
#{residenceAddress,jdbcType=VARCHAR}, #{firstContactPerson,jdbcType=VARCHAR}, #{relationship,jdbcType=VARCHAR},
#{contactPhone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{saveStatus,jdbcType=INTEGER}, #{submitStatus,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR},
#{errorNumber,jdbcType=INTEGER}, #{number,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo">
insert into per_consumer_loan_customer_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="customerName != null">
customer_name,
</if>
<if test="customerNo != null">
customer_no,
</if>
<if test="nationality != null">
nationality,
</if>
<if test="idType != null">
id_type,
</if>
<if test="idNumber != null">
id_number,
</if>
<if test="maritalStatus != null">
marital_status,
</if>
<if test="career != null">
career,
</if>
<if test="contactNumber != null">
contact_number,
</if>
<if test="position != null">
position,
</if>
<if test="yearsOfEmployment != null">
years_of_employment,
</if>
<if test="monthlyPay != null">
monthly_pay,
</if>
<if test="annualIncome != null">
annual_income,
</if>
<if test="employmentCompany != null">
employment_company,
</if>
<if test="mailAddress != null">
mail_address,
</if>
<if test="residenceAddress != null">
residence_address,
</if>
<if test="firstContactPerson != null">
first_contact_person,
</if>
<if test="relationship != null">
relationship,
</if>
<if test="contactPhone != null">
contact_phone,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="saveStatus != null">
save_status,
</if>
<if test="submitStatus != null">
submit_status,
</if>
<if test="userId != null">
user_id,
</if>
<if test="errorNumber != null">
error_number,
</if>
<if test="number != null">
number,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="customerName != null">
#{customerName,jdbcType=VARCHAR},
</if>
<if test="customerNo != null">
#{customerNo,jdbcType=INTEGER},
</if>
<if test="nationality != null">
#{nationality,jdbcType=VARCHAR},
</if>
<if test="idType != null">
#{idType,jdbcType=VARCHAR},
</if>
<if test="idNumber != null">
#{idNumber,jdbcType=VARCHAR},
</if>
<if test="maritalStatus != null">
#{maritalStatus,jdbcType=VARCHAR},
</if>
<if test="career != null">
#{career,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null">
#{contactNumber,jdbcType=VARCHAR},
</if>
<if test="position != null">
#{position,jdbcType=VARCHAR},
</if>
<if test="yearsOfEmployment != null">
#{yearsOfEmployment,jdbcType=VARCHAR},
</if>
<if test="monthlyPay != null">
#{monthlyPay,jdbcType=VARCHAR},
</if>
<if test="annualIncome != null">
#{annualIncome,jdbcType=VARCHAR},
</if>
<if test="employmentCompany != null">
#{employmentCompany,jdbcType=VARCHAR},
</if>
<if test="mailAddress != null">
#{mailAddress,jdbcType=VARCHAR},
</if>
<if test="residenceAddress != null">
#{residenceAddress,jdbcType=VARCHAR},
</if>
<if test="firstContactPerson != null">
#{firstContactPerson,jdbcType=VARCHAR},
</if>
<if test="relationship != null">
#{relationship,jdbcType=VARCHAR},
</if>
<if test="contactPhone != null">
#{contactPhone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="saveStatus != null">
#{saveStatus,jdbcType=INTEGER},
</if>
<if test="submitStatus != null">
#{submitStatus,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="errorNumber != null">
#{errorNumber,jdbcType=INTEGER},
</if>
<if test="number != null">
#{number,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfoExample" resultType="java.lang.Long">
select count(*) from per_consumer_loan_customer_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update per_consumer_loan_customer_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.customerName != null">
customer_name = #{record.customerName,jdbcType=VARCHAR},
</if>
<if test="record.customerNo != null">
customer_no = #{record.customerNo,jdbcType=INTEGER},
</if>
<if test="record.nationality != null">
nationality = #{record.nationality,jdbcType=VARCHAR},
</if>
<if test="record.idType != null">
id_type = #{record.idType,jdbcType=VARCHAR},
</if>
<if test="record.idNumber != null">
id_number = #{record.idNumber,jdbcType=VARCHAR},
</if>
<if test="record.maritalStatus != null">
marital_status = #{record.maritalStatus,jdbcType=VARCHAR},
</if>
<if test="record.career != null">
career = #{record.career,jdbcType=VARCHAR},
</if>
<if test="record.contactNumber != null">
contact_number = #{record.contactNumber,jdbcType=VARCHAR},
</if>
<if test="record.position != null">
position = #{record.position,jdbcType=VARCHAR},
</if>
<if test="record.yearsOfEmployment != null">
years_of_employment = #{record.yearsOfEmployment,jdbcType=VARCHAR},
</if>
<if test="record.monthlyPay != null">
monthly_pay = #{record.monthlyPay,jdbcType=VARCHAR},
</if>
<if test="record.annualIncome != null">
annual_income = #{record.annualIncome,jdbcType=VARCHAR},
</if>
<if test="record.employmentCompany != null">
employment_company = #{record.employmentCompany,jdbcType=VARCHAR},
</if>
<if test="record.mailAddress != null">
mail_address = #{record.mailAddress,jdbcType=VARCHAR},
</if>
<if test="record.residenceAddress != null">
residence_address = #{record.residenceAddress,jdbcType=VARCHAR},
</if>
<if test="record.firstContactPerson != null">
first_contact_person = #{record.firstContactPerson,jdbcType=VARCHAR},
</if>
<if test="record.relationship != null">
relationship = #{record.relationship,jdbcType=VARCHAR},
</if>
<if test="record.contactPhone != null">
contact_phone = #{record.contactPhone,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.saveStatus != null">
save_status = #{record.saveStatus,jdbcType=INTEGER},
</if>
<if test="record.submitStatus != null">
submit_status = #{record.submitStatus,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.errorNumber != null">
error_number = #{record.errorNumber,jdbcType=INTEGER},
</if>
<if test="record.number != null">
number = #{record.number,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update per_consumer_loan_customer_info
set id = #{record.id,jdbcType=VARCHAR},
customer_name = #{record.customerName,jdbcType=VARCHAR},
customer_no = #{record.customerNo,jdbcType=INTEGER},
nationality = #{record.nationality,jdbcType=VARCHAR},
id_type = #{record.idType,jdbcType=VARCHAR},
id_number = #{record.idNumber,jdbcType=VARCHAR},
marital_status = #{record.maritalStatus,jdbcType=VARCHAR},
career = #{record.career,jdbcType=VARCHAR},
contact_number = #{record.contactNumber,jdbcType=VARCHAR},
position = #{record.position,jdbcType=VARCHAR},
years_of_employment = #{record.yearsOfEmployment,jdbcType=VARCHAR},
monthly_pay = #{record.monthlyPay,jdbcType=VARCHAR},
annual_income = #{record.annualIncome,jdbcType=VARCHAR},
employment_company = #{record.employmentCompany,jdbcType=VARCHAR},
mail_address = #{record.mailAddress,jdbcType=VARCHAR},
residence_address = #{record.residenceAddress,jdbcType=VARCHAR},
first_contact_person = #{record.firstContactPerson,jdbcType=VARCHAR},
relationship = #{record.relationship,jdbcType=VARCHAR},
contact_phone = #{record.contactPhone,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
save_status = #{record.saveStatus,jdbcType=INTEGER},
submit_status = #{record.submitStatus,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
error_number = #{record.errorNumber,jdbcType=INTEGER},
number = #{record.number,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo">
update per_consumer_loan_customer_info
<set>
<if test="customerName != null">
customer_name = #{customerName,jdbcType=VARCHAR},
</if>
<if test="customerNo != null">
customer_no = #{customerNo,jdbcType=INTEGER},
</if>
<if test="nationality != null">
nationality = #{nationality,jdbcType=VARCHAR},
</if>
<if test="idType != null">
id_type = #{idType,jdbcType=VARCHAR},
</if>
<if test="idNumber != null">
id_number = #{idNumber,jdbcType=VARCHAR},
</if>
<if test="maritalStatus != null">
marital_status = #{maritalStatus,jdbcType=VARCHAR},
</if>
<if test="career != null">
career = #{career,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null">
contact_number = #{contactNumber,jdbcType=VARCHAR},
</if>
<if test="position != null">
position = #{position,jdbcType=VARCHAR},
</if>
<if test="yearsOfEmployment != null">
years_of_employment = #{yearsOfEmployment,jdbcType=VARCHAR},
</if>
<if test="monthlyPay != null">
monthly_pay = #{monthlyPay,jdbcType=VARCHAR},
</if>
<if test="annualIncome != null">
annual_income = #{annualIncome,jdbcType=VARCHAR},
</if>
<if test="employmentCompany != null">
employment_company = #{employmentCompany,jdbcType=VARCHAR},
</if>
<if test="mailAddress != null">
mail_address = #{mailAddress,jdbcType=VARCHAR},
</if>
<if test="residenceAddress != null">
residence_address = #{residenceAddress,jdbcType=VARCHAR},
</if>
<if test="firstContactPerson != null">
first_contact_person = #{firstContactPerson,jdbcType=VARCHAR},
</if>
<if test="relationship != null">
relationship = #{relationship,jdbcType=VARCHAR},
</if>
<if test="contactPhone != null">
contact_phone = #{contactPhone,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="saveStatus != null">
save_status = #{saveStatus,jdbcType=INTEGER},
</if>
<if test="submitStatus != null">
submit_status = #{submitStatus,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="errorNumber != null">
error_number = #{errorNumber,jdbcType=INTEGER},
</if>
<if test="number != null">
number = #{number,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.bank.entity.PerConsumerLoanCustomerInfo">
update per_consumer_loan_customer_info
set customer_name = #{customerName,jdbcType=VARCHAR},
customer_no = #{customerNo,jdbcType=INTEGER},
nationality = #{nationality,jdbcType=VARCHAR},
id_type = #{idType,jdbcType=VARCHAR},
id_number = #{idNumber,jdbcType=VARCHAR},
marital_status = #{maritalStatus,jdbcType=VARCHAR},
career = #{career,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR},
position = #{position,jdbcType=VARCHAR},
years_of_employment = #{yearsOfEmployment,jdbcType=VARCHAR},
monthly_pay = #{monthlyPay,jdbcType=VARCHAR},
annual_income = #{annualIncome,jdbcType=VARCHAR},
employment_company = #{employmentCompany,jdbcType=VARCHAR},
mail_address = #{mailAddress,jdbcType=VARCHAR},
residence_address = #{residenceAddress,jdbcType=VARCHAR},
first_contact_person = #{firstContactPerson,jdbcType=VARCHAR},
relationship = #{relationship,jdbcType=VARCHAR},
contact_phone = #{contactPhone,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
save_status = #{saveStatus,jdbcType=INTEGER},
submit_status = #{submitStatus,jdbcType=INTEGER},
user_id = #{userId,jdbcType=VARCHAR},
error_number = #{errorNumber,jdbcType=INTEGER},
number = #{number,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save