|
|
@@ -130,24 +130,44 @@
|
|
|
</foreach>
|
|
|
</sql>
|
|
|
|
|
|
- <!-- 查询表t_mac_account_item,(条件查询+分页)列表 -->
|
|
|
- <select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
|
|
|
+ <!-- 根据主键查询表t_mac_account_item的一行数据 -->
|
|
|
+ <select id="selectByCond" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM dkic_b.t_mac_account_item as t
|
|
|
+ where 1 = 1
|
|
|
+ <include refid="Condition"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询表t_mac_account_item,(条件查询)个数 -->
|
|
|
+ <select id="countByCond" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_mac_account_item as t
|
|
|
+ where 1 = 1
|
|
|
+ <include refid="Condition"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询应收账款明细 -->
|
|
|
+ <select id="getReceivableAccountItem" resultMap="BaseResultMapResponse">
|
|
|
SELECT t.item_id,
|
|
|
t.acc_item_type,
|
|
|
t.object_id,
|
|
|
- tms.sup_code as "supCode",
|
|
|
- tms.sup_name as "supName",
|
|
|
- tms.contact_phone as "contactPhone",
|
|
|
- tms.return_address as "returnAddress",
|
|
|
+ tmc.cus_code as "cusCode",
|
|
|
+ tmc.cus_name as "cusName",
|
|
|
+ tmc.cus_phone as "cusPhone",
|
|
|
+ tmc.address_full as "addressFull",
|
|
|
t.org_id,
|
|
|
- tmo.org_name as "orgName",
|
|
|
+ tmo.org_name as "orgName",
|
|
|
t.staff_id,
|
|
|
- tms.staff_name as "staffName",
|
|
|
+ tms.staff_name as "staffName",
|
|
|
t.biznis_type,
|
|
|
t.biznis_id,
|
|
|
t.biznis_no,
|
|
|
t.acc_date,
|
|
|
t.rec_status,
|
|
|
+ sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
|
|
|
t.amt_rec,
|
|
|
t.amt_pay,
|
|
|
t.amt_should,
|
|
|
@@ -160,35 +180,38 @@
|
|
|
t.flg_valid,
|
|
|
t.cp_id
|
|
|
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_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_staff tms on tms.staff_id = t.staff_id
|
|
|
+ left join sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
|
|
|
where t.flg_valid
|
|
|
- and t.acc_item_type = '账款类型-应付'
|
|
|
+ and t.acc_item_type = '账款类型-应收'
|
|
|
+ and t.amt_residue > 0
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <!-- 查询表t_mac_account_item,(条件查询+分页)列表 -->
|
|
|
- <select id="selectByCond" resultMap="BaseResultMapResponse">
|
|
|
+ <!-- 查询应付账款明细 -->
|
|
|
+ <select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
|
|
|
SELECT t.item_id,
|
|
|
t.acc_item_type,
|
|
|
t.object_id,
|
|
|
- tmc.cus_code as "cusCode",
|
|
|
- tmc.cus_name as "cusName",
|
|
|
- tmc.cus_phone as "cusPhone",
|
|
|
- tmc.address_full as "addressFull",
|
|
|
+ tms.sup_code as "supCode",
|
|
|
+ tms.sup_name as "supName",
|
|
|
+ tms.contact_phone as "contactPhone",
|
|
|
+ tms.return_address as "returnAddress",
|
|
|
t.org_id,
|
|
|
- tmo.org_name as "orgName",
|
|
|
+ tmo.org_name as "orgName",
|
|
|
t.staff_id,
|
|
|
- tms.staff_name as "staffName",
|
|
|
+ tms.staff_name as "staffName",
|
|
|
t.biznis_type,
|
|
|
t.biznis_id,
|
|
|
t.biznis_no,
|
|
|
t.acc_date,
|
|
|
t.rec_status,
|
|
|
+ sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "recStatusName",
|
|
|
t.amt_rec,
|
|
|
t.amt_pay,
|
|
|
t.amt_should,
|
|
|
@@ -201,25 +224,19 @@
|
|
|
t.flg_valid,
|
|
|
t.cp_id
|
|
|
FROM dkic_b.t_mac_account_item as t
|
|
|
- left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
|
|
|
+ left join dkic_b.t_mst_supplier tms on tms.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_staff tms on tms.staff_id = t.staff_id
|
|
|
+ left join sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
|
|
|
where t.flg_valid
|
|
|
- and t.acc_item_type = '账款类型-应收'
|
|
|
+ and t.acc_item_type = '账款类型-应付'
|
|
|
+ and t.amt_residue > 0
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <!-- 查询表t_mac_account_item,(条件查询)个数 -->
|
|
|
- <select id="countByCond" resultType="Long">
|
|
|
- SELECT
|
|
|
- count(1)
|
|
|
- FROM dkic_b.t_mac_account_item
|
|
|
- where 1=1
|
|
|
- <include refid="Condition"/>
|
|
|
- </select>
|
|
|
|
|
|
<!-- 根据主键查询表t_mac_account_item的一行数据 -->
|
|
|
<select id="selectById" resultMap="BaseResultMap">
|