fix: 还款明细新增待还款账号和余额。

This commit is contained in:
tianyongbao
2026-03-06 09:26:19 +08:00
parent 7ee1ce31ed
commit c8ec335c87
3 changed files with 3645 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package com.intc.invest.domain.vo;
import com.intc.invest.domain.InstallmentHistoryDetail;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* 分期历史明细Vo对象 installment_history_detail
*
* @author tianyongbao
* @date 2024-03-23
*/
@ApiModel("分期历史明细Vo对象")
@Data
public class InstallmentHistoryDetailVo extends InstallmentHistoryDetail
{
private String bankCardLendName;
private String repaymentAccountName;
private Double repaymentAccountBalance;
}

View File

@@ -0,0 +1,189 @@
<?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.intc.invest.mapper.InstallmentHistoryDetailMapper">
<resultMap type="InstallmentHistoryDetailVo" id="InstallmentHistoryDetailResult">
<result property="id" column="id" />
<result property="installmentHistoryId" column="installment_history_id" />
<result property="bankCardLendId" column="bank_card_lend_id" />
<result property="currentAmount" column="current_amount" />
<result property="repaymentDate" column="repayment_date" />
<result property="principal" column="principal" />
<result property="interest" column="interest" />
<result property="postingState" column="posting_state" />
<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="type" column="type" />
<result property="periods" column="periods" />
<result property="bankCardLendName" column="bank_card_lend_name" />
<result property="repaymentAccountId" column="repayment_account_id" />
<result property="repaymentAccountName" column="repayment_account_name" />
<result property="repaymentAccountBalance" column="repayment_account_name" />
</resultMap>
<sql id="selectInstallmentHistoryDetailVo">
select
a.id,
a.installment_history_id,
a.bank_card_lend_id,
a.current_amount,
a.repayment_date,
a.principal,
a.interest,
a.posting_state,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.remark,
a.type,
a.periods,
a.repayment_account_id,
CONCAT(bcl."name",
'',
right(bcl.code,
4),
'') as bank_card_lend_name,
CONCAT(debit."name",
'',
right(debit.code,
4),
'') as repayment_account_name,
debit.balance as repayment_account_balance
from
installment_history_detail a
left join bank_card_lend bcl on
bcl.id = a.bank_card_lend_id
left join installment_history ih on ih.id=a.installment_history_id
left join accounts debit on
debit.id = a.repayment_account_id
</sql>
<select id="selectInstallmentHistoryDetailList" parameterType="InstallmentHistoryDetailDto" resultMap="InstallmentHistoryDetailResult">
<include refid="selectInstallmentHistoryDetailVo"/>
<where>
a.del_flag='0' and ih.del_flag='0'
<if test="installmentHistoryId != null "> and a.installment_history_id = #{installmentHistoryId}</if>
<if test="bankCardLendId != null "> and a.bank_card_lend_id = #{bankCardLendId}</if>
<if test="type != null and type != ''"> and a.type = #{type}</if>
<if test="periods != null "> and a.periods = #{periods}</if>
<if test="state != null and state != ''"> and a.posting_state = #{state}</if>
<if test="repaymentMonth!=null and repaymentMonth !=''">
and #{repaymentMonth}=to_char(a.repayment_date, 'yyyy-MM')
</if>
<if test="repaymentDate!=null and repaymentDate !=''">
and #{repaymentDate}>=to_char(a.repayment_date, 'yyyy-MM-dd')
</if>
<if test="repaymentEqualDate!=null and repaymentEqualDate !=''">
and #{repaymentEqualDate}=to_char(a.repayment_date, 'yyyy-MM-dd')
</if>
<if test="startDate!=null and startDate !=''">
and to_char(a.repayment_date, 'yyyy-MM-dd')>=#{startDate}
</if>
<if test="endDate!=null and endDate !=''">
and #{endDate}>=to_char(a.repayment_date, 'yyyy-MM-dd')
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by a.repayment_date desc
</select>
<select id="selectInstallmentHistoryDetailById" parameterType="Long" resultMap="InstallmentHistoryDetailResult">
<include refid="selectInstallmentHistoryDetailVo"/>
where a.id = #{id}
</select>
<insert id="insertInstallmentHistoryDetail" parameterType="InstallmentHistoryDetail">
insert into installment_history_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="installmentHistoryId != null">installment_history_id,</if>
<if test="bankCardLendId != null">bank_card_lend_id,</if>
<if test="currentAmount != null and currentAmount != ''">current_amount,</if>
<if test="repaymentDate != null">repayment_date,</if>
<if test="principal != null">principal,</if>
<if test="interest != null">interest,</if>
<if test="postingState != null and postingState != ''">posting_state,</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="type != null">type,</if>
<if test="periods != null">periods,</if>
<if test="repaymentAccountId != null">repayment_account_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="installmentHistoryId != null">#{installmentHistoryId},</if>
<if test="bankCardLendId != null">#{bankCardLendId},</if>
<if test="currentAmount != null and currentAmount != ''">#{currentAmount},</if>
<if test="repaymentDate != null">#{repaymentDate},</if>
<if test="principal != null">#{principal},</if>
<if test="interest != null">#{interest},</if>
<if test="postingState != null and postingState != ''">#{postingState},</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="type != null">#{type},</if>
<if test="periods != null">#{periods},</if>
<if test="repaymentAccountId != null">#{repaymentAccountId},</if>
</trim>
</insert>
<update id="updateInstallmentHistoryDetail" parameterType="InstallmentHistoryDetail">
update installment_history_detail
<trim prefix="SET" suffixOverrides=",">
<if test="installmentHistoryId != null">installment_history_id = #{installmentHistoryId},</if>
<if test="bankCardLendId != null">bank_card_lend_id = #{bankCardLendId},</if>
<if test="currentAmount != null and currentAmount != ''">current_amount = #{currentAmount},</if>
<if test="repaymentDate != null">repayment_date = #{repaymentDate},</if>
<if test="principal != null">principal = #{principal},</if>
<if test="interest != null">interest = #{interest},</if>
<if test="postingState != null and postingState != ''">posting_state = #{postingState},</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="type != null">type = #{type},</if>
<if test="periods != null">periods = #{periods},</if>
<if test="repaymentAccountId != null">repayment_account_id = #{repaymentAccountId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInstallmentHistoryDetailById" parameterType="Long">
delete from installment_history_detail where id = #{id}
</delete>
<delete id="deleteInstallmentHistoryDetailByIds" parameterType="String">
delete from installment_history_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeInstallmentHistoryDetailById" parameterType="Long">
update installment_history_detail set del_flag='1' where id = #{id}
</update>
<update id="removeInstallmentHistoryDetailByIds" parameterType="String">
update installment_history_detail set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>