|
|
@@ -136,6 +136,43 @@
|
|
|
<result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
|
<result column="wh_id" property="whId"/>
|
|
|
+ <collection property="purchaseItemResponseList" resultMap="purchaseItemListMap" columnPrefix="list_"/>
|
|
|
+ </resultMap>
|
|
|
+ <!-- 关联映射-->
|
|
|
+ <resultMap id="purchaseItemListMap" type="java.util.Map">
|
|
|
+ <id column="item_id" property="itemId"/>
|
|
|
+ <result column="pur_id" property="purId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="item_index" property="itemIndex"/>
|
|
|
+ <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="item_qty" property="itemQty"/>
|
|
|
+ <result column="price_std" property="priceStd"/>
|
|
|
+ <result column="amt_std" property="amtStd"/>
|
|
|
+ <result column="price_pur" property="pricePur"/>
|
|
|
+ <result column="item_amt" property="itemAmt"/>
|
|
|
+ <result column="price_discount" property="priceDiscount"/>
|
|
|
+ <result column="non_std_code" property="nonStdCode"/>
|
|
|
+ <result column="into_status" property="intoStatus"/>
|
|
|
+ <result column="intoing_qty" property="intoingQty"/>
|
|
|
+ <result column="intoing_amt" property="intoingAmt"/>
|
|
|
+ <result column="into_qty" property="intoQty"/>
|
|
|
+ <result column="into_amt" property="intoAmt"/>
|
|
|
+ <result column="return_qty" property="returnQty"/>
|
|
|
+ <result column="return_amt" property="returnAmt"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="sku_code" property="skuCode"/>
|
|
|
+ <result column="sku_name" property="skuName"/>
|
|
|
+ <result column="sku_model" property="skuModel"/>
|
|
|
+ <result column="short_name" property="shortName"/>
|
|
|
+ <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_app_code" property="opAppCode"/>
|
|
|
+ <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_db_user" property="opDbUser"/>
|
|
|
+
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
|
@@ -416,6 +453,71 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <sql id="Base_Column_List_Item_Response_Join">
|
|
|
+ ,tppi.item_id as "List_item_id",
|
|
|
+ tppi.pur_id as "List_pur_id",
|
|
|
+ tppi.item_index as "List_item_index",
|
|
|
+ tppi.sku_id as "List_sku_id",
|
|
|
+ tppi.item_qty as "List_item_qty",
|
|
|
+ tppi.price_std as "pricePurchase",
|
|
|
+ tppi.amt_std as "List_amt_std",
|
|
|
+ tppi.price_pur as "List_price_pur",
|
|
|
+ tppi.item_amt as "List_item_amt",
|
|
|
+ tppi.price_discount as "List_price_discount",
|
|
|
+ tppi.non_std_code as "List_non_std_code",
|
|
|
+ tppi.into_status as "List_into_status",
|
|
|
+ tppi.intoing_qty as "List_intoing_qty",
|
|
|
+ tppi.intoing_amt as "List_intoing_amt",
|
|
|
+ tppi.into_qty as "List_into_qty",
|
|
|
+ tppi.into_amt as "List_into_amt",
|
|
|
+ tppi.return_qty as "List_return_qty",
|
|
|
+ tppi.return_amt as "List_return_amt",
|
|
|
+ tppi.remarks as "List_remarks",
|
|
|
+ tppi.flg_valid as "List_flg_valid",
|
|
|
+ tppi.cp_id as "List_cp_id",
|
|
|
+ tppi.op_create_time as "List_op_create_time",
|
|
|
+ tppi.op_create_user_id as "List_op_create_user_id",
|
|
|
+ tppi.op_update_time as "List_op_update_time",
|
|
|
+ tppi.op_update_user_id as "List_op_update_user_id",
|
|
|
+ tppi.op_app_code as "List_op_app_code",
|
|
|
+ tppi.op_timestamp as "List_op_timestamp",
|
|
|
+ tppi.op_db_user as "List_op_db_user",
|
|
|
+ tmgs.sku_code AS list_sku_code,
|
|
|
+ tmgs.sku_name AS list_sku_name,
|
|
|
+ tmgb.short_name AS list_short_name,
|
|
|
+ tmgs.sku_model AS list_sku_model,
|
|
|
+ tmgs.price_purchase AS list_price_purchase,
|
|
|
+ tmgs.sku_images AS list_sku_images,
|
|
|
+ tpit.usable_qty AS list_usable_qty,
|
|
|
+ tpit.inv_qty AS list_inv_qty,
|
|
|
+ tpit.outing_qty AS list_outing_qty
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 查询表dkic_b.t_psi_purchase,(条件查询+分页)列表 -->
|
|
|
+ <select id="selectByCondItem" resultMap="BaseResultMapResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Left_join"/>
|
|
|
+ <include refid="Base_Column_List_Item_Response_Join"/>
|
|
|
+ ,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"/>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
<!-- 根据主键查询表dkic_b.t_psi_purchase的一行数据 -->
|