fix: 人情账单bug修复,信用卡额度历史功能开发。

This commit is contained in:
tianyongbao
2024-11-07 13:31:49 +08:00
parent 77a3627490
commit 9468d671e8
12 changed files with 712 additions and 8 deletions

View File

@@ -0,0 +1,116 @@
package com.ruoyi.invest.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.invest.domain.BankCardLimitHistory;
import com.ruoyi.invest.domain.vo.BankCardLimitHistoryVo;
import com.ruoyi.invest.domain.dto.BankCardLimitHistoryDto;
import com.ruoyi.invest.service.IBankCardLimitHistoryService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* 银行卡额度调整历史记录Controller
*
* @author tianyongbao
* @date 2024-11-04
*/
@Api(tags=" 银行卡额度调整历史记录")
@RestController
@RequestMapping("/limitHistory")
public class BankCardLimitHistoryController extends BaseController
{
@Resource
private IBankCardLimitHistoryService bankCardLimitHistoryService;
/**
* 查询银行卡额度调整历史记录列表
*/
@ApiOperation(value="查询银行卡额度调整历史记录列表",response = BankCardLimitHistoryVo.class)
@RequiresPermissions("invest:limitHistory:list")
@GetMapping("/list")
public TableDataInfo list(BankCardLimitHistoryDto bankCardLimitHistoryDto)
{
startPage();
List<BankCardLimitHistoryVo> list = bankCardLimitHistoryService.selectBankCardLimitHistoryList(bankCardLimitHistoryDto);
return getDataTable(list);
}
/**
* 导出银行卡额度调整历史记录列表
*/
@ApiOperation(value="导出银行卡额度调整历史记录列表")
@RequiresPermissions("invest:limitHistory:export")
@Log(title = "银行卡额度调整历史记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BankCardLimitHistoryDto bankCardLimitHistoryDto)
{
List<BankCardLimitHistoryVo> list = bankCardLimitHistoryService.selectBankCardLimitHistoryList(bankCardLimitHistoryDto);
ExcelUtil<BankCardLimitHistoryVo> util = new ExcelUtil<BankCardLimitHistoryVo>(BankCardLimitHistoryVo.class);
util.exportExcel(response, list, "银行卡额度调整历史记录数据");
}
/**
* 获取银行卡额度调整历史记录详细信息
*/
@ApiOperation(value="获取银行卡额度调整历史记录详细信息")
@RequiresPermissions("invest:limitHistory:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(bankCardLimitHistoryService.selectBankCardLimitHistoryById(id));
}
/**
* 新增银行卡额度调整历史记录
*/
@ApiOperation(value="新增银行卡额度调整历史记录")
@RequiresPermissions("invest:limitHistory:add")
@Log(title = "银行卡额度调整历史记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BankCardLimitHistory bankCardLimitHistory)
{
return toAjax(bankCardLimitHistoryService.insertBankCardLimitHistory(bankCardLimitHistory));
}
/**
* 修改银行卡额度调整历史记录
*/
@ApiOperation(value="修改银行卡额度调整历史记录")
@RequiresPermissions("invest:limitHistory:edit")
@Log(title = "银行卡额度调整历史记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BankCardLimitHistory bankCardLimitHistory)
{
return toAjax(bankCardLimitHistoryService.updateBankCardLimitHistory(bankCardLimitHistory));
}
/**
* 删除银行卡额度调整历史记录
*/
@ApiOperation(value="删除银行卡额度调整历史记录")
@RequiresPermissions("invest:limitHistory:remove")
@Log(title = "银行卡额度调整历史记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(bankCardLimitHistoryService.deleteBankCardLimitHistoryByIds(ids));
}
}

View File

@@ -0,0 +1,103 @@
package com.ruoyi.invest.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 银行卡额度调整历史记录对象 bank_card_limit_history
*
* @author tianyongbao
* @date 2024-11-04
*/
@ApiModel("银行卡额度调整历史记录对象")
@Data
public class BankCardLimitHistory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 银行卡名称 */
@ApiModelProperty(value="银行卡名称")
@Excel(name = "银行卡名称")
private String name;
/** 类型 */
@ApiModelProperty(value="类型")
@Excel(name = "类型")
private String type;
/** 卡id */
@ApiModelProperty(value="卡id)")
@NotNull(message="卡id不能为空")
@Excel(name = "卡id")
private Long bankCardLendId;
/** 调整后额度 */
@ApiModelProperty(value="调整后额度)")
@NotNull(message="调整后额度不能为空")
@Excel(name = "调整后额度")
private Integer afterLimit;
/** 删除标志0代表存在 1代表删除 */
private String delFlag;
/** 调整时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date adjustTime;
/** 生效日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生效日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date effectDate;
/** 截止日期 */
@ApiModelProperty(value="截止日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "截止日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date deadlineDate;
/** 调整类型 */
@ApiModelProperty(value="调整类型)")
@NotNull(message="调整类型不能为空")
@Excel(name = "调整类型")
private String adjustType;
/** 调整前额度 */
private Integer beforeLimit;
/** 调整额度 */
private Integer adjustLimit;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("type", getType())
.append("bankCardLendId", getBankCardLendId())
.append("afterLimit", getAfterLimit())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("delFlag", getDelFlag())
.append("remark", getRemark())
.append("adjustTime", getAdjustTime())
.append("effectDate", getEffectDate())
.append("deadlineDate", getDeadlineDate())
.append("adjustType", getAdjustType())
.append("beforeLimit", getBeforeLimit())
.append("adjustLimit", getAdjustLimit())
.toString();
}
}

View File

@@ -46,4 +46,10 @@ public class AccountsDto extends BaseEntity implements Serializable
@ApiModelProperty(value="还款账户flag")
private String repayFlag;
/** 借贷类型 */
@ApiModelProperty(value="借贷类型")
private String lendType;
}

View File

@@ -0,0 +1,64 @@
package com.ruoyi.invest.domain.dto;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 银行卡额度调整历史记录Dto对象 bank_card_limit_history
*
* @author tianyongbao
* @date 2024-11-04
*/
@ApiModel("银行卡额度调整历史记录Dto对象")
@Data
public class BankCardLimitHistoryDto implements Serializable
{
private static final long serialVersionUID = 1L;
/** 银行卡名称 */
@ApiModelProperty(value="银行卡名称")
private String name;
/** 类型 */
@ApiModelProperty(value="类型")
private String type;
/** 卡id */
@ApiModelProperty(value="卡id")
private Long bankCardLendId;
/** 调整后额度 */
@ApiModelProperty(value="调整后额度")
private Integer afterLimit;
/** 调整时间 */
@ApiModelProperty(value="调整时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date adjustTime;
/** 生效日期 */
@ApiModelProperty(value="生效日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date effectDate;
/** 截止日期 */
@ApiModelProperty(value="截止日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date deadlineDate;
/** 调整类型 */
@ApiModelProperty(value="调整类型")
private String adjustType;
/** 调整前额度 */
@ApiModelProperty(value="调整前额度")
private Integer beforeLimit;
/** 调整额度 */
@ApiModelProperty(value="调整额度")
private Integer adjustLimit;
}

View File

@@ -41,4 +41,6 @@ public class AccountsVo extends Accounts
@ApiModelProperty(value="类型名称卡号可用额度)")
private String typeNameCodeAvailableLimit;
private String lendType;
}

View File

@@ -0,0 +1,17 @@
package com.ruoyi.invest.domain.vo;
import com.ruoyi.invest.domain.BankCardLimitHistory;
import lombok.Data;
import io.swagger.annotations.ApiModel;
/**
* 银行卡额度调整历史记录Vo对象 bank_card_limit_history
*
* @author tianyongbao
* @date 2024-11-04
*/
@ApiModel("银行卡额度调整历史记录Vo对象")
@Data
public class BankCardLimitHistoryVo extends BankCardLimitHistory
{
}

View File

@@ -0,0 +1,79 @@
package com.ruoyi.invest.mapper;
import java.util.List;
import com.ruoyi.invest.domain.BankCardLimitHistory;
import com.ruoyi.invest.domain.dto.BankCardLimitHistoryDto;
import com.ruoyi.invest.domain.vo.BankCardLimitHistoryVo;
/**
* 银行卡额度调整历史记录Mapper接口
*
* @author tianyongbao
* @date 2024-11-04
*/
public interface BankCardLimitHistoryMapper
{
/**
* 查询银行卡额度调整历史记录
*
* @param id 银行卡额度调整历史记录主键
* @return 银行卡额度调整历史记录
*/
public BankCardLimitHistoryVo selectBankCardLimitHistoryById(Long id);
/**
* 查询银行卡额度调整历史记录列表
*
* @param bankCardLimitHistoryDto 银行卡额度调整历史记录
* @return 银行卡额度调整历史记录集合
*/
public List<BankCardLimitHistoryVo> selectBankCardLimitHistoryList(BankCardLimitHistoryDto bankCardLimitHistoryDto);
/**
* 新增银行卡额度调整历史记录
*
* @param bankCardLimitHistory 银行卡额度调整历史记录
* @return 结果
*/
public int insertBankCardLimitHistory(BankCardLimitHistory bankCardLimitHistory);
/**
* 修改银行卡额度调整历史记录
*
* @param bankCardLimitHistory 银行卡额度调整历史记录
* @return 结果
*/
public int updateBankCardLimitHistory(BankCardLimitHistory bankCardLimitHistory);
/**
* 删除银行卡额度调整历史记录
*
* @param id 银行卡额度调整历史记录主键
* @return 结果
*/
public int deleteBankCardLimitHistoryById(Long id);
/**
* 批量删除银行卡额度调整历史记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBankCardLimitHistoryByIds(Long[] ids);
/**
* 逻辑删除银行卡额度调整历史记录
*
* @param id 银行卡额度调整历史记录主键
* @return 结果
*/
public int removeBankCardLimitHistoryById(Long id);
/**
* 批量逻辑删除银行卡额度调整历史记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int removeBankCardLimitHistoryByIds(Long[] ids);
}

View File

@@ -0,0 +1,63 @@
package com.ruoyi.invest.service;
import java.util.List;
import com.ruoyi.invest.domain.BankCardLimitHistory;
import com.ruoyi.invest.domain.dto.BankCardLimitHistoryDto;
import com.ruoyi.invest.domain.vo.BankCardLimitHistoryVo;
/**
* 银行卡额度调整历史记录Service接口
*
* @author tianyongbao
* @date 2024-11-04
*/
public interface IBankCardLimitHistoryService
{
/**
* 查询银行卡额度调整历史记录
*
* @param id 银行卡额度调整历史记录主键
* @return 银行卡额度调整历史记录
*/
public BankCardLimitHistoryVo selectBankCardLimitHistoryById(Long id);
/**
* 查询银行卡额度调整历史记录列表
*
* @param bankCardLimitHistoryDto 银行卡额度调整历史记录
* @return 银行卡额度调整历史记录集合
*/
public List<BankCardLimitHistoryVo> selectBankCardLimitHistoryList(BankCardLimitHistoryDto bankCardLimitHistoryDto);
/**
* 新增银行卡额度调整历史记录
*
* @param bankCardLimitHistory 银行卡额度调整历史记录
* @return 结果
*/
public int insertBankCardLimitHistory(BankCardLimitHistory bankCardLimitHistory);
/**
* 修改银行卡额度调整历史记录
*
* @param bankCardLimitHistory 银行卡额度调整历史记录
* @return 结果
*/
public int updateBankCardLimitHistory(BankCardLimitHistory bankCardLimitHistory);
/**
* 批量删除银行卡额度调整历史记录
*
* @param ids 需要删除的银行卡额度调整历史记录主键集合
* @return 结果
*/
public int deleteBankCardLimitHistoryByIds(Long[] ids);
/**
* 删除银行卡额度调整历史记录信息
*
* @param id 银行卡额度调整历史记录主键
* @return 结果
*/
public int deleteBankCardLimitHistoryById(Long id);
}

View File

@@ -0,0 +1,105 @@
package com.ruoyi.invest.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.IdWorker;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.invest.domain.BankCardLimitHistory;
import com.ruoyi.invest.domain.dto.BankCardLimitHistoryDto;
import com.ruoyi.invest.domain.vo.BankCardLimitHistoryVo;
import com.ruoyi.invest.mapper.BankCardLimitHistoryMapper;
import com.ruoyi.invest.service.IBankCardLimitHistoryService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 银行卡额度调整历史记录Service业务层处理
*
* @author tianyongbao
* @date 2024-11-04
*/
@Service
public class BankCardLimitHistoryServiceImpl implements IBankCardLimitHistoryService
{
@Resource
private BankCardLimitHistoryMapper bankCardLimitHistoryMapper;
/**
* 查询银行卡额度调整历史记录
*
* @param id 银行卡额度调整历史记录主键
* @return 银行卡额度调整历史记录
*/
@Override
public BankCardLimitHistoryVo selectBankCardLimitHistoryById(Long id)
{
return bankCardLimitHistoryMapper.selectBankCardLimitHistoryById(id);
}
/**
* 查询银行卡额度调整历史记录列表
*
* @param bankCardLimitHistoryDto 银行卡额度调整历史记录
* @return 银行卡额度调整历史记录
*/
@Override
public List<BankCardLimitHistoryVo> selectBankCardLimitHistoryList(BankCardLimitHistoryDto bankCardLimitHistoryDto)
{
return bankCardLimitHistoryMapper.selectBankCardLimitHistoryList(bankCardLimitHistoryDto);
}
/**
* 新增银行卡额度调整历史记录
*
* @param bankCardLimitHistory 银行卡额度调整历史记录
* @return 结果
*/
@Override
public int insertBankCardLimitHistory(BankCardLimitHistory bankCardLimitHistory)
{
bankCardLimitHistory.setCreateBy(SecurityUtils.getUsername());
bankCardLimitHistory.setCreateTime(DateUtils.getNowDate());
bankCardLimitHistory.setId(IdWorker.getId());
bankCardLimitHistory.setAdjustLimit(bankCardLimitHistory.getAfterLimit()-bankCardLimitHistory.getBeforeLimit());
return bankCardLimitHistoryMapper.insertBankCardLimitHistory(bankCardLimitHistory);
}
/**
* 修改银行卡额度调整历史记录
*
* @param bankCardLimitHistory 银行卡额度调整历史记录
* @return 结果
*/
@Override
public int updateBankCardLimitHistory(BankCardLimitHistory bankCardLimitHistory)
{
bankCardLimitHistory.setUpdateBy(SecurityUtils.getUsername());
bankCardLimitHistory.setUpdateTime(DateUtils.getNowDate());
return bankCardLimitHistoryMapper.updateBankCardLimitHistory(bankCardLimitHistory);
}
/**
* 批量删除银行卡额度调整历史记录
*
* @param ids 需要删除的银行卡额度调整历史记录主键
* @return 结果
*/
@Override
public int deleteBankCardLimitHistoryByIds(Long[] ids)
{
return bankCardLimitHistoryMapper.removeBankCardLimitHistoryByIds(ids);
}
/**
* 删除银行卡额度调整历史记录信息
*
* @param id 银行卡额度调整历史记录主键
* @return 结果
*/
@Override
public int deleteBankCardLimitHistoryById(Long id)
{
return bankCardLimitHistoryMapper.removeBankCardLimitHistoryById(id);
}
}

View File

@@ -507,20 +507,27 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
map.put("creditInstallmentHistory",decimalFormat.format(creditInstallmentHistory));
//人情
installmentHistoryDto.setType("4");
installmentHistoryDto.setState("0");
List<InstallmentHistoryVo> installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
AccountsDto dto=new AccountsDto();
//状态正常,不隐藏
dto.setStatus("1");
//借贷
dto.setType("3");
dto.setLendType("2");
List<AccountsVo> accountsList=accountsMapper.selectAccountsList(dto);
double peopleLendHistory =0;
if(installmentHistoryList.size()>0){
peopleLendHistory = installmentHistoryList.stream().mapToDouble(InstallmentHistoryVo::getInstallmentAmount).sum();
if(accountsList.size()>0){
peopleLendHistory=accountsList.stream().mapToDouble(AccountsVo::getBalance).sum()*(-1);
}
map.put("peopleLendHistory",decimalFormat.format(peopleLendHistory));
// //人情
// installmentHistoryDto.setType("4");
// installmentHistoryDto.setState("0");
// List<InstallmentHistoryVo> installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
//未结清账户数
installmentHistoryDto.setState("0");
installmentHistoryDto.setType("3");
installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
List<InstallmentHistoryVo> installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
int unclearedOnlineDebtCount = installmentHistoryList.size();
map.put("unclearedOnlineDebtCount",unclearedOnlineDebtCount);

View File

@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="payDate" column="pay_date" />
<result property="creditLimit" column="credit_limit" />
<result property="debitType" column="debit_type" />
<result property="lendType" column="lend_type" />
<result property="status" column="status" />
</resultMap>
@@ -48,7 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bcl.bill_date ,
bcl.pay_date ,
bcl.credit_limit ,
bcl.debit_type
bcl.debit_type,
bcl.lend_type
from
accounts a
left join bank_card_lend bcl on
@@ -62,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="debitType != null and debitType != ''"> and bcl.debit_type = #{debitType}</if>
<if test="lendType != null and lendType != ''"> and bcl.lend_type = #{lendType}</if>
<if test="state != null and state != ''"> and a.state = #{state}</if>
<if test="status != null and status != ''"> and a.status = #{status}</if>
<if test="accountId != null and accountId != ''"> and a.account_id = #{accountId}</if>

View File

@@ -0,0 +1,139 @@
<?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.ruoyi.invest.mapper.BankCardLimitHistoryMapper">
<resultMap type="BankCardLimitHistoryVo" id="BankCardLimitHistoryResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="bankCardLendId" column="bank_card_lend_id" />
<result property="afterLimit" column="after_limit" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="adjustTime" column="adjust_time" />
<result property="effectDate" column="effect_date" />
<result property="deadlineDate" column="deadline_date" />
<result property="adjustType" column="adjust_type" />
<result property="beforeLimit" column="before_limit" />
<result property="adjustLimit" column="adjust_limit" />
</resultMap>
<sql id="selectBankCardLimitHistoryVo">
select a.id, a.name, a.type, a.bank_card_lend_id, a.after_limit, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.adjust_time, a.effect_date, a.deadline_date, a.adjust_type, a.before_limit, a.adjust_limit from bank_card_limit_history a
</sql>
<select id="selectBankCardLimitHistoryList" parameterType="BankCardLimitHistoryDto" resultMap="BankCardLimitHistoryResult">
<include refid="selectBankCardLimitHistoryVo"/>
<where>
a.del_flag='0'
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="bankCardLendId != null "> and a.bank_card_lend_id = #{bankCardLendId}</if>
<if test="afterLimit != null "> and a.after_limit = #{afterLimit}</if>
<if test="adjustTime != null "> and a.adjust_time = #{adjustTime}</if>
<if test="effectDate != null "> and a.effect_date = #{effectDate}</if>
<if test="deadlineDate != null "> and a.deadline_date = #{deadlineDate}</if>
<if test="adjustType != null and adjustType != ''"> and a.adjust_type = #{adjustType}</if>
<if test="beforeLimit != null "> and a.before_limit = #{beforeLimit}</if>
<if test="adjustLimit != null "> and a.adjust_limit = #{adjustLimit}</if>
</where>
order by a.create_time desc
</select>
<select id="selectBankCardLimitHistoryById" parameterType="Long" resultMap="BankCardLimitHistoryResult">
<include refid="selectBankCardLimitHistoryVo"/>
where a.id = #{id}
</select>
<insert id="insertBankCardLimitHistory" parameterType="BankCardLimitHistory">
insert into bank_card_limit_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="type != null">type,</if>
<if test="bankCardLendId != null">bank_card_lend_id,</if>
<if test="afterLimit != null">after_limit,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
<if test="adjustTime != null">adjust_time,</if>
<if test="effectDate != null">effect_date,</if>
<if test="deadlineDate != null">deadline_date,</if>
<if test="adjustType != null and adjustType != ''">adjust_type,</if>
<if test="beforeLimit != null">before_limit,</if>
<if test="adjustLimit != null">adjust_limit,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="type != null">#{type},</if>
<if test="bankCardLendId != null">#{bankCardLendId},</if>
<if test="afterLimit != null">#{afterLimit},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="adjustTime != null">#{adjustTime},</if>
<if test="effectDate != null">#{effectDate},</if>
<if test="deadlineDate != null">#{deadlineDate},</if>
<if test="adjustType != null and adjustType != ''">#{adjustType},</if>
<if test="beforeLimit != null">#{beforeLimit},</if>
<if test="adjustLimit != null">#{adjustLimit},</if>
</trim>
</insert>
<update id="updateBankCardLimitHistory" parameterType="BankCardLimitHistory">
update bank_card_limit_history
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="bankCardLendId != null">bank_card_lend_id = #{bankCardLendId},</if>
<if test="afterLimit != null">after_limit = #{afterLimit},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="adjustTime != null">adjust_time = #{adjustTime},</if>
<if test="effectDate != null">effect_date = #{effectDate},</if>
<if test="deadlineDate != null">deadline_date = #{deadlineDate},</if>
<if test="adjustType != null and adjustType != ''">adjust_type = #{adjustType},</if>
<if test="beforeLimit != null">before_limit = #{beforeLimit},</if>
<if test="adjustLimit != null">adjust_limit = #{adjustLimit},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBankCardLimitHistoryById" parameterType="Long">
delete from bank_card_limit_history where id = #{id}
</delete>
<delete id="deleteBankCardLimitHistoryByIds" parameterType="String">
delete from bank_card_limit_history where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeBankCardLimitHistoryById" parameterType="Long">
update bank_card_limit_history set del_flag='1' where id = #{id}
</update>
<update id="removeBankCardLimitHistoryByIds" parameterType="String">
update bank_card_limit_history set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>