|
@@ -217,7 +217,8 @@
|
|
|
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
|
|
|
+ ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt,
|
|
|
+ dictIn.dict_label AS fBusinessType
|
|
|
FROM
|
|
|
t_warehousebills t
|
|
|
LEFT JOIN t_corps c ON c.f_id = t.f_corpid
|
|
@@ -257,6 +258,8 @@
|
|
|
f.f_marks,
|
|
|
f.f_billing_deadline,
|
|
|
f.f_originalbilldate,
|
|
|
+ f.f_billtype,
|
|
|
+ f.f_business_type,
|
|
|
c.f_id AS fId,
|
|
|
c.f_name AS fName
|
|
|
FROM
|
|
@@ -264,6 +267,7 @@
|
|
|
LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
|
|
|
) w ON w.f_pid = t.f_id
|
|
|
LEFT JOIN t_fees f ON w.f_feeid = f.f_id
|
|
|
+ LEFT JOIN sys_dict_data dictIn ON dictIn.dict_value = w.f_business_type
|
|
|
<where>
|
|
|
<if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and t.f_corpid = #{map.tWareHouseFees.fCorpid} </if>
|
|
|
<if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid = #{map.tWareHouseFees.fToCorpid} </if>
|
|
@@ -307,6 +311,34 @@
|
|
|
<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>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJRK'">
|
|
|
+ and w.f_billtype = #{map.tWareHouseFees.fBilltype}
|
|
|
+ AND dictIn.dict_type = 'st_in_type'
|
|
|
+ AND dictIn.status = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJCK'">
|
|
|
+ and w.f_billtype = #{map.tWareHouseFees.fBilltype}
|
|
|
+ AND dictIn.dict_type = 'st_out_type'
|
|
|
+ AND dictIn.status = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'HQZY'">
|
|
|
+ and w.f_billtype = #{map.tWareHouseFees.fBilltype}
|
|
|
+ AND dictIn.dict_type = 'st_trans_type'
|
|
|
+ AND dictIn.status = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
|
|
|
+ and w.f_business_type in
|
|
|
+ <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
and t.f_review_date IS NOT NULL
|
|
|
and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) > 0
|
|
|
</where>
|
|
@@ -339,7 +371,8 @@
|
|
|
ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
|
|
|
dict.dict_label AS fFeeunitid,
|
|
|
w.f_qty AS fQty ,
|
|
|
- w.f_unitprice AS fUnitprice
|
|
|
+ w.f_unitprice AS fUnitprice ,
|
|
|
+ dictIn.dict_label AS fBusinessType
|
|
|
FROM
|
|
|
t_warehousebills t
|
|
|
LEFT JOIN t_corps c ON c.f_id = t.f_corpid
|
|
@@ -380,6 +413,7 @@
|
|
|
f.src_bill_no,
|
|
|
f.f_billtype,
|
|
|
f.f_marks,
|
|
|
+ f.f_business_type,
|
|
|
c.f_id AS fId,
|
|
|
c.f_name AS fName
|
|
|
FROM
|
|
@@ -388,6 +422,7 @@
|
|
|
) w ON w.f_pid = t.f_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
|
|
|
+ LEFT JOIN sys_dict_data dictIn ON dictIn.dict_value = w.f_business_type
|
|
|
<where>
|
|
|
dict.status = '0'
|
|
|
AND dict.dict_type = 'data_unitfees'
|
|
@@ -433,6 +468,32 @@
|
|
|
<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>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJRK'">
|
|
|
+ and w.f_billtype = #{map.tWareHouseFees.fBilltype}
|
|
|
+ AND dictIn.dict_type = 'st_in_type'
|
|
|
+ AND dictIn.status = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJCK'">
|
|
|
+ and w.f_billtype = #{map.tWareHouseFees.fBilltype}
|
|
|
+ AND dictIn.dict_type = 'st_out_type'
|
|
|
+ AND dictIn.status = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'HQZY'">
|
|
|
+ and w.f_billtype = #{map.tWareHouseFees.fBilltype}
|
|
|
+ AND dictIn.dict_type = 'st_trans_type'
|
|
|
+ AND dictIn.status = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
|
|
|
+ and w.f_business_type in
|
|
|
+ <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
and t.f_review_date IS NOT NULL
|
|
|
and ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) > 0
|
|
|
</where>
|