|
@@ -51,59 +51,111 @@
|
|
|
<result property="fBillingway" column="f_billingway"/>
|
|
|
<result property="fBsdate" column="f_bsdate"/>
|
|
|
<result property="fOriginalbilldate" column="f_originalbilldate"/>
|
|
|
- <result property="fStltypeid" column="f_stltypeid" />
|
|
|
- <result property="fBusinessType" column="f_business_type" />
|
|
|
- <result property="fSrcTypeId" column="f_src_type_id" />
|
|
|
+ <result property="fStltypeid" column="f_stltypeid"/>
|
|
|
+ <result property="fBusinessType" column="f_business_type"/>
|
|
|
+ <result property="fSrcTypeId" column="f_src_type_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTWarehousebillsfeesVo">
|
|
|
- select f_id, f_pid, f_lineno, f_corpid, f_feeid, f_feeUnitid, f_qty, f_unitprice, f_amount, f_currency, f_exrate, f_taxrate, f_dc, f_billstatus, f_review_date, f_statement_no, f_accamount, f_stlamount, f_accamount_date, f_invnos, f_invamount, f_stlamount_no, f_askamount, f_status, f_stlamount_date, del_flag, create_by, create_time, update_by, update_time, remark, src_id, src_bill_no, f_mblno, f_product_name, f_marks, f_chargedate, f_billing_deadline, f_inventory_days, f_amt, f_billing_days, f_billing_qty, f_billtype, f_billingway, f_bsdate, f_originalbilldate, f_stltypeid , f_business_type , f_src_type_id from t_warehousebillsfees
|
|
|
+ select f_id,
|
|
|
+ f_pid,
|
|
|
+ f_lineno,
|
|
|
+ f_corpid,
|
|
|
+ f_feeid,
|
|
|
+ f_feeUnitid,
|
|
|
+ f_qty,
|
|
|
+ f_unitprice,
|
|
|
+ f_amount,
|
|
|
+ f_currency,
|
|
|
+ f_exrate,
|
|
|
+ f_taxrate,
|
|
|
+ f_dc,
|
|
|
+ f_billstatus,
|
|
|
+ f_review_date,
|
|
|
+ f_statement_no,
|
|
|
+ f_accamount,
|
|
|
+ f_stlamount,
|
|
|
+ f_accamount_date,
|
|
|
+ f_invnos,
|
|
|
+ f_invamount,
|
|
|
+ f_stlamount_no,
|
|
|
+ f_askamount,
|
|
|
+ f_status,
|
|
|
+ f_stlamount_date,
|
|
|
+ del_flag,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time,
|
|
|
+ remark,
|
|
|
+ src_id,
|
|
|
+ src_bill_no,
|
|
|
+ f_mblno,
|
|
|
+ f_product_name,
|
|
|
+ f_marks,
|
|
|
+ f_chargedate,
|
|
|
+ f_billing_deadline,
|
|
|
+ f_inventory_days,
|
|
|
+ f_amt,
|
|
|
+ f_billing_days,
|
|
|
+ f_billing_qty,
|
|
|
+ f_billtype,
|
|
|
+ f_billingway,
|
|
|
+ f_bsdate,
|
|
|
+ f_originalbilldate,
|
|
|
+ f_stltypeid,
|
|
|
+ f_business_type,
|
|
|
+ f_src_type_id
|
|
|
+ from t_warehousebillsfees
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees" resultMap="TWarehousebillsfeesResult">
|
|
|
+ <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees"
|
|
|
+ resultMap="TWarehousebillsfeesResult">
|
|
|
<include refid="selectTWarehousebillsfeesVo"/>
|
|
|
<where>
|
|
|
- <if test="fPid != null "> and f_pid = #{fPid}</if>
|
|
|
- <if test="fLineno != null "> and f_lineno = #{fLineno}</if>
|
|
|
- <if test="fCorpid != null "> and f_corpid = #{fCorpid}</if>
|
|
|
- <if test="fFeeid != null "> and f_feeid = #{fFeeid}</if>
|
|
|
- <if test="fFeeunitid != null "> and f_feeUnitid = #{fFeeunitid}</if>
|
|
|
- <if test="fQty != null "> and f_qty = #{fQty}</if>
|
|
|
- <if test="fUnitprice != null "> and f_unitprice = #{fUnitprice}</if>
|
|
|
- <if test="fAmount != null "> and f_amount = #{fAmount}</if>
|
|
|
- <if test="fCurrency != null and fCurrency != ''"> and f_currency = #{fCurrency}</if>
|
|
|
- <if test="fExrate != null "> and f_exrate = #{fExrate}</if>
|
|
|
- <if test="fTaxrate != null "> and f_taxrate = #{fTaxrate}</if>
|
|
|
- <if test="fDc != null and fDc != ''"> and f_dc = #{fDc}</if>
|
|
|
- <if test="fBillstatus != null and fBillstatus != ''"> and f_billstatus = #{fBillstatus}</if>
|
|
|
- <if test="fReviewDate != null "> and f_review_date = #{fReviewDate}</if>
|
|
|
- <if test="fStatementNo != null and fStatementNo != ''"> and f_statement_no = #{fStatementNo}</if>
|
|
|
- <if test="fAccamount != null "> and f_accamount = #{fAccamount}</if>
|
|
|
- <if test="fStlamount != null "> and f_stlamount = #{fStlamount}</if>
|
|
|
- <if test="fAccamountDate != null "> and f_accamount_date = #{fAccamountDate}</if>
|
|
|
- <if test="fInvnos != null and fInvnos != ''"> and f_invnos = #{fInvnos}</if>
|
|
|
- <if test="fInvamount != null "> and f_invamount = #{fInvamount}</if>
|
|
|
- <if test="fStlamountNo != null and fStlamountNo != ''"> and f_stlamount_no = #{fStlamountNo}</if>
|
|
|
- <if test="fAskamount != null "> and f_askamount = #{fAskamount}</if>
|
|
|
- <if test="fStatus != null and fStatus != ''"> and f_status = #{fStatus}</if>
|
|
|
- <if test="fStlamountDate != null "> and f_stlamount_date = #{fStlamountDate}</if>
|
|
|
- <if test="srcId != null "> and src_id = #{srcId}</if>
|
|
|
- <if test="srcBillNo != null and srcBillNo != ''"> and src_bill_no = #{srcBillNo}</if>
|
|
|
- <if test="fMblno != null and fMblno != ''"> and f_mblno = #{fMblno}</if>
|
|
|
- <if test="fProductName != null and fProductName != ''"> and f_product_name like concat('%', #{fProductName}, '%')</if>
|
|
|
- <if test="fMarks != null and fMarks != ''"> and f_marks = #{fMarks}</if>
|
|
|
- <if test="fChargedate != null "> and f_chargedate = #{fChargedate}</if>
|
|
|
- <if test="fBillingDeadline != null "> and f_billing_deadline = #{fBillingDeadline}</if>
|
|
|
- <if test="fInventoryDays != null "> and f_inventory_days = #{fInventoryDays}</if>
|
|
|
- <if test="fAmt != null "> and f_amt = #{fAmt}</if>
|
|
|
- <if test="fBillingDays != null "> and f_billing_days = #{fBillingDays}</if>
|
|
|
- <if test="fBillingQty != null "> and f_billing_qty = #{fBillingQty}</if>
|
|
|
- <if test="fBilltype != null and fBilltype != ''"> and f_billtype = #{fBilltype}</if>
|
|
|
- <if test="fBillingway != null "> and f_billingway = #{fBillingway}</if>
|
|
|
- <if test="fBsdate != null "> and f_bsdate = #{fBsdate}</if>
|
|
|
- <if test="fOriginalbilldate != null "> and f_originalbilldate = #{fOriginalbilldate}</if>
|
|
|
- <if test="fStltypeid != null"> and f_stltypeid = #{fStltypeid},</if>
|
|
|
- <if test="fSrcTypeId != null"> and f_src_type_id = #{fSrcTypeId},</if>
|
|
|
+ <if test="fPid != null ">and f_pid = #{fPid}</if>
|
|
|
+ <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
|
|
|
+ <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
|
|
|
+ <if test="fFeeid != null ">and f_feeid = #{fFeeid}</if>
|
|
|
+ <if test="fFeeunitid != null ">and f_feeUnitid = #{fFeeunitid}</if>
|
|
|
+ <if test="fQty != null ">and f_qty = #{fQty}</if>
|
|
|
+ <if test="fUnitprice != null ">and f_unitprice = #{fUnitprice}</if>
|
|
|
+ <if test="fAmount != null ">and f_amount = #{fAmount}</if>
|
|
|
+ <if test="fCurrency != null and fCurrency != ''">and f_currency = #{fCurrency}</if>
|
|
|
+ <if test="fExrate != null ">and f_exrate = #{fExrate}</if>
|
|
|
+ <if test="fTaxrate != null ">and f_taxrate = #{fTaxrate}</if>
|
|
|
+ <if test="fDc != null and fDc != ''">and f_dc = #{fDc}</if>
|
|
|
+ <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
|
|
|
+ <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
|
|
|
+ <if test="fStatementNo != null and fStatementNo != ''">and f_statement_no = #{fStatementNo}</if>
|
|
|
+ <if test="fAccamount != null ">and f_accamount = #{fAccamount}</if>
|
|
|
+ <if test="fStlamount != null ">and f_stlamount = #{fStlamount}</if>
|
|
|
+ <if test="fAccamountDate != null ">and f_accamount_date = #{fAccamountDate}</if>
|
|
|
+ <if test="fInvnos != null and fInvnos != ''">and f_invnos = #{fInvnos}</if>
|
|
|
+ <if test="fInvamount != null ">and f_invamount = #{fInvamount}</if>
|
|
|
+ <if test="fStlamountNo != null and fStlamountNo != ''">and f_stlamount_no = #{fStlamountNo}</if>
|
|
|
+ <if test="fAskamount != null ">and f_askamount = #{fAskamount}</if>
|
|
|
+ <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
|
|
|
+ <if test="fStlamountDate != null ">and f_stlamount_date = #{fStlamountDate}</if>
|
|
|
+ <if test="srcId != null ">and src_id = #{srcId}</if>
|
|
|
+ <if test="srcBillNo != null and srcBillNo != ''">and src_bill_no = #{srcBillNo}</if>
|
|
|
+ <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
|
|
|
+ <if test="fProductName != null and fProductName != ''">and f_product_name like concat('%', #{fProductName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
|
|
|
+ <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
|
|
|
+ <if test="fBillingDeadline != null ">and f_billing_deadline = #{fBillingDeadline}</if>
|
|
|
+ <if test="fInventoryDays != null ">and f_inventory_days = #{fInventoryDays}</if>
|
|
|
+ <if test="fAmt != null ">and f_amt = #{fAmt}</if>
|
|
|
+ <if test="fBillingDays != null ">and f_billing_days = #{fBillingDays}</if>
|
|
|
+ <if test="fBillingQty != null ">and f_billing_qty = #{fBillingQty}</if>
|
|
|
+ <if test="fBilltype != null and fBilltype != ''">and f_billtype = #{fBilltype}</if>
|
|
|
+ <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
|
|
|
+ <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
|
|
|
+ <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
|
|
|
+ <if test="fStltypeid != null">and f_stltypeid = #{fStltypeid},</if>
|
|
|
+ <if test="fSrcTypeId != null">and f_src_type_id = #{fSrcTypeId},</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -114,7 +166,8 @@
|
|
|
|
|
|
<select id="selectTWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
|
|
|
select f_id, f_pid, f_billing_deadline
|
|
|
- where f_pid = #{fId} and f_billtype = 'SJCK'
|
|
|
+ where f_pid = #{fId}
|
|
|
+ and f_billtype = 'SJCK'
|
|
|
</select>
|
|
|
|
|
|
<select id="selectWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
|
|
@@ -122,33 +175,24 @@
|
|
|
where f_pid = #{fId}
|
|
|
</select>
|
|
|
<select id="selectReconciliation" resultType="java.lang.Integer">
|
|
|
- SELECT
|
|
|
- COUNT(d.f_id)
|
|
|
- FROM
|
|
|
- t_fee_do d
|
|
|
- LEFT JOIN t_fee f ON d.f_pid = f.f_id
|
|
|
- WHERE
|
|
|
- d.f_srcpid = #{fId}
|
|
|
+ SELECT COUNT(d.f_id)
|
|
|
+ FROM t_fee_do d
|
|
|
+ LEFT JOIN t_fee f ON d.f_pid = f.f_id
|
|
|
+ WHERE d.f_srcpid = #{fId}
|
|
|
AND f.f_billtype = 'DZ'
|
|
|
</select>
|
|
|
<select id="selectCharge" resultType="java.lang.Integer">
|
|
|
- SELECT
|
|
|
- COUNT(d.f_id)
|
|
|
- FROM
|
|
|
- t_fee_do d
|
|
|
- LEFT JOIN t_fee f ON d.f_pid = f.f_id
|
|
|
- WHERE
|
|
|
- d.f_srcpid = #{fId}
|
|
|
+ SELECT COUNT(d.f_id)
|
|
|
+ FROM t_fee_do d
|
|
|
+ LEFT JOIN t_fee f ON d.f_pid = f.f_id
|
|
|
+ WHERE d.f_srcpid = #{fId}
|
|
|
AND f.f_billtype = 'SF'
|
|
|
</select>
|
|
|
<select id="selectPay" resultType="java.lang.Integer">
|
|
|
- SELECT
|
|
|
- COUNT(d.f_id)
|
|
|
- FROM
|
|
|
- t_fee_do d
|
|
|
- LEFT JOIN t_fee f ON d.f_pid = f.f_id
|
|
|
- WHERE
|
|
|
- d.f_srcpid = #{fId}
|
|
|
+ SELECT COUNT(d.f_id)
|
|
|
+ FROM t_fee_do d
|
|
|
+ LEFT JOIN t_fee f ON d.f_pid = f.f_id
|
|
|
+ WHERE d.f_srcpid = #{fId}
|
|
|
AND f.f_billtype = 'FF'
|
|
|
</select>
|
|
|
|
|
@@ -313,11 +357,15 @@
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTWarehousebillsfeesById" parameterType="Long">
|
|
|
- delete from t_warehousebillsfees where f_id = #{fId}
|
|
|
+ delete
|
|
|
+ from t_warehousebillsfees
|
|
|
+ where f_id = #{fId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteByFPid" parameterType="Long">
|
|
|
- delete from t_warehousebillsfees where f_pid = #{fId}
|
|
|
+ delete
|
|
|
+ from t_warehousebillsfees
|
|
|
+ where f_pid = #{fId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTWarehousebillsfeesByIds" parameterType="String">
|
|
@@ -329,7 +377,7 @@
|
|
|
|
|
|
<update id="warehouseFeesFollowUpdate">
|
|
|
update
|
|
|
- t_warehousebillsfees
|
|
|
+ t_warehousebillsfees
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="fettle != null">f_billstatus = #{fettle},</if>
|
|
|
<if test="auditItem != null and fettle == 6">f_review_date = #{auditItem},</if>
|
|
@@ -345,28 +393,94 @@
|
|
|
<if test="map.billType == 'DZ'">
|
|
|
f_statement_no = #{map.tFee.fBillno},
|
|
|
f_accamount = f_accamount + #{map.tFeeDo.fAmt},
|
|
|
- f_accamount_date = #{map.tFee.fAccbilldate}
|
|
|
+ f_accamount_date = #{map.tFee.fAccbilldate}
|
|
|
</if>
|
|
|
/*判断撤销对账*/
|
|
|
<if test="map.billType == 'DZRevoke'">
|
|
|
- f_statement_no = #{map.tFee.fBillno},
|
|
|
+ f_statement_no = #{map.tFee.fBillno},
|
|
|
f_accamount = f_accamount - #{map.tFeeDo.fAmt},
|
|
|
f_accamount_date = #{map.tFee.fAccbilldate}
|
|
|
</if>
|
|
|
/*判断收付款*/
|
|
|
<if test="map.billType == 'DC'">
|
|
|
f_stlamount_no = #{map.tFee.fBillno},
|
|
|
- f_stlamount = f_stlamount + #{map.tFeeDo.fAmt},
|
|
|
+ f_stlamount = f_stlamount + #{map.tFeeDo.fAmt},
|
|
|
f_stlamount_date =#{map.tFee.fAccbilldate}
|
|
|
</if>
|
|
|
/*判断撤销收付款*/
|
|
|
<if test="map.billType == 'DCRevoke'">
|
|
|
f_stlamount_no = #{map.tFee.fBillno},
|
|
|
- f_stlamount = f_stlamount - #{map.tFeeDo.fAmt},
|
|
|
+ f_stlamount = f_stlamount - #{map.tFeeDo.fAmt},
|
|
|
f_stlamount_date =#{map.tFee.fAccbilldate}
|
|
|
</if>
|
|
|
</trim>
|
|
|
where f_id = #{map.tFeeDo.fSrcid}
|
|
|
</update>
|
|
|
-
|
|
|
+ <select id="selectFeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
|
|
|
+ SELECT
|
|
|
+ tw.f_id,
|
|
|
+ tw.f_pid,
|
|
|
+ tw.f_lineno,
|
|
|
+ tw.f_corpid,
|
|
|
+ tc.f_name corpName,
|
|
|
+ tw.f_feeid,
|
|
|
+ tf.f_name feeName,
|
|
|
+ tw.f_feeUnitid,
|
|
|
+ tw.f_qty,
|
|
|
+ tw.f_unitprice,
|
|
|
+ tw.f_amount,
|
|
|
+ tw.f_currency,
|
|
|
+ tw.f_exrate,
|
|
|
+ tw.f_taxrate,
|
|
|
+ tw.f_dc,
|
|
|
+ tw.f_billstatus,
|
|
|
+ tw.f_review_date,
|
|
|
+ tw.f_statement_no,
|
|
|
+ tw.f_accamount,
|
|
|
+ tw.f_stlamount,
|
|
|
+ tw.f_accamount_date,
|
|
|
+ tw.f_invnos,
|
|
|
+ tw.f_invamount,
|
|
|
+ tw.f_stlamount_no,
|
|
|
+ tw.f_askamount,
|
|
|
+ tw.f_status,
|
|
|
+ tw.f_stlamount_date,
|
|
|
+ tw.del_flag,
|
|
|
+ tw.create_by,
|
|
|
+ tw.create_time,
|
|
|
+ tw.update_by,
|
|
|
+ tw.update_time,
|
|
|
+ tw.remark,
|
|
|
+ tw.src_id,
|
|
|
+ tw.src_bill_no,
|
|
|
+ tw.f_mblno,
|
|
|
+ tw.f_product_name,
|
|
|
+ tw.f_marks,
|
|
|
+ tw.f_chargedate,
|
|
|
+ tw.f_billing_deadline,
|
|
|
+ tw.f_inventory_days,
|
|
|
+ tw.f_amt,
|
|
|
+ tw.f_billing_days,
|
|
|
+ tw.f_billing_qty,
|
|
|
+ tw.f_billtype,
|
|
|
+ tw.f_billingway,
|
|
|
+ tw.f_bsdate,
|
|
|
+ tw.f_originalbilldate,
|
|
|
+ tw.f_stltypeid,
|
|
|
+ tw.f_business_type,
|
|
|
+ tw.f_src_type_id
|
|
|
+ FROM
|
|
|
+ t_warehousebillsfees tw
|
|
|
+ LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
|
|
|
+ LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
|
|
|
+ where tw.f_pid = #{fPid}
|
|
|
+ and tw.f_billtype = 'KHDD'
|
|
|
+ <if test="fDc != null and fDc != ''">and tw.f_dc = #{fDc}</if>
|
|
|
+ </select>
|
|
|
+ <delete id="deleteFessByFPid" parameterType="object">
|
|
|
+ delete
|
|
|
+ from t_warehousebillsfees
|
|
|
+ where f_pid = #{fPid}
|
|
|
+ <if test="fDc != null and fDc != ''">and f_dc = #{fDc}</if>
|
|
|
+ </delete>
|
|
|
</mapper>
|