|
@@ -153,148 +153,242 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="fTmsaccbillsListAccamount" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
- w.f_id AS fSrcid,
|
|
|
t.id AS fSrcpid,
|
|
|
- t.corp_id AS fCorpid,
|
|
|
- c.f_name AS fName,
|
|
|
- w.fName AS fFeesName,
|
|
|
+ c1.f_name AS fName,
|
|
|
+ w.f_id AS fSrcid,
|
|
|
+ c.f_name AS fFeesName,
|
|
|
w.f_mblno AS fMblno,
|
|
|
w.f_product_name AS fProductName,
|
|
|
- w.f_bsdate AS fBsdate,
|
|
|
- t.bill_type AS fBilltype,
|
|
|
- w.f_review_date AS fReviewDate,
|
|
|
- w.f_marks AS fMarks,
|
|
|
- w.f_feeid AS fFeeid,
|
|
|
- w.f_billtype AS fBilltype,
|
|
|
- w.f_chargedate AS fChargedate,
|
|
|
- w.f_originalbilldate AS fOriginalbilldate,
|
|
|
- w.f_billing_deadline AS fBillingDeadline,
|
|
|
- w.f_billing_days AS fBillingDays,
|
|
|
- w.f_inventory_days AS fInventoryDays,
|
|
|
- f.f_name AS fFeeName,
|
|
|
- w.f_dc AS fSrcdc,
|
|
|
+ w.create_time AS createTime,
|
|
|
+ w.act_id AS actId,
|
|
|
+ dict.dict_label AS billType,
|
|
|
ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr,
|
|
|
ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
|
|
|
+ f.f_name AS fFeeName,
|
|
|
+ w.f_dc AS fSrcdc,
|
|
|
w.f_qty AS fQty,
|
|
|
- w.f_unitprice AS fUnitprice
|
|
|
+ w.f_unitprice AS fUnitprice,
|
|
|
+ w.f_amount AS fAmount,
|
|
|
+ w.f_feeUnitid AS fFeeUnitid,
|
|
|
+ t.load_date AS loadDate,
|
|
|
+ t.un_load_date AS unLoadDate
|
|
|
FROM
|
|
|
- f_tmsorderbills t
|
|
|
- LEFT JOIN t_corps c ON c.f_id = t.corp_id
|
|
|
- LEFT JOIN f_tmsorderbillscars car ON car.p_id = t.id
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- f.f_id,
|
|
|
- f.f_pid,
|
|
|
- f.act_id,
|
|
|
- f.org_id,
|
|
|
- f.f_lineno,
|
|
|
- f.f_corpid,
|
|
|
- f.f_feeid,
|
|
|
- f.f_feeUnitid,
|
|
|
- f.f_qty,
|
|
|
- f.f_unitprice,
|
|
|
- f.f_amount,
|
|
|
- f.f_currency,
|
|
|
- f.f_exrate,
|
|
|
- f.f_taxrate,
|
|
|
- f.f_dc,
|
|
|
- f.f_review_date,
|
|
|
- f.f_billstatus,
|
|
|
- f.f_statement_no,
|
|
|
- f.f_accamount,
|
|
|
- f.f_accamount_date,
|
|
|
- f.f_stlamount_no,
|
|
|
- f.f_stlamount,
|
|
|
- f.f_stlamount_date,
|
|
|
- f.f_invnos,
|
|
|
- f.f_invamount,
|
|
|
- f.f_askamount,
|
|
|
- f.f_status,
|
|
|
- f.del_flag,
|
|
|
- f.create_by,
|
|
|
- f.update_by,
|
|
|
- f.create_time,
|
|
|
- f.update_time,
|
|
|
- f.remark,
|
|
|
- f.src_id,
|
|
|
- f.src_bill_no,
|
|
|
- f.f_mblno,
|
|
|
- f.f_product_name,
|
|
|
- f.f_marks,
|
|
|
- f.f_chargedate,
|
|
|
- f.f_billing_deadline,
|
|
|
- f.f_inventory_days,
|
|
|
- f.f_amt,
|
|
|
- f.f_billing_days,
|
|
|
- f.f_billing_qty,
|
|
|
- f.f_billtype,
|
|
|
- f.f_billingway,
|
|
|
- f.f_bsdate,
|
|
|
- f.f_originalbilldate,
|
|
|
- f.f_stltypeid,
|
|
|
- f.remarks,
|
|
|
- c.f_id AS fId,
|
|
|
- c.f_name AS fName
|
|
|
- FROM
|
|
|
- f_tmsorderbillsfees AS f
|
|
|
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
|
|
|
- ) w ON w.f_pid = car.id
|
|
|
+ f_tmsorderbillsfees w
|
|
|
LEFT JOIN t_fees f ON w.f_feeid = f.f_id
|
|
|
- LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
|
|
|
+ LEFT JOIN t_corps AS c ON w.f_corpid = c.f_id
|
|
|
+ LEFT JOIN f_tmsorderbills AS t ON w.org_id = t.id
|
|
|
+ LEFT JOIN t_corps AS c1 ON t.corp_id = c1.f_id
|
|
|
+ LEFT JOIN sys_dict_data dict ON dict.dict_value = t.bill_type
|
|
|
<where>
|
|
|
dict.status = '0'
|
|
|
- AND dict.dict_type = 'data_unitfees'
|
|
|
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and t.corp_id = #{map.tWareHouseFees.fCorpid} </if>
|
|
|
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid = #{map.tWareHouseFees.fToCorpid} </if>
|
|
|
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like concat('%', #{map.tWareHouseFees.fMblno}, '%') </if>
|
|
|
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%') </if>
|
|
|
+ AND dict.dict_type = 'data_billType'
|
|
|
+ <if test="fCorpid != null and fCorpid != ''">and t.corp_id = #{ fCorpid} </if>
|
|
|
+ <if test="fToCorpid != null and fToCorpid != ''">and w.f_corpid = #{ fToCorpid} </if>
|
|
|
+ <if test="fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{ fMblno}, '%') </if>
|
|
|
+ <if test="fStatementNo != null and fStatementNo != ''">and w.f_statement_no like concat('%', #{ fStatementNo}, '%') </if>
|
|
|
|
|
|
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
|
|
|
+ <if test='fReconciliation != null and fReconciliation != "" and fReconciliation == "1" '>
|
|
|
and w.f_accamount_date IS NOT NULL
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
|
|
|
+ <if test=' fReconciliation != null and fReconciliation != "" and fReconciliation == "0" '>
|
|
|
and w.f_accamount_date IS NULL
|
|
|
</if>
|
|
|
|
|
|
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
|
|
|
- and w.f_dc = #{map.tWareHouseFees.fDc}
|
|
|
+ <if test=' fDc != null and fDc != "" and fDc == "D" '>
|
|
|
+ and w.f_dc = #{ fDc}
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
|
|
|
- and w.f_dc = #{map.tWareHouseFees.fDc}
|
|
|
+ <if test=' fDc != null and fDc != "" and fDc == "C" '>
|
|
|
+ and w.f_dc = #{ fDc}
|
|
|
</if>
|
|
|
- <if test="map.tWareHouseFees.fFeeid != null and map.tWareHouseFees.fFeeid != '' ">
|
|
|
+ <if test=" fFeeid != null and fFeeid != '' ">
|
|
|
and w.f_feeid in
|
|
|
- <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ <foreach collection=" fFeeid" item="id" index="index" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
|
|
|
- and w.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
|
|
|
+ <if test=' timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
|
|
|
+ and w.f_review_date >= #{ timeExamine[0]}
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
|
|
|
- and w.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
|
|
|
+ <if test=' timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
|
|
|
+ and w.f_review_date <= #{ timeExamine[1]}
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
|
|
|
- and t.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
|
|
|
+ <if test=' timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
|
|
|
+ and t.f_bsdate >= #{ timeInterval[0]}
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
|
|
|
- and t.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
|
|
|
+ <if test=' timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
|
|
|
+ and t.f_bsdate <= #{ timeInterval[1]}
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
|
|
|
- and w.f_accamount_date >= #{map.tWareHouseFees.timeReconci[0]}
|
|
|
+ <if test=' timeReconci != null and timeReconci[0] != null and timeReconci[0]!= ""'>
|
|
|
+ and w.f_accamount_date >= #{ timeReconci[0]}
|
|
|
</if>
|
|
|
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
|
|
|
- and w.f_accamount_date <= #{map.tWareHouseFees.timeReconci[1]}
|
|
|
+ <if test=' timeReconci != null and timeReconci[1] != null and timeReconci[1]!= ""'>
|
|
|
+ and w.f_accamount_date <= #{ timeReconci[1]}
|
|
|
</if>
|
|
|
- <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
|
|
|
+ <if test=" fBusinessType != null and fBusinessType != '' ">
|
|
|
and w.f_business_type in
|
|
|
- <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
|
|
|
+ <foreach collection=" fBusinessType" item="id" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- and w.f_review_date IS NOT NULL
|
|
|
and ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) != 0
|
|
|
GROUP BY w.f_id
|
|
|
</where>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="fTmsaccbillsList" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ w.f_id AS fSrcid,
|
|
|
+ t.id AS fSrcpid,
|
|
|
+ t.corp_id AS fCorpid,
|
|
|
+ c.f_name AS fName,
|
|
|
+ w.fName AS fFeesName,
|
|
|
+ w.f_mblno AS fMblno,
|
|
|
+ w.f_product_name AS fProductName,
|
|
|
+ w.f_bsdate AS fBsdate,
|
|
|
+ t.bill_type AS fBilltype,
|
|
|
+ w.f_review_date AS fReviewDate,
|
|
|
+ w.f_marks AS fMarks,
|
|
|
+ w.f_feeid AS fFeeid,
|
|
|
+ w.f_billtype AS fBilltype,
|
|
|
+ w.f_chargedate AS fChargedate,
|
|
|
+ w.f_originalbilldate AS fOriginalbilldate,
|
|
|
+ w.f_billing_deadline AS fBillingDeadline,
|
|
|
+ f.f_name AS fFeeName,
|
|
|
+ w.f_dc AS fSrcdc,
|
|
|
+ ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
|
|
|
+ ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt,
|
|
|
+ w.f_qty AS fQty,
|
|
|
+ w.f_unitprice AS fUnitprice
|
|
|
+ FROM
|
|
|
+ f_tmsorderbills t
|
|
|
+ LEFT JOIN t_corps c ON c.f_id = t.corp_id
|
|
|
+ LEFT JOIN f_tmsorderbillscars car ON car.p_id = t.id
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ f.f_id,
|
|
|
+ f.f_pid,
|
|
|
+ f.act_id,
|
|
|
+ f.org_id,
|
|
|
+ f.f_lineno,
|
|
|
+ f.f_corpid,
|
|
|
+ f.f_feeid,
|
|
|
+ f.f_feeUnitid,
|
|
|
+ f.f_qty,
|
|
|
+ f.f_unitprice,
|
|
|
+ f.f_amount,
|
|
|
+ f.f_currency,
|
|
|
+ f.f_exrate,
|
|
|
+ f.f_taxrate,
|
|
|
+ f.f_dc,
|
|
|
+ f.f_review_date,
|
|
|
+ f.f_billstatus,
|
|
|
+ f.f_statement_no,
|
|
|
+ f.f_accamount,
|
|
|
+ f.f_accamount_date,
|
|
|
+ f.f_stlamount_no,
|
|
|
+ f.f_stlamount,
|
|
|
+ f.f_stlamount_date,
|
|
|
+ f.f_invnos,
|
|
|
+ f.f_invamount,
|
|
|
+ f.f_askamount,
|
|
|
+ f.f_status,
|
|
|
+ f.del_flag,
|
|
|
+ f.create_by,
|
|
|
+ f.update_by,
|
|
|
+ f.create_time,
|
|
|
+ f.update_time,
|
|
|
+ f.remark,
|
|
|
+ f.src_id,
|
|
|
+ f.src_bill_no,
|
|
|
+ f.f_mblno,
|
|
|
+ f.f_product_name,
|
|
|
+ f.f_marks,
|
|
|
+ f.f_chargedate,
|
|
|
+ f.f_billing_deadline,
|
|
|
+ f.f_inventory_days,
|
|
|
+ f.f_amt,
|
|
|
+ f.f_billing_days,
|
|
|
+ f.f_billing_qty,
|
|
|
+ f.f_billtype,
|
|
|
+ f.f_billingway,
|
|
|
+ f.f_bsdate,
|
|
|
+ f.f_originalbilldate,
|
|
|
+ f.f_stltypeid,
|
|
|
+ f.remarks,
|
|
|
+ c.f_id AS fId,
|
|
|
+ c.f_name AS fName
|
|
|
+ FROM
|
|
|
+ f_tmsorderbillsfees AS f
|
|
|
+ LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
|
|
|
+ ) w ON w.f_pid = car.id
|
|
|
+ LEFT JOIN t_fees f ON w.f_feeid = f.f_id
|
|
|
+ LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
|
|
|
+ <where>
|
|
|
+ dict.status = '0'
|
|
|
+ AND dict.dict_type = 'data_unitfees'
|
|
|
+ <if test=" fCorpid != null and fCorpid != ''">and t.corp_id = #{ fCorpid} </if>
|
|
|
+ <if test=" fToCorpid != null and fToCorpid != ''">and w.f_corpid = #{ fToCorpid} </if>
|
|
|
+ <if test=" fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{ fMblno}, '%') </if>
|
|
|
+ <if test=" fStatementNo != null and fStatementNo != ''">and w.f_statement_no like concat('%', #{ fStatementNo}, '%') </if>
|
|
|
+
|
|
|
+ <if test=' fReconciliation != null and fReconciliation != "" and fReconciliation == "1" '>
|
|
|
+ and w.f_accamount_date IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test=' fReconciliation != null and fReconciliation != "" and fReconciliation == "0" '>
|
|
|
+ and w.f_accamount_date IS NULL
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test=' fDc != null and fDc != "" and fDc == "D" '>
|
|
|
+ and w.f_dc = #{ fDc}
|
|
|
+ </if>
|
|
|
+ <if test=' fDc != null and fDc != "" and fDc == "C" '>
|
|
|
+ and w.f_dc = #{ fDc}
|
|
|
+ </if>
|
|
|
+ <if test=" fFeeid != null and fFeeid != '' ">
|
|
|
+ and w.f_feeid in
|
|
|
+ <foreach collection=" fFeeid" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test=' timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
|
|
|
+ and w.f_review_date >= #{ timeExamine[0]}
|
|
|
+ </if>
|
|
|
+ <if test=' timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
|
|
|
+ and w.f_review_date <= #{ timeExamine[1]}
|
|
|
+ </if>
|
|
|
+ <if test=' timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
|
|
|
+ and t.f_bsdate >= #{ timeInterval[0]}
|
|
|
+ </if>
|
|
|
+ <if test=' timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
|
|
|
+ and t.f_bsdate <= #{ timeInterval[1]}
|
|
|
+ </if>
|
|
|
+ <if test=' timeReconci != null and timeReconci[0] != null and timeReconci[0]!= ""'>
|
|
|
+ and w.f_stlamount_date >= #{ timeReconci[0]}
|
|
|
+ </if>
|
|
|
+ <if test=' timeReconci != null and timeReconci[1] != null and timeReconci[1]!= ""'>
|
|
|
+ and w.f_stlamount_date <= #{ timeReconci[1]}
|
|
|
+ </if>
|
|
|
+ and w.f_review_date IS NOT NULL
|
|
|
+ and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
|
|
|
+ GROUP BY w.f_id
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="selectFTmsaccbillsMapList" resultType="java.util.Map">
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="accYear != null "> and acc_year = #{accYear}</if>
|
|
|
+ <if test="accMonth != null "> and acc_month = #{accMonth}</if>
|
|
|
+ <if test="actId != null "> and act_id = #{actId}</if>
|
|
|
+ <if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
|
|
+ <if test="corpId != null "> and corp_id = #{corpId}</if>
|
|
|
+ <if test="transactId != null "> and transact_id = #{transactId}</if>
|
|
|
+ <if test="fromDate != null "> and from_date = #{fromDate}</if>
|
|
|
+ <if test="toDate != null "> and to_date = #{toDate}</if>
|
|
|
+ <if test="amt != null "> and amt = #{amt}</if>
|
|
|
+ <if test="refNo != null and refNo != ''"> and ref_no = #{refNo}</if>
|
|
|
+ <if test="postDate != null "> and post_date = #{postDate}</if>
|
|
|
+ <if test="billStatus != null "> and bill_status = #{billStatus}</if>
|
|
|
+ <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|