|
|
@@ -158,6 +158,7 @@
|
|
|
<result column="inboundReturnQty" property="inboundReturnQty"/>
|
|
|
<result column="flg_auto_handle" property="flgAutoHandle"/>
|
|
|
<result column="inbound_processing_flag" property="inboundProcessingFlag"/>
|
|
|
+ <result column="category_count" property="categoryCount"/>
|
|
|
<collection property="purchaseItemResponseList" resultMap="purchaseItemListMap" columnPrefix="list_"/>
|
|
|
</resultMap>
|
|
|
<!-- 关联映射-->
|
|
|
@@ -196,6 +197,9 @@
|
|
|
<result column="op_app_code" property="opAppCode"/>
|
|
|
<result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
|
+ <result column="brand_name" property="brandName"/>
|
|
|
+ <result column="sku_images" property="skuImages"/>
|
|
|
+
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
@@ -526,7 +530,7 @@
|
|
|
tppi.into_status as "List_into_status",
|
|
|
sys.f_remove_zero(tppi.intoing_qty) as "List_intoing_qty",
|
|
|
tppi.intoing_amt as "List_intoing_amt",
|
|
|
- sys.f_remove_zero(ttppi.into_qty) as "List_into_qty",
|
|
|
+ sys.f_remove_zero(tppi.into_qty) as "List_into_qty",
|
|
|
tppi.into_amt as "List_into_amt",
|
|
|
sys.f_remove_zero(tppi.return_qty) as "List_return_qty",
|
|
|
tppi.return_amt as "List_return_amt",
|
|
|
@@ -973,4 +977,53 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询表dkic_b.t_psi_purchase,(条件查询+分页)列表 -->
|
|
|
+ <select id="selectTotalDetail" resultMap="BaseResultMapResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Left_join"/>
|
|
|
+ <include refid="Base_Column_List_Item_Response_Join"/>
|
|
|
+ ,tmgb.brand_name as "list_brand_name"
|
|
|
+ ,(select count(DISTINCT tmgss.category_id) from dkic_b.t_psi_purchase_item ti
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_sku tmgss ON tmgss.sku_id = ti.sku_id
|
|
|
+ where ti.pur_id = tpp.pur_id and ti.flg_valid) as "category_count"
|
|
|
+ ,tmo.org_name as "orgName"
|
|
|
+ ,tms.staff_name as "staffName"
|
|
|
+ ,tms1.staff_name as "makeStaffName"
|
|
|
+ ,tmp.sup_name as "supplierName"
|
|
|
+ ,tmw.wh_name as "whName"
|
|
|
+
|
|
|
+
|
|
|
+ FROM dkic_b.t_psi_purchase tpp
|
|
|
+ left join dkic_b.t_psi_purchase_item tppi on tppi.pur_id = tpp.pur_id
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tppi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join dkic_b.t_psi_inventory tpit on tpit.sku_id = tppi.sku_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_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_warehouse tmw on tpp.wh_id = tmw.wh_id
|
|
|
+ <include refid="Condition_1"/>
|
|
|
+ ORDER BY tpp.make_time
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTotalDetailCount" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ 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_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 tms1 on tpp.make_staff = tms1.staff_id
|
|
|
+ Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
|
|
|
+ left join sys.t_data_kind tdk1 on tdk1.kind_code = tpp.into_status
|
|
|
+ left join sys.t_data_kind tdk2 on tdk2.kind_code = tpp.pur_status
|
|
|
+ <include refid="Condition_1"/>
|
|
|
+ </select>
|
|
|
</mapper>
|