149 lines
6.3 KiB
XML
149 lines
6.3 KiB
XML
<?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.bms.ar.mapper.ArBillDetailFeeMapper">
|
|
<!-- 账单明细费用项读写;批量查询仅接收当前明细批次的 ID。 -->
|
|
<resultMap id="ArBillDetailFeeResult" type="ArBillDetailFee">
|
|
<id property="detailFeeId" column="detail_fee_id"/>
|
|
<result property="detailId" column="detail_id"/>
|
|
<result property="prcIncomeBillFeeId" column="prc_income_bill_fee_id"/>
|
|
<result property="feeNo" column="fee_no"/>
|
|
<result property="feeType" column="fee_type"/>
|
|
<result property="feeName" column="fee_name"/>
|
|
<result property="scId" column="sc_id"/>
|
|
<result property="quantity" column="quantity"/>
|
|
<result property="unit" column="unit"/>
|
|
<result property="unitPrice" column="unit_price"/>
|
|
<result property="amount" column="amount"/>
|
|
<result property="productAmount" column="product_amount"/>
|
|
<result property="redlineAmount" column="redline_amount"/>
|
|
<result property="currency" column="currency"/>
|
|
<result property="calculationFormula" column="calculation_formula"/>
|
|
<result property="roundMode" column="round_mode"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="createTime" column="create_time"/>
|
|
</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,
|
|
product_amount,
|
|
redline_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.product_amount,
|
|
f.redline_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,
|
|
product_amount,
|
|
redline_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, product_amount, redline_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, product_amount, redline_amount, currency, calculation_formula, round_mode, remark, create_by,
|
|
create_time)
|
|
values (#{detailId}, #{prcIncomeBillFeeId}, #{feeNo}, #{feeType}, #{feeName}, #{scId}, #{quantity}, #{unit},
|
|
#{unitPrice}, #{amount}, #{productAmount}, #{redlineAmount}, #{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, product_amount, redline_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.productAmount}, #{item.redlineAmount}, #{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>
|