|
@@ -175,27 +175,31 @@
|
|
|
t.acc_date,
|
|
t.acc_date,
|
|
|
t.rec_status,
|
|
t.rec_status,
|
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
|
|
|
|
|
+ sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "biznisTypeName",
|
|
|
t.amt_rec,
|
|
t.amt_rec,
|
|
|
t.amt_pay,
|
|
t.amt_pay,
|
|
|
t.amt_should,
|
|
t.amt_should,
|
|
|
t.amt_handle,
|
|
t.amt_handle,
|
|
|
t.amt_waive,
|
|
t.amt_waive,
|
|
|
- 0 as amt_residue,
|
|
|
|
|
|
|
+ t.amt_residue as "amtReceivableHandle",
|
|
|
|
|
+ t.amt_residue,
|
|
|
t.remarks,
|
|
t.remarks,
|
|
|
t.make_staff,
|
|
t.make_staff,
|
|
|
t.make_time,
|
|
t.make_time,
|
|
|
t.flg_valid,
|
|
t.flg_valid,
|
|
|
- t.cp_id,
|
|
|
|
|
- t.amt_residue as "amtReceivableHandle"
|
|
|
|
|
|
|
+ t.cp_id
|
|
|
FROM dkic_b.t_mac_account_item as t
|
|
FROM dkic_b.t_mac_account_item as t
|
|
|
|
|
+ left join dkic_b.t_psi_outbound as tpo on tpo.out_id = t.biznis_id and t.biznis_type = 't_psi_outbound'
|
|
|
|
|
+ LEFT JOIN sys.t_data_kind tdk2 ON tdk2.kind_code = tpo.out_type
|
|
|
left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
|
|
left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
|
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
left join sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
|
|
left join sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
|
|
|
where t.flg_valid
|
|
where t.flg_valid
|
|
|
and t.acc_item_type = '账款类型-应收'
|
|
and t.acc_item_type = '账款类型-应收'
|
|
|
- and t.amt_residue > 0
|
|
|
|
|
|
|
+ and t.amt_residue <![CDATA[ <> ]]> 0
|
|
|
<include refid="Condition"/>
|
|
<include refid="Condition"/>
|
|
|
|
|
+ order by t.acc_date
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
</if>
|
|
@@ -204,43 +208,48 @@
|
|
|
<!-- 查询应付账款明细 -->
|
|
<!-- 查询应付账款明细 -->
|
|
|
<select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
|
|
<select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
|
|
|
SELECT t.item_id,
|
|
SELECT t.item_id,
|
|
|
- t.item_id as "accItemId",
|
|
|
|
|
|
|
+ t.item_id as "accItemId",
|
|
|
t.acc_item_type,
|
|
t.acc_item_type,
|
|
|
t.object_id,
|
|
t.object_id,
|
|
|
- tms.sup_code as "supCode",
|
|
|
|
|
- tms.sup_name as "supName",
|
|
|
|
|
- tms.contact_phone as "contactPhone",
|
|
|
|
|
- tms.return_address as "returnAddress",
|
|
|
|
|
|
|
+ supplier.sup_code as "supCode",
|
|
|
|
|
+ supplier.sup_name as "supName",
|
|
|
|
|
+ supplier.contact_phone as "contactPhone",
|
|
|
|
|
+ supplier.return_address as "returnAddress",
|
|
|
t.org_id,
|
|
t.org_id,
|
|
|
- tmo.org_name as "orgName",
|
|
|
|
|
|
|
+ tmo.org_name as "orgName",
|
|
|
t.staff_id,
|
|
t.staff_id,
|
|
|
- tms.staff_name as "staffName",
|
|
|
|
|
|
|
+ tms.staff_name as "staffName",
|
|
|
t.biznis_type,
|
|
t.biznis_type,
|
|
|
t.biznis_id,
|
|
t.biznis_id,
|
|
|
t.biznis_no,
|
|
t.biznis_no,
|
|
|
t.acc_date,
|
|
t.acc_date,
|
|
|
t.rec_status,
|
|
t.rec_status,
|
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
|
|
|
|
|
+ sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "biznisTypeName",
|
|
|
t.amt_rec,
|
|
t.amt_rec,
|
|
|
t.amt_pay,
|
|
t.amt_pay,
|
|
|
t.amt_should,
|
|
t.amt_should,
|
|
|
t.amt_handle,
|
|
t.amt_handle,
|
|
|
t.amt_waive,
|
|
t.amt_waive,
|
|
|
t.amt_residue,
|
|
t.amt_residue,
|
|
|
|
|
+ t.amt_residue as "amtPayableHandle",
|
|
|
t.remarks,
|
|
t.remarks,
|
|
|
t.make_staff,
|
|
t.make_staff,
|
|
|
t.make_time,
|
|
t.make_time,
|
|
|
t.flg_valid,
|
|
t.flg_valid,
|
|
|
t.cp_id
|
|
t.cp_id
|
|
|
FROM dkic_b.t_mac_account_item as t
|
|
FROM dkic_b.t_mac_account_item as t
|
|
|
- left join dkic_b.t_mst_supplier tms on tms.sup_id = t.object_id
|
|
|
|
|
|
|
+ left join dkic_b.t_psi_inbound as tpi on tpi.into_id = t.biznis_id and t.biznis_type = 't_psi_inbound'
|
|
|
|
|
+ LEFT JOIN sys.t_data_kind tdk2 ON tdk2.kind_code = tpi.into_type
|
|
|
|
|
+ left join dkic_b.t_mst_supplier supplier on supplier.sup_id = t.object_id
|
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
left join sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
|
|
left join sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
|
|
|
where t.flg_valid
|
|
where t.flg_valid
|
|
|
and t.acc_item_type = '账款类型-应付'
|
|
and t.acc_item_type = '账款类型-应付'
|
|
|
- and t.amt_residue > 0
|
|
|
|
|
|
|
+ and t.amt_residue <![CDATA[ <> ]]> 0
|
|
|
<include refid="Condition"/>
|
|
<include refid="Condition"/>
|
|
|
|
|
+ order by t.acc_date
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
</if>
|