|
|
@@ -72,6 +72,15 @@
|
|
|
<result column="payment_residue" property="paymentResidue"/>
|
|
|
<result column="macNames" property="macNames"/>
|
|
|
<result column="amt_rec" property="amtRec"/>
|
|
|
+
|
|
|
+ <result column="sup_id" property="supId"/>
|
|
|
+ <result column="sup_code" property="supCode"/>
|
|
|
+ <result column="sup_name" property="supName"/>
|
|
|
+ <result column="sup_type" property="supType"/>
|
|
|
+ <result column="contact_name" property="contactName"/>
|
|
|
+ <result column="contact_phone" property="contactPhone"/>
|
|
|
+ <result column="return_address" property="returnAddress"/>
|
|
|
+
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
|
@@ -202,6 +211,120 @@
|
|
|
</if>
|
|
|
</sql>
|
|
|
|
|
|
+
|
|
|
+ <sql id="Condition_sup">
|
|
|
+ <if test="rpNo != null and rpNo != ''">
|
|
|
+ AND t.rp_no LIKE concat('%',my_ex.likequery(#{rpNo}),'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="rpType != null and rpType != ''">
|
|
|
+ AND t.rp_type = #{rpType}
|
|
|
+ </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="sumAmtRec != null">
|
|
|
+ AND t.sum_amt_rec = #{sumAmtRec}
|
|
|
+ </if>
|
|
|
+ <if test="sumAmtPay != null">
|
|
|
+ AND t.sum_amt_pay = #{sumAmtPay}
|
|
|
+ </if>
|
|
|
+ <if test="sumShouldHandle != null">
|
|
|
+ AND t.sum_should_handle = #{sumShouldHandle}
|
|
|
+ </if>
|
|
|
+ <if test="sumUseReceiptResidue != null">
|
|
|
+ AND t.sum_use_receipt_residue = #{sumUseReceiptResidue}
|
|
|
+ </if>
|
|
|
+ <if test="sumUsePaymentResidue != null">
|
|
|
+ AND t.sum_use_payment_residue = #{sumUsePaymentResidue}
|
|
|
+ </if>
|
|
|
+ <if test="sumAmtReceivableHandle != null">
|
|
|
+ AND t.sum_amt_receivable_handle = #{sumAmtReceivableHandle}
|
|
|
+ </if>
|
|
|
+ <if test="sumAmtPayableHandle != null">
|
|
|
+ AND t.sum_amt_payable_handle = #{sumAmtPayableHandle}
|
|
|
+ </if>
|
|
|
+ <if test="sumWaiveAmt != null">
|
|
|
+ AND t.sum_waive_amt = #{sumWaiveAmt}
|
|
|
+ </if>
|
|
|
+ <if test="accDate != null">
|
|
|
+ AND t.acc_date = #{accDate}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND t.remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="annexPaths != null and annexPaths != ''">
|
|
|
+ AND t.annex_paths = #{annexPaths}
|
|
|
+ </if>
|
|
|
+ <if test="biznisType != null and biznisType != ''">
|
|
|
+ AND t.biznis_type = #{biznisType}
|
|
|
+ </if>
|
|
|
+ <if test="biznisId != null and biznisId != ''">
|
|
|
+ AND t.biznis_id = #{biznisId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="biznisNo != null and biznisNo != ''">
|
|
|
+ AND t.biznis_no = #{biznisNo}
|
|
|
+ </if>
|
|
|
+ <if test="flgOrderHandle != null">
|
|
|
+ AND t.flg_order_handle = #{flgOrderHandle}
|
|
|
+ </if>
|
|
|
+ <if test="flgLock != null">
|
|
|
+ AND t.flg_lock = #{flgLock}
|
|
|
+ </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="cpId != null">
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="orgIdList != null and orgIdList.size() > 0">
|
|
|
+ AND t.org_id =any(#{orgIdList, typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="staffIdList != null and staffIdList.size() > 0">
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="makeTimeStart != null and makeTimeEnd != null">
|
|
|
+ AND t.make_time >= #{makeTimeStart}::timestamp with time zone
|
|
|
+ AND t.make_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <if test="flgValidList != null and flgValidList.size()>0">
|
|
|
+ AND t.flg_valid =any(#{flgValidList, typeHandler=BooleanListTypeHandler})
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="rpTypeList != null and rpTypeList.size() > 0">
|
|
|
+ AND t.rp_type =any(#{rpTypeList, typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="staffIds != null and staffIds.size() > 0">
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="createtimeStart != null and createtimeEnd != null">
|
|
|
+ AND t.op_create_time >= #{createtimeStart}::timestamp with time zone
|
|
|
+ AND t.op_create_time < #{createtimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="staffName != null and staffName != ''">
|
|
|
+ AND tms.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgName != null and orgName != ''">
|
|
|
+ AND tmo.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="sumAmtReceivableHandleFlag != null and sumAmtReceivableHandleFlag == true">
|
|
|
+ AND t.sum_amt_receivable_handle > 0
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+
|
|
|
<sql id="idsForeach">
|
|
|
<!-- 根据主键rpId批量操作 -->
|
|
|
WHERE rp_id in
|
|
|
@@ -621,4 +744,93 @@
|
|
|
DELETE FROM dkic_b.t_mac_rec_pay
|
|
|
WHERE rp_id = #{id}::uuid;
|
|
|
</delete>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询表t_mac_rec_pay,(条件查询+分页)列表 -->
|
|
|
+ <select id="getRpSupList" resultMap="BaseResultMapResponse">
|
|
|
+ select t.rp_id,
|
|
|
+ t.rp_no,
|
|
|
+ t.rp_type,
|
|
|
+ sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "rpTypeName",
|
|
|
+ t.object_id,
|
|
|
+ tmsp.sup_id,
|
|
|
+ tmsp.sup_code,
|
|
|
+ tmsp.sup_name,
|
|
|
+ tmsp.sup_type,
|
|
|
+ tmsp.contact_name,
|
|
|
+ tmsp.contact_phone,
|
|
|
+ tmsp.return_address,
|
|
|
+ t.org_id,
|
|
|
+ tmo.org_name as "orgName",
|
|
|
+ t.staff_id,
|
|
|
+ tms.staff_name as "staffName",
|
|
|
+ t.sum_amt_rec,
|
|
|
+ t.sum_amt_pay,
|
|
|
+ t.sum_should_handle,
|
|
|
+ t.sum_use_receipt_residue,
|
|
|
+ t.sum_use_payment_residue,
|
|
|
+ t.sum_amt_receivable_handle,
|
|
|
+ t.sum_amt_payable_handle,
|
|
|
+ t.sum_waive_amt,
|
|
|
+ t.acc_date,
|
|
|
+ t.remarks,
|
|
|
+ t.annex_paths,
|
|
|
+ t.biznis_type,
|
|
|
+ t.biznis_id,
|
|
|
+ t.biznis_no,
|
|
|
+ t.flg_order_handle,
|
|
|
+ t.flg_lock,
|
|
|
+ t.make_staff,
|
|
|
+ makestaff.staff_name as "makeStaffName",
|
|
|
+ t.make_time,
|
|
|
+ t.flg_valid,
|
|
|
+ t.cp_id,
|
|
|
+ tma.receivable_residue,
|
|
|
+ tma.receipt_residue
|
|
|
+ from dkic_b.t_mac_rec_pay as t
|
|
|
+ left join dkic_b.t_mst_supplier tmsp on tmsp.sup_id = t.object_id
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
|
|
|
+ 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 as makestaff on makestaff.staff_id = t.make_staff
|
|
|
+ LEFT JOIN dkic_b.t_mac_account tma on tma.object_id = t.object_id and tma.object_type in ('对象类型-供应商')
|
|
|
+ where t.rp_type in ('收付款类型-付款', '收付款类型-退付款')
|
|
|
+ <include refid="Condition_sup"/>
|
|
|
+
|
|
|
+ <if test="searchText !=null and searchText != ''">
|
|
|
+ AND ( tmsp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmsp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmsp.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmo.org_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tms.staff_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ order by t.op_create_time desc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询表t_mac_rec_pay,(条件查询)个数 -->
|
|
|
+ <select id="getRpSupListCount" resultType="Long">
|
|
|
+ SELECT count(1)
|
|
|
+ from dkic_b.t_mac_rec_pay as t
|
|
|
+ left join dkic_b.t_mst_supplier tmsp on tmsp.sup_id = t.object_id
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
|
|
|
+ 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 as makestaff on makestaff.staff_id = t.make_staff
|
|
|
+ where t.rp_type in ('收付款类型-付款', '收付款类型-退付款')
|
|
|
+ <include refid="Condition_sup"/>
|
|
|
+ <if test="searchText !=null and searchText != ''">
|
|
|
+ AND ( tmsp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmsp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmsp.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmo.org_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tms.staff_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|