|
|
@@ -208,6 +208,8 @@
|
|
|
<result column="pack_box_text" property="packBoxText"/>
|
|
|
<result column="can_return_qty" property="canReturnQty"/>
|
|
|
<result column="price_into" property="priceInto"/>
|
|
|
+ <result column="sku_spec" property="skuSpec"/>
|
|
|
+ <result column="decimalPlaces" property="decimalPlaces"/>
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
@@ -310,6 +312,7 @@
|
|
|
<if test="intoStatus != null and intoStatus != ''">
|
|
|
AND tpi.into_status LIKE concat('%',my_ex.likequery(#{intoStatus}),'%')
|
|
|
</if>
|
|
|
+
|
|
|
<if test="skuModel != null and skuModel!='' ">
|
|
|
and exists (select 1 from dkic_b.t_psi_inbound_item tpii
|
|
|
left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_id
|
|
|
@@ -666,6 +669,7 @@
|
|
|
sys.f_remove_zero(tpii.into_qty) AS list_into_qty,
|
|
|
tpii.into_amt AS list_into_amt,
|
|
|
sys.f_remove_zero(tpii.return_qty) AS list_return_qty,
|
|
|
+ ( SELECT ul.decimal_places FROM dkic_b.t_mst_unit ul WHERE tpii.unit_id = ul.unit_id ) AS "list_decimalPlaces",
|
|
|
tpii.return_amt AS list_return_amt,
|
|
|
tpii.remarks AS list_remarks,
|
|
|
tpii.inv_id AS list_inv_id,
|
|
|
@@ -681,7 +685,7 @@
|
|
|
tmgb.short_name AS list_short_name,
|
|
|
tmgs.sku_images AS list_sku_images,
|
|
|
tmgs.price_standard AS list_price_std,
|
|
|
-
|
|
|
+ tmgs.sku_spec as "list_sku_spec",
|
|
|
i.inv_id as list_inv_id,
|
|
|
i.wh_id as list_wh_id,
|
|
|
i.inv_qty as list_inv_qty,
|
|
|
@@ -1197,7 +1201,95 @@
|
|
|
else true end as "paymentFlag"
|
|
|
FROM dkic_b.t_psi_inbound tpi
|
|
|
<include refid="Join_Table_Return"/>
|
|
|
- <include refid="Condition"/>
|
|
|
+ <where>
|
|
|
+ <if test="intoNo != null and intoNo != ''">
|
|
|
+ AND tpi.into_no LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="intoType != null and intoType != ''">
|
|
|
+ AND tpi.into_type LIKE concat('%',my_ex.likequery(#{intoType}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="intoTypes != null and intoTypes.size()>0">
|
|
|
+ AND tpi.into_type =any(#{intoTypes,typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="intoReasonList != null and intoReasonList.size()>0">
|
|
|
+ AND tpi.into_reason =any(#{intoReasonList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="searchText !=null and searchText != ''">
|
|
|
+ AND (
|
|
|
+ tpi.into_no LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmp.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="staffIds != null and staffIds.size()>0">
|
|
|
+ AND t.staff_id = any(#{staffIds, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="orgIds != null and orgIds.size()>0">
|
|
|
+ AND t.org_id = any(#{orgIds, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="fromId != null and fromId != ''">
|
|
|
+ AND tpi.from_id = #{fromId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="fromNo != null and fromNo != ''">
|
|
|
+ AND tpi.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
+ AND tpi.org_id = #{orgId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="orgName != null and orgName != ''">
|
|
|
+ AND tmo.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="supName != null and supName != ''">
|
|
|
+ AND tmp.sup_name LIKE concat('%',my_ex.likequery(#{supName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="staffName != null and staffName != ''">
|
|
|
+ AND tms.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="whName != null and whName != ''">
|
|
|
+ AND tmw.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="staffId != null and staffId != ''">
|
|
|
+ AND tpi.staff_id = #{staffId}::uuid
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="supId != null and supId != ''">
|
|
|
+ AND tpi.sup_id = #{supId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="makeStaff != null and makeStaff != ''">
|
|
|
+ AND tpi.make_staff = #{makeStaff}
|
|
|
+ </if>
|
|
|
+ <if test="viewVoidedDocuments !=null and viewVoidedDocuments == false">
|
|
|
+ AND tpi.flg_valid = true
|
|
|
+ </if>
|
|
|
+ <if test="makeTime != null">
|
|
|
+ AND tpi.make_time = #{makeTime}
|
|
|
+ </if>
|
|
|
+ <if test="receivableId != null and receivableId != ''">
|
|
|
+ AND tpi.receivable_id = #{receivableId}
|
|
|
+ </if>
|
|
|
+ <if test="flgValid != null">
|
|
|
+ AND tpi.flg_valid = #{flgValid}
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND tpi.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="intoDateStart != null and intoDateEnd != null">
|
|
|
+ AND tpi.into_date >= #{intoDateStart}::timestamp with time zone
|
|
|
+ AND tpi.into_date < #{intoDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <if test="makeTimeStart != null and makeTimeEnd != null">
|
|
|
+ AND tpi.make_time >= #{makeTimeStart}::timestamp with time zone
|
|
|
+ AND tpi.make_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <if test="intoStatusList != null and intoStatusList.size()>0">
|
|
|
+ AND tpi.into_status =
|
|
|
+ any(#{intoStatusList, typeHandler= StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="intoStatus != null and intoStatus != ''">
|
|
|
+ AND tpi.into_status LIKE concat('%',my_ex.likequery(#{intoStatus}),'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
ORDER BY tpi.op_create_time DESC
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
@@ -1209,7 +1301,95 @@
|
|
|
count(1)
|
|
|
FROM dkic_b.t_psi_inbound tpi
|
|
|
<include refid="Join_Table_Return"/>
|
|
|
- <include refid="Condition"/>
|
|
|
+ <where>
|
|
|
+ <if test="intoNo != null and intoNo != ''">
|
|
|
+ AND tpi.into_no LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="intoType != null and intoType != ''">
|
|
|
+ AND tpi.into_type LIKE concat('%',my_ex.likequery(#{intoType}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="intoTypes != null and intoTypes.size()>0">
|
|
|
+ AND tpi.into_type =any(#{intoTypes,typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="intoReasonList != null and intoReasonList.size()>0">
|
|
|
+ AND tpi.into_reason =any(#{intoReasonList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="searchText !=null and searchText != ''">
|
|
|
+ AND (
|
|
|
+ tpi.into_no LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmp.return_address LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmp.contact_phone LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ or tmp.sup_name LIKE concat('%',my_ex.likequery(#{searchText}),'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="staffIds != null and staffIds.size()>0">
|
|
|
+ AND t.staff_id = any(#{staffIds, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="orgIds != null and orgIds.size()>0">
|
|
|
+ AND t.org_id = any(#{orgIds, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="fromId != null and fromId != ''">
|
|
|
+ AND tpi.from_id = #{fromId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="fromNo != null and fromNo != ''">
|
|
|
+ AND tpi.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
+ AND tpi.org_id = #{orgId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="orgName != null and orgName != ''">
|
|
|
+ AND tmo.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="supName != null and supName != ''">
|
|
|
+ AND tmp.sup_name LIKE concat('%',my_ex.likequery(#{supName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="staffName != null and staffName != ''">
|
|
|
+ AND tms.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="whName != null and whName != ''">
|
|
|
+ AND tmw.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="staffId != null and staffId != ''">
|
|
|
+ AND tpi.staff_id = #{staffId}::uuid
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="supId != null and supId != ''">
|
|
|
+ AND tpi.sup_id = #{supId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="makeStaff != null and makeStaff != ''">
|
|
|
+ AND tpi.make_staff = #{makeStaff}
|
|
|
+ </if>
|
|
|
+ <if test="viewVoidedDocuments !=null and viewVoidedDocuments == false">
|
|
|
+ AND tpi.flg_valid = true
|
|
|
+ </if>
|
|
|
+ <if test="makeTime != null">
|
|
|
+ AND tpi.make_time = #{makeTime}
|
|
|
+ </if>
|
|
|
+ <if test="receivableId != null and receivableId != ''">
|
|
|
+ AND tpi.receivable_id = #{receivableId}
|
|
|
+ </if>
|
|
|
+ <if test="flgValid != null">
|
|
|
+ AND tpi.flg_valid = #{flgValid}
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND tpi.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="intoDateStart != null and intoDateEnd != null">
|
|
|
+ AND tpi.into_date >= #{intoDateStart}::timestamp with time zone
|
|
|
+ AND tpi.into_date < #{intoDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <if test="makeTimeStart != null and makeTimeEnd != null">
|
|
|
+ AND tpi.make_time >= #{makeTimeStart}::timestamp with time zone
|
|
|
+ AND tpi.make_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <if test="intoStatusList != null and intoStatusList.size()>0">
|
|
|
+ AND tpi.into_status =
|
|
|
+ any(#{intoStatusList, typeHandler= StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="intoStatus != null and intoStatus != ''">
|
|
|
+ AND tpi.into_status LIKE concat('%',my_ex.likequery(#{intoStatus}),'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
<!-- 查看来源单据,总单加明细 采购退货用-->
|
|
|
<select id="selectInboundReturnById" resultMap="BaseResultMapInboundReturnResponse">
|
|
|
@@ -1227,12 +1407,9 @@
|
|
|
,case when tpi.receivable_id is null then false
|
|
|
when tmai.amt_handle = 0 then false
|
|
|
else true end as "paymentFlag"
|
|
|
- ,tpp.sum_amount AS "purSumAmount"
|
|
|
- ,tpp.return_amt AS "purReturnAmt"
|
|
|
,sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) AS "intoStatusName"
|
|
|
FROM dkic_b.t_psi_inbound tpi
|
|
|
Left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
|
|
|
- Left join dkic_b.t_psi_purchase tpp on tpp.pur_id = tpi.from_id
|
|
|
Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
|
|
|
Left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
|
|
|
Left join dkic_b.t_mst_staff tms1 on tms1.staff_id = tpi.make_staff
|