|
|
@@ -72,79 +72,74 @@
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
<if test="rpNo != null and rpNo != ''">
|
|
|
- AND rp_no = #{rpNo}
|
|
|
+ AND t.rp_no LIKE concat('%',my_ex.likequery(#{rpNo}),'%')
|
|
|
</if>
|
|
|
<if test="rpType != null and rpType != ''">
|
|
|
- AND rp_type = #{rpType}
|
|
|
+ AND t.rp_type = #{rpType}
|
|
|
</if>
|
|
|
<if test="objectId != null and objectId != ''">
|
|
|
- AND object_id = #{objectId}
|
|
|
+ AND t.object_id = #{objectId}
|
|
|
</if>
|
|
|
<if test="orgId != null and orgId != ''">
|
|
|
- AND org_id = #{orgId}
|
|
|
+ AND t.org_id = #{orgId}
|
|
|
</if>
|
|
|
<if test="staffId != null and staffId != ''">
|
|
|
- AND staff_id = #{staffId}
|
|
|
+ AND t.staff_id = #{staffId}
|
|
|
</if>
|
|
|
<if test="sumAmtRec != null">
|
|
|
- AND sum_amt_rec = #{sumAmtRec}
|
|
|
+ AND t.sum_amt_rec = #{sumAmtRec}
|
|
|
</if>
|
|
|
<if test="sumAmtPay != null">
|
|
|
- AND sum_amt_pay = #{sumAmtPay}
|
|
|
+ AND t.sum_amt_pay = #{sumAmtPay}
|
|
|
</if>
|
|
|
<if test="accDate != null">
|
|
|
- AND acc_date = #{accDate}
|
|
|
+ AND t.acc_date = #{accDate}
|
|
|
</if>
|
|
|
<if test="remarks != null and remarks != ''">
|
|
|
- AND remarks = #{remarks}
|
|
|
+ AND t.remarks = #{remarks}
|
|
|
</if>
|
|
|
<if test="annexPaths != null and annexPaths != ''">
|
|
|
- AND annex_paths = #{annexPaths}
|
|
|
+ AND t.annex_paths = #{annexPaths}
|
|
|
</if>
|
|
|
<if test="biznisType != null and biznisType != ''">
|
|
|
- AND biznis_type = #{biznisType}
|
|
|
+ AND t.biznis_type = #{biznisType}
|
|
|
</if>
|
|
|
<if test="biznisId != null and biznisId != ''">
|
|
|
- AND biznis_id = #{biznisId}
|
|
|
+ AND t.biznis_id = #{biznisId}
|
|
|
</if>
|
|
|
<if test="biznisNo != null and biznisNo != ''">
|
|
|
- AND biznis_no = #{biznisNo}
|
|
|
+ AND t.biznis_no = #{biznisNo}
|
|
|
</if>
|
|
|
<if test="flgLock != null">
|
|
|
- AND flg_lock = #{flgLock}
|
|
|
+ AND t.flg_lock = #{flgLock}
|
|
|
</if>
|
|
|
<if test="makeStaff != null and makeStaff != ''">
|
|
|
- AND make_staff = #{makeStaff}
|
|
|
+ AND t.make_staff = #{makeStaff}
|
|
|
</if>
|
|
|
<if test="makeTime != null">
|
|
|
- AND make_time = #{makeTime}
|
|
|
- </if>
|
|
|
- <if test="flgValid != null">
|
|
|
- AND flg_valid = #{flgValid}
|
|
|
+ AND t.make_time = #{makeTime}
|
|
|
</if>
|
|
|
<if test="cpId != null">
|
|
|
- AND cp_id = #{cpId}
|
|
|
- </if>
|
|
|
- <if test="opCreateTime != null">
|
|
|
- AND op_create_time = #{opCreateTime}
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
</if>
|
|
|
- <if test="opCreateUserId != null and opCreateUserId != ''">
|
|
|
- AND op_create_user_id = #{opCreateUserId}
|
|
|
+ <if test="cusPhone != null and cusPhone != ''">
|
|
|
+ AND tmc.cus_phone LIKE concat('%',my_ex.likequery(#{cusPhone}),'%')
|
|
|
</if>
|
|
|
- <if test="opUpdateTime != null">
|
|
|
- AND op_update_time = #{opUpdateTime}
|
|
|
+ <if test="cusName != null and cusName != ''">
|
|
|
+ AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
|
|
|
</if>
|
|
|
- <if test="opUpdateUserId != null and opUpdateUserId != ''">
|
|
|
- AND op_update_user_id = #{opUpdateUserId}
|
|
|
+ <if test="orgIdList != null and orgIdList.size() > 0">
|
|
|
+ AND t.org_id =any(#{orgIdList, typeHandler=uuidListTypeHandler})
|
|
|
</if>
|
|
|
- <if test="opAppCode != null and opAppCode != ''">
|
|
|
- AND op_app_code = #{opAppCode}
|
|
|
+ <if test="staffIdList != null and staffIdList.size() > 0">
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
|
|
|
</if>
|
|
|
- <if test="opTimestamp != null">
|
|
|
- AND op_timestamp = #{opTimestamp}
|
|
|
+ <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="opDbUser != null and opDbUser != ''">
|
|
|
- AND op_db_user = #{opDbUser}
|
|
|
+ <if test="flgValidList != null and flgValidList.size()>0">
|
|
|
+ AND t.flg_valid =any(#{flgValidList, typeHandler=BooleanListTypeHandler})
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
@@ -159,9 +154,40 @@
|
|
|
|
|
|
<!-- 查询表t_mac_rec_pay,(条件查询+分页)列表 -->
|
|
|
<select id="selectByCond" resultMap="BaseResultMapResponse">
|
|
|
- SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- FROM t_mac_rec_pay
|
|
|
+ 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,
|
|
|
+ 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.sum_amt_rec,
|
|
|
+ t.sum_amt_pay,
|
|
|
+ t.acc_date,
|
|
|
+ t.remarks,
|
|
|
+ t.annex_paths,
|
|
|
+ t.biznis_type,
|
|
|
+ t.biznis_id,
|
|
|
+ t.biznis_no,
|
|
|
+ t.flg_lock,
|
|
|
+ t.make_staff,
|
|
|
+ makestaff.staff_name as "makeStaffName",
|
|
|
+ t.make_time,
|
|
|
+ t.flg_valid,
|
|
|
+ t.cp_id
|
|
|
+ from dkic_b.t_mac_rec_pay as t
|
|
|
+ left join dkic_b.t_mst_customer tmc
|
|
|
+ on tmc.cus_id = t.object_id and t.rp_type in ('收付款类型-收款', '收付款类型-退收款')
|
|
|
+ left join sys.t_data_kind as tdk1 on t.rp_type = tdk1.kind_code
|
|
|
+ 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
|
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -172,7 +198,9 @@
|
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|
|
|
count(1)
|
|
|
- FROM t_mac_rec_pay
|
|
|
+ FROM dkic_b.t_mac_rec_pay as t
|
|
|
+ LEFT JOIN dkic_b.t_mst_customer tmc
|
|
|
+ ON tmc.cus_id = t.object_id and t.rp_type = '收付款类型-收款'
|
|
|
<include refid="Condition"/>
|
|
|
</select>
|
|
|
|