账单异步生成优化
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.ar.mapper.ArBillDetailFeeMapper">
|
||||
<!-- 账单明细费用项读写;批量查询仅接收当前明细批次的 ID。 -->
|
||||
<resultMap id="ArBillDetailFeeResult" type="ArBillDetailFee">
|
||||
<id property="detailFeeId" column="detail_fee_id"/>
|
||||
<result property="detailId" column="detail_id"/>
|
||||
@@ -24,39 +25,116 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByDetailId" parameterType="long" resultMap="ArBillDetailFeeResult">
|
||||
select detail_fee_id, detail_id, prc_income_bill_fee_id, fee_no, fee_type, fee_name, sc_id, quantity,
|
||||
unit, unit_price, amount, currency, calculation_formula, round_mode, remark, create_by, create_time
|
||||
from ar_bill_detail_fee where detail_id = #{detailId} order by fee_no, detail_fee_id
|
||||
select detail_fee_id,
|
||||
detail_id,
|
||||
prc_income_bill_fee_id,
|
||||
fee_no,
|
||||
fee_type,
|
||||
fee_name,
|
||||
sc_id,
|
||||
quantity,
|
||||
unit,
|
||||
unit_price,
|
||||
amount,
|
||||
currency,
|
||||
calculation_formula,
|
||||
round_mode,
|
||||
remark,
|
||||
create_by,
|
||||
create_time
|
||||
from ar_bill_detail_fee
|
||||
where detail_id = #{detailId}
|
||||
order by fee_no, detail_fee_id
|
||||
</select>
|
||||
|
||||
<select id="selectByBillIdAndDetailId" resultMap="ArBillDetailFeeResult">
|
||||
select f.detail_fee_id,
|
||||
f.detail_id,
|
||||
f.prc_income_bill_fee_id,
|
||||
f.fee_no,
|
||||
f.fee_type,
|
||||
f.fee_name,
|
||||
f.sc_id,
|
||||
f.quantity,
|
||||
f.unit,
|
||||
f.unit_price,
|
||||
f.amount,
|
||||
f.currency,
|
||||
f.calculation_formula,
|
||||
f.round_mode,
|
||||
f.remark,
|
||||
f.create_by,
|
||||
f.create_time
|
||||
from ar_bill_detail_fee f
|
||||
inner join ar_bill_detail d on d.detail_id = f.detail_id
|
||||
where d.ar_bill_id = #{arBillId}
|
||||
and f.detail_id = #{detailId}
|
||||
order by f.fee_no, f.detail_fee_id
|
||||
</select>
|
||||
|
||||
<select id="selectByBillId" parameterType="long" resultMap="ArBillDetailFeeResult">
|
||||
select detail_fee_id, detail_id, prc_income_bill_fee_id, fee_no, fee_type, fee_name, sc_id, quantity,
|
||||
unit, unit_price, amount, currency, calculation_formula, round_mode, remark, create_by, create_time
|
||||
select detail_fee_id,
|
||||
detail_id,
|
||||
prc_income_bill_fee_id,
|
||||
fee_no,
|
||||
fee_type,
|
||||
fee_name,
|
||||
sc_id,
|
||||
quantity,
|
||||
unit,
|
||||
unit_price,
|
||||
amount,
|
||||
currency,
|
||||
calculation_formula,
|
||||
round_mode,
|
||||
remark,
|
||||
create_by,
|
||||
create_time
|
||||
from ar_bill_detail_fee
|
||||
where detail_id in (select detail_id from ar_bill_detail where ar_bill_id = #{arBillId})
|
||||
order by detail_id, fee_no, detail_fee_id
|
||||
</select>
|
||||
|
||||
<select id="selectByDetailIds" resultMap="ArBillDetailFeeResult">
|
||||
select detail_fee_id, detail_id, prc_income_bill_fee_id, fee_no, fee_type, fee_name, sc_id, quantity,
|
||||
unit, unit_price, amount, currency, calculation_formula, round_mode, remark, create_by, create_time
|
||||
from ar_bill_detail_fee
|
||||
where detail_id in
|
||||
<foreach collection="detailIds" item="detailId" open="(" separator="," close=")">
|
||||
#{detailId}
|
||||
</foreach>
|
||||
order by detail_id, fee_no, detail_fee_id
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="ArBillDetailFee" useGeneratedKeys="true" keyProperty="detailFeeId">
|
||||
insert into ar_bill_detail_fee (
|
||||
detail_id, prc_income_bill_fee_id, fee_no, fee_type, fee_name, sc_id, quantity, unit, unit_price,
|
||||
amount, currency, calculation_formula, round_mode, remark, create_by, create_time
|
||||
) values (
|
||||
#{detailId}, #{prcIncomeBillFeeId}, #{feeNo}, #{feeType}, #{feeName}, #{scId}, #{quantity}, #{unit},
|
||||
#{unitPrice}, #{amount}, #{currency}, #{calculationFormula}, #{roundMode}, #{remark},
|
||||
#{createBy}, sysdate()
|
||||
)
|
||||
insert into ar_bill_detail_fee (detail_id, prc_income_bill_fee_id, fee_no, fee_type, fee_name, sc_id, quantity,
|
||||
unit, unit_price,
|
||||
amount, currency, calculation_formula, round_mode, remark, create_by,
|
||||
create_time)
|
||||
values (#{detailId}, #{prcIncomeBillFeeId}, #{feeNo}, #{feeType}, #{feeName}, #{scId}, #{quantity}, #{unit},
|
||||
#{unitPrice}, #{amount}, #{currency}, #{calculationFormula}, #{roundMode}, #{remark},
|
||||
#{createBy}, sysdate())
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="detailFeeId">
|
||||
insert into ar_bill_detail_fee (
|
||||
detail_id, prc_income_bill_fee_id, fee_no, fee_type, fee_name, sc_id, quantity, unit, unit_price,
|
||||
amount, currency, calculation_formula, round_mode, remark, create_by, create_time
|
||||
detail_id, prc_income_bill_fee_id, fee_no, fee_type, fee_name, sc_id, quantity, unit, unit_price,
|
||||
amount, currency, calculation_formula, round_mode, remark, create_by, create_time
|
||||
) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.detailId}, #{item.prcIncomeBillFeeId}, #{item.feeNo}, #{item.feeType}, #{item.feeName}, #{item.scId},
|
||||
#{item.quantity}, #{item.unit}, #{item.unitPrice}, #{item.amount}, #{item.currency},
|
||||
#{item.calculationFormula}, #{item.roundMode}, #{item.remark}, #{item.createBy}, sysdate())
|
||||
(#{item.detailId}, #{item.prcIncomeBillFeeId}, #{item.feeNo}, #{item.feeType}, #{item.feeName},
|
||||
#{item.scId},
|
||||
#{item.quantity}, #{item.unit}, #{item.unitPrice}, #{item.amount}, #{item.currency},
|
||||
#{item.calculationFormula}, #{item.roundMode}, #{item.remark}, #{item.createBy}, sysdate())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByBillId" parameterType="long">
|
||||
delete
|
||||
f
|
||||
from ar_bill_detail_fee f
|
||||
inner join ar_bill_detail d on d.detail_id = f.detail_id
|
||||
where d.ar_bill_id =
|
||||
#{arBillId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user