|
@@ -50,7 +50,8 @@
|
|
|
tpp.op_update_user_id,
|
|
tpp.op_update_user_id,
|
|
|
tpp.op_app_code,
|
|
tpp.op_app_code,
|
|
|
tpp.op_timestamp,
|
|
tpp.op_timestamp,
|
|
|
- tpp.op_db_user
|
|
|
|
|
|
|
+ tpp.op_db_user,
|
|
|
|
|
+ tpp.wh_id
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
@@ -267,7 +268,7 @@
|
|
|
AND tpp.staff_id = #{staffId}
|
|
AND tpp.staff_id = #{staffId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="supId != null and supId != ''">
|
|
<if test="supId != null and supId != ''">
|
|
|
- AND tpp.sup_id = #{supId}
|
|
|
|
|
|
|
+ AND tpp.sup_id = #{supId}::uuid
|
|
|
</if>
|
|
</if>
|
|
|
<if test="contactName != null and contactName != ''">
|
|
<if test="contactName != null and contactName != ''">
|
|
|
AND tpp.contact_name = #{contactName}
|
|
AND tpp.contact_name = #{contactName}
|
|
@@ -362,6 +363,25 @@
|
|
|
<if test="opDbUser != null and opDbUser != ''">
|
|
<if test="opDbUser != null and opDbUser != ''">
|
|
|
AND tpp.op_db_user = #{opDbUser}
|
|
AND tpp.op_db_user = #{opDbUser}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="intoStatusList != null and intoStatusList.size()>0">
|
|
|
|
|
+ AND tpp.into_status =
|
|
|
|
|
+ any(#{intoStatusList,typeHandler=StringListTypeHandler})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="skuName != null and skuName!='' ">
|
|
|
|
|
+ and exists (select 1 from dkic_b.t_psi_purchase_item tppi
|
|
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tppi.sku_id
|
|
|
|
|
+ where
|
|
|
|
|
+ tpp.pur_id = tppi.pur_id
|
|
|
|
|
+ and tppi.flg_valid
|
|
|
|
|
+ AND position(#{skuName} in tmgs.sku_name) > 0
|
|
|
|
|
+ )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="pickupDateStart != null">
|
|
|
|
|
+ AND tpp.pickup_date >= #{pickupDateStart}::timestamp with time zone
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="pickupDateEnd != null">
|
|
|
|
|
+ AND tpp.pickup_date < #{pickupDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
|
|
+ </if>
|
|
|
</where>
|
|
</where>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
@@ -381,11 +401,13 @@
|
|
|
,tms.staff_name as "staffName"
|
|
,tms.staff_name as "staffName"
|
|
|
,tms1.staff_name as "makeStaffName"
|
|
,tms1.staff_name as "makeStaffName"
|
|
|
,tmp.sup_name as "supplierName"
|
|
,tmp.sup_name as "supplierName"
|
|
|
|
|
+ ,tmw.wh_name as "whName"
|
|
|
FROM dkic_b.t_psi_purchase tpp
|
|
FROM dkic_b.t_psi_purchase tpp
|
|
|
Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
|
|
Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
|
|
|
Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
|
|
Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
|
|
|
Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
|
|
Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
|
|
|
Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
|
|
Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
|
|
|
|
|
+ Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
|
|
|
<include refid="Condition_1"/>
|
|
<include refid="Condition_1"/>
|
|
|
<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">
|
|
|
limit #{end} offset #{start}
|
|
limit #{end} offset #{start}
|
|
@@ -401,11 +423,13 @@
|
|
|
,tms.staff_name as "staffName"
|
|
,tms.staff_name as "staffName"
|
|
|
,tms1.staff_name as "makeStaffName"
|
|
,tms1.staff_name as "makeStaffName"
|
|
|
,tmp.sup_name as "supplierName"
|
|
,tmp.sup_name as "supplierName"
|
|
|
|
|
+ ,tmw.wh_name as "whName"
|
|
|
FROM dkic_b.t_psi_purchase tpp
|
|
FROM dkic_b.t_psi_purchase tpp
|
|
|
Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
|
|
Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
|
|
|
Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
|
|
Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
|
|
|
Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
|
|
Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
|
|
|
Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
|
|
Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
|
|
|
|
|
+ Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
|
|
|
WHERE pur_id = #{purId}::uuid
|
|
WHERE pur_id = #{purId}::uuid
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|