|
@@ -5,128 +5,132 @@
|
|
|
<!-- 通用设置 -->
|
|
<!-- 通用设置 -->
|
|
|
<!-- 通用查询列 -->
|
|
<!-- 通用查询列 -->
|
|
|
<sql id="Base_Column_List">
|
|
<sql id="Base_Column_List">
|
|
|
- item_id, acc_item_type, object_id, org_id, staff_id, biznis_type, biznis_id, biznis_no, acc_date, rec_status, amt_rec, amt_pay, amt_should, amt_handle, amt_waive, amt_residue, remarks, make_staff, make_time, flg_valid, cp_id
|
|
|
|
|
|
|
+ item_id
|
|
|
|
|
+ , acc_item_type, object_id, org_id, staff_id, biznis_type, biznis_id, biznis_no, acc_date, rec_status, amt_rec, amt_pay, amt_should, amt_handle, amt_waive, amt_residue, remarks, make_staff, make_time, flg_valid, cp_id
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mac.AccountItem">
|
|
<resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mac.AccountItem">
|
|
|
<id column="item_id" property="itemId"/>
|
|
<id column="item_id" property="itemId"/>
|
|
|
- <result column="acc_item_type" property="accItemType"/>
|
|
|
|
|
- <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="biznis_type" property="biznisType"/>
|
|
|
|
|
- <result column="biznis_id" property="biznisId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="biznis_no" property="biznisNo"/>
|
|
|
|
|
- <result column="acc_date" property="accDate" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
- <result column="rec_status" property="recStatus"/>
|
|
|
|
|
- <result column="amt_rec" property="amtRec"/>
|
|
|
|
|
- <result column="amt_pay" property="amtPay"/>
|
|
|
|
|
- <result column="amt_should" property="amtShould"/>
|
|
|
|
|
- <result column="amt_handle" property="amtHandle"/>
|
|
|
|
|
- <result column="amt_waive" property="amtWaive"/>
|
|
|
|
|
- <result column="amt_residue" property="amtResidue"/>
|
|
|
|
|
- <result column="remarks" property="remarks"/>
|
|
|
|
|
- <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
- <result column="flg_valid" property="flgValid"/>
|
|
|
|
|
- <result column="cp_id" property="cpId"/>
|
|
|
|
|
|
|
+ <result column="acc_item_type" property="accItemType"/>
|
|
|
|
|
+ <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="biznis_type" property="biznisType"/>
|
|
|
|
|
+ <result column="biznis_id" property="biznisId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="biznis_no" property="biznisNo"/>
|
|
|
|
|
+ <result column="acc_date" property="accDate" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
+ <result column="rec_status" property="recStatus"/>
|
|
|
|
|
+ <result column="amt_rec" property="amtRec"/>
|
|
|
|
|
+ <result column="amt_pay" property="amtPay"/>
|
|
|
|
|
+ <result column="amt_should" property="amtShould"/>
|
|
|
|
|
+ <result column="amt_handle" property="amtHandle"/>
|
|
|
|
|
+ <result column="amt_waive" property="amtWaive"/>
|
|
|
|
|
+ <result column="amt_residue" property="amtResidue"/>
|
|
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
|
|
+ <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.mac.AccountItemResponse">
|
|
<resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.mac.AccountItemResponse">
|
|
|
<id column="item_id" property="itemId"/>
|
|
<id column="item_id" property="itemId"/>
|
|
|
- <result column="acc_item_type" property="accItemType"/>
|
|
|
|
|
- <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="biznis_type" property="biznisType"/>
|
|
|
|
|
- <result column="biznis_id" property="biznisId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="biznis_no" property="biznisNo"/>
|
|
|
|
|
- <result column="acc_date" property="accDate" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
- <result column="rec_status" property="recStatus"/>
|
|
|
|
|
- <result column="amt_rec" property="amtRec"/>
|
|
|
|
|
- <result column="amt_pay" property="amtPay"/>
|
|
|
|
|
- <result column="amt_should" property="amtShould"/>
|
|
|
|
|
- <result column="amt_handle" property="amtHandle"/>
|
|
|
|
|
- <result column="amt_waive" property="amtWaive"/>
|
|
|
|
|
- <result column="amt_residue" property="amtResidue"/>
|
|
|
|
|
- <result column="remarks" property="remarks"/>
|
|
|
|
|
- <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
- <result column="flg_valid" property="flgValid"/>
|
|
|
|
|
- <result column="cp_id" property="cpId"/>
|
|
|
|
|
|
|
+ <result column="acc_item_type" property="accItemType"/>
|
|
|
|
|
+ <result column="object_id" property="objectId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="biznis_type" property="biznisType"/>
|
|
|
|
|
+ <result column="biznis_id" property="biznisId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="biznis_no" property="biznisNo"/>
|
|
|
|
|
+ <result column="acc_date" property="accDate" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
+ <result column="rec_status" property="recStatus"/>
|
|
|
|
|
+ <result column="amt_rec" property="amtRec"/>
|
|
|
|
|
+ <result column="amt_pay" property="amtPay"/>
|
|
|
|
|
+ <result column="amt_should" property="amtShould"/>
|
|
|
|
|
+ <result column="amt_handle" property="amtHandle"/>
|
|
|
|
|
+ <result column="amt_waive" property="amtWaive"/>
|
|
|
|
|
+ <result column="amt_residue" property="amtResidue"/>
|
|
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
|
|
+ <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
<!-- 通用条件列 -->
|
|
|
<sql id="Condition">
|
|
<sql id="Condition">
|
|
|
- <if test="accItemType != null and accItemType != ''">
|
|
|
|
|
- AND t.acc_item_type = #{accItemType}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="objectId != null and objectId != ''">
|
|
|
|
|
- AND t.object_id = #{objectId}::uuid
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="orgId != null and orgId != ''">
|
|
|
|
|
- AND t.org_id = #{orgId}::uuid
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="staffId != null and staffId != ''">
|
|
|
|
|
- AND t.staff_id = #{staffId}::uuid
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="biznisType != null and biznisType != ''">
|
|
|
|
|
- AND t.biznis_type = #{biznisType}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="biznisId != null and biznisId != ''">
|
|
|
|
|
- AND t.biznis_id = #{biznisId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="biznisNo != null and biznisNo != ''">
|
|
|
|
|
- AND t.biznis_no = #{biznisNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="accDate != null">
|
|
|
|
|
- AND t.acc_date = #{accDate}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="recStatus != null and recStatus != ''">
|
|
|
|
|
- AND t.rec_status = #{recStatus}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="amtRec != null">
|
|
|
|
|
- AND t.amt_rec = #{amtRec}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="amtPay != null">
|
|
|
|
|
- AND t.amt_pay = #{amtPay}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="amtShould != null">
|
|
|
|
|
- AND t.amt_should = #{amtShould}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="amtHandle != null">
|
|
|
|
|
- AND t.amt_handle = #{amtHandle}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="amtWaive != null">
|
|
|
|
|
- AND t.amt_waive = #{amtWaive}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="amtResidueFlg != null">
|
|
|
|
|
- AND t.amt_residue > 0
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="amtResidue != null">
|
|
|
|
|
- AND t.amt_residue = #{amtResidue}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="remarks != null and remarks != ''">
|
|
|
|
|
- AND t.remarks = #{remarks}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="makeStaff != null and makeStaff != ''">
|
|
|
|
|
- AND t.make_staff = #{makeStaff}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="makeTime != null">
|
|
|
|
|
- AND t.make_time = #{makeTime}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="flgValid != null">
|
|
|
|
|
- AND t.flg_valid = #{flgValid}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="cpId != null">
|
|
|
|
|
- AND t.cp_id = #{cpId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <!-- 如果是退货,只差剩余应收小于0的 -->
|
|
|
|
|
- <if test="formType == 'refund'">
|
|
|
|
|
- AND t.amt_residue <![CDATA[ < ]]> 0
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ <if test="accItemType != null and accItemType != ''">
|
|
|
|
|
+ AND t.acc_item_type = #{accItemType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objectId != null and objectId != ''">
|
|
|
|
|
+ AND t.object_id = #{objectId}::uuid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
|
|
+ AND t.org_id = #{orgId}::uuid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="staffId != null and staffId != ''">
|
|
|
|
|
+ AND t.staff_id = #{staffId}::uuid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="biznisType != null and biznisType != ''">
|
|
|
|
|
+ AND t.biznis_type = #{biznisType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="biznisId != null and biznisId != ''">
|
|
|
|
|
+ AND t.biznis_id = #{biznisId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="biznisNo != null and biznisNo != ''">
|
|
|
|
|
+ AND t.biznis_no = #{biznisNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="accDate != null">
|
|
|
|
|
+ AND t.acc_date = #{accDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="recStatus != null and recStatus != ''">
|
|
|
|
|
+ AND t.rec_status = #{recStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtRec != null">
|
|
|
|
|
+ AND t.amt_rec = #{amtRec}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtPay != null">
|
|
|
|
|
+ AND t.amt_pay = #{amtPay}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtShould != null">
|
|
|
|
|
+ AND t.amt_should = #{amtShould}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtHandle != null">
|
|
|
|
|
+ AND t.amt_handle = #{amtHandle}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtWaive != null">
|
|
|
|
|
+ AND t.amt_waive = #{amtWaive}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtResidueFlg != null">
|
|
|
|
|
+ AND t.amt_residue > 0
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtResidueZeroFlg != null">
|
|
|
|
|
+ AND t.amt_residue != 0
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amtResidue != null">
|
|
|
|
|
+ AND t.amt_residue = #{amtResidue}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
|
|
+ AND t.remarks = #{remarks}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="makeStaff != null and makeStaff != ''">
|
|
|
|
|
+ AND t.make_staff = #{makeStaff}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="makeTime != null">
|
|
|
|
|
+ AND t.make_time = #{makeTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="flgValid != null">
|
|
|
|
|
+ AND t.flg_valid = #{flgValid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="cpId != null">
|
|
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!-- 如果是退货,只差剩余应收小于0的 -->
|
|
|
|
|
+ <if test="formType == 'refund'">
|
|
|
|
|
+ AND t.amt_residue <![CDATA[ < ]]> 0
|
|
|
|
|
+ </if>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<sql id="idsForeach">
|
|
<sql id="idsForeach">
|
|
@@ -158,17 +162,18 @@
|
|
|
<!--查询应收和收款汇总(根据制单员权限)-->
|
|
<!--查询应收和收款汇总(根据制单员权限)-->
|
|
|
<select id="getReceivableAccountSum" resultType="Map">
|
|
<select id="getReceivableAccountSum" resultType="Map">
|
|
|
SELECT SUM
|
|
SELECT SUM
|
|
|
- ( CASE WHEN tmai.acc_item_type = '账款类型-应收' THEN tmai.amt_should ELSE 0 END ) AS receivable,
|
|
|
|
|
- SUM ( CASE WHEN tmai.acc_item_type = '账款类型-收款' THEN tmai.amt_should ELSE 0 END ) AS receipt
|
|
|
|
|
|
|
+ ( CASE WHEN tmai.acc_item_type = '账款类型-应收' THEN tmai.amt_should ELSE 0 END ) AS receivable,
|
|
|
|
|
+ SUM ( CASE WHEN tmai.acc_item_type = '账款类型-收款' THEN tmai.amt_should ELSE 0 END ) AS receipt
|
|
|
FROM
|
|
FROM
|
|
|
- dkic_b.t_mac_account_item tmai
|
|
|
|
|
|
|
+ dkic_b.t_mac_account_item tmai
|
|
|
WHERE
|
|
WHERE
|
|
|
- tmai.flg_valid
|
|
|
|
|
- AND tmai.cp_id = #{cpId}
|
|
|
|
|
- AND (
|
|
|
|
|
- tmai.make_staff = #{staffId}::uuid
|
|
|
|
|
- OR EXISTS ( SELECT 1 FROM dkic_b.t_mst_staff_purview tmsp WHERE tmsp.staff_id = tmai.make_staff AND tmsp.purview_code = 'PU10000003' )
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ tmai.flg_valid
|
|
|
|
|
+ AND tmai.cp_id = #{cpId}
|
|
|
|
|
+ AND (
|
|
|
|
|
+ tmai.make_staff = #{staffId}::uuid
|
|
|
|
|
+ OR EXISTS ( SELECT 1 FROM dkic_b.t_mst_staff_purview tmsp WHERE tmsp.staff_id = tmai.make_staff AND
|
|
|
|
|
+ tmsp.purview_code = 'PU10000003' )
|
|
|
|
|
+ )
|
|
|
<!--开始日期-->
|
|
<!--开始日期-->
|
|
|
<if test="accDateStart != null">
|
|
<if test="accDateStart != null">
|
|
|
AND tmai.acc_date >= #{accDateStart,typeHandler=TimestampTypeHandler}
|
|
AND tmai.acc_date >= #{accDateStart,typeHandler=TimestampTypeHandler}
|
|
@@ -182,49 +187,49 @@
|
|
|
<!-- 查询应收账款明细 -->
|
|
<!-- 查询应收账款明细 -->
|
|
|
<select id="getReceivableAccountItem" resultMap="BaseResultMapResponse">
|
|
<select id="getReceivableAccountItem" resultMap="BaseResultMapResponse">
|
|
|
SELECT t.item_id,
|
|
SELECT t.item_id,
|
|
|
- t.item_id as "accItemId",
|
|
|
|
|
- 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",
|
|
|
|
|
- t.org_id,
|
|
|
|
|
- tmo.org_name as "orgName",
|
|
|
|
|
- t.staff_id,
|
|
|
|
|
- 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",
|
|
|
|
|
- coalesce(sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}), '其他收入') as "biznisTypeName",
|
|
|
|
|
- t.amt_rec,
|
|
|
|
|
- t.amt_pay,
|
|
|
|
|
- t.amt_should,
|
|
|
|
|
- t.amt_handle,
|
|
|
|
|
- t.amt_waive,
|
|
|
|
|
- t.amt_residue as "amtNotHandle",
|
|
|
|
|
- t.amt_residue as "amtReceivableHandle",
|
|
|
|
|
- t.amt_residue,
|
|
|
|
|
- t.remarks,
|
|
|
|
|
- t.make_staff,
|
|
|
|
|
- t.make_time,
|
|
|
|
|
- t.flg_valid,
|
|
|
|
|
- t.cp_id
|
|
|
|
|
|
|
+ t.item_id as "accItemId",
|
|
|
|
|
+ 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",
|
|
|
|
|
+ t.org_id,
|
|
|
|
|
+ tmo.org_name as "orgName",
|
|
|
|
|
+ t.staff_id,
|
|
|
|
|
+ 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",
|
|
|
|
|
+ coalesce(sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}), '其他收入') as "biznisTypeName",
|
|
|
|
|
+ t.amt_rec,
|
|
|
|
|
+ t.amt_pay,
|
|
|
|
|
+ t.amt_should,
|
|
|
|
|
+ t.amt_handle,
|
|
|
|
|
+ t.amt_waive,
|
|
|
|
|
+ t.amt_residue as "amtNotHandle",
|
|
|
|
|
+ t.amt_residue as "amtReceivableHandle",
|
|
|
|
|
+ t.amt_residue,
|
|
|
|
|
+ t.remarks,
|
|
|
|
|
+ t.make_staff,
|
|
|
|
|
+ t.make_time,
|
|
|
|
|
+ t.flg_valid,
|
|
|
|
|
+ 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_mac_other_receivable as tmor
|
|
|
|
|
- on tmor.receivable_id = t.biznis_id and t.biznis_type = 't_mac_other_receivable'
|
|
|
|
|
- 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
|
|
|
|
|
|
|
+ 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_mac_other_receivable as tmor
|
|
|
|
|
+ on tmor.receivable_id = t.biznis_id and t.biznis_type = 't_mac_other_receivable'
|
|
|
|
|
+ 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
|
|
where t.flg_valid
|
|
|
- and t.acc_item_type = '账款类型-应收'
|
|
|
|
|
- and t.amt_residue <![CDATA[ <> ]]> 0
|
|
|
|
|
|
|
+ and t.acc_item_type = '账款类型-应收'
|
|
|
|
|
+ and t.amt_residue <![CDATA[ <> ]]> 0
|
|
|
<include refid="Condition"/>
|
|
<include refid="Condition"/>
|
|
|
order by t.acc_date
|
|
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">
|
|
@@ -235,45 +240,45 @@
|
|
|
<!-- 查询应付账款明细 -->
|
|
<!-- 查询应付账款明细 -->
|
|
|
<select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
|
|
<select id="getPayableAccountItem" resultMap="BaseResultMapResponse">
|
|
|
SELECT t.item_id,
|
|
SELECT t.item_id,
|
|
|
- t.item_id as "accItemId",
|
|
|
|
|
- t.acc_item_type,
|
|
|
|
|
- t.object_id,
|
|
|
|
|
- supplier.sup_code as "supCode",
|
|
|
|
|
- supplier.sup_name as "supName",
|
|
|
|
|
- t.org_id,
|
|
|
|
|
- tmo.org_name as "orgName",
|
|
|
|
|
- t.staff_id,
|
|
|
|
|
- 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",
|
|
|
|
|
- sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "biznisTypeName",
|
|
|
|
|
- t.amt_rec,
|
|
|
|
|
- t.amt_pay,
|
|
|
|
|
- t.amt_should,
|
|
|
|
|
- t.amt_handle,
|
|
|
|
|
- t.amt_waive,
|
|
|
|
|
- t.amt_residue,
|
|
|
|
|
- t.amt_residue as "amtNotHandle",
|
|
|
|
|
- t.amt_residue as "amtPayableHandle",
|
|
|
|
|
- t.remarks,
|
|
|
|
|
- t.make_staff,
|
|
|
|
|
- t.make_time,
|
|
|
|
|
- t.flg_valid,
|
|
|
|
|
- t.cp_id
|
|
|
|
|
|
|
+ t.item_id as "accItemId",
|
|
|
|
|
+ t.acc_item_type,
|
|
|
|
|
+ t.object_id,
|
|
|
|
|
+ supplier.sup_code as "supCode",
|
|
|
|
|
+ supplier.sup_name as "supName",
|
|
|
|
|
+ t.org_id,
|
|
|
|
|
+ tmo.org_name as "orgName",
|
|
|
|
|
+ t.staff_id,
|
|
|
|
|
+ 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",
|
|
|
|
|
+ sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "biznisTypeName",
|
|
|
|
|
+ t.amt_rec,
|
|
|
|
|
+ t.amt_pay,
|
|
|
|
|
+ t.amt_should,
|
|
|
|
|
+ t.amt_handle,
|
|
|
|
|
+ t.amt_waive,
|
|
|
|
|
+ t.amt_residue,
|
|
|
|
|
+ t.amt_residue as "amtNotHandle",
|
|
|
|
|
+ t.amt_residue as "amtPayableHandle",
|
|
|
|
|
+ t.remarks,
|
|
|
|
|
+ t.make_staff,
|
|
|
|
|
+ t.make_time,
|
|
|
|
|
+ t.flg_valid,
|
|
|
|
|
+ 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_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_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 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_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
|
|
where t.flg_valid
|
|
|
- and t.acc_item_type = '账款类型-应付'
|
|
|
|
|
- and t.amt_residue <![CDATA[ <> ]]> 0
|
|
|
|
|
|
|
+ and t.acc_item_type = '账款类型-应付'
|
|
|
|
|
+ and t.amt_residue <![CDATA[ <> ]]> 0
|
|
|
<include refid="Condition"/>
|
|
<include refid="Condition"/>
|
|
|
order by t.acc_date
|
|
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">
|