|
|
@@ -219,6 +219,10 @@
|
|
|
<if test="skuModel != null and skuModel != ''">
|
|
|
AND tmgs.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
</if>
|
|
|
+ <if test="whList != null and whList.size()>0">
|
|
|
+ AND toi.wh_id =
|
|
|
+ any(#{whList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
|
@@ -269,6 +273,226 @@
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
|
+ <!-- 出库明细报表明细条件列 -->
|
|
|
+ <sql id="Condition_OutboundDetailReport">
|
|
|
+ <where>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="outNo != null and outNo != ''">
|
|
|
+ AND t.out_no LIKE concat('%',my_ex.likequery(#{outNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="supIdlist != null and supIdlist.size()>0">
|
|
|
+ AND t.sup_id = any(#{supIdlist,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">
|
|
|
+ AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="outTypeList != null and outTypeList.size()>0">
|
|
|
+ AND t.out_type =any(#{outTypeList,typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="fromNo != null and fromNo != ''">
|
|
|
+ AND t.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="cusName != null and cusName != ''">
|
|
|
+ AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgIdList != null and orgIdList.size() > 0">
|
|
|
+ AND t.org_id =any(#{orgIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="staffIdList != null and staffIdList.size() > 0">
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outStatusList != null and outStatusList.size() > 0">
|
|
|
+ AND t.out_status =any(#{outStatusList, typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outDateStart != null and outDateEnd != null">
|
|
|
+ AND t.out_date >= #{outDateStart}::timestamp with time zone
|
|
|
+ AND t.out_date < #{outDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <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="goodsSeriesList != null and goodsSeriesList.size()>0">
|
|
|
+ AND tmgs.series_id =
|
|
|
+ any(#{goodsSeriesList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="goodsCategoryList != null and goodsCategoryList.size()>0">
|
|
|
+ AND tmgs.category_id =
|
|
|
+ any(#{goodsCategoryList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="goodsBrandList != null and goodsBrandList.size()>0">
|
|
|
+ AND tmgs.brand_id =
|
|
|
+ any(#{goodsBrandList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="skuName != null and skuName != ''">
|
|
|
+ AND tmgs.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
+ </if>
|
|
|
+ <if test="skuModel != null and skuModel != ''">
|
|
|
+ AND tmgs.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
+ </if>
|
|
|
+ <if test="whList != null and whList.size()>0">
|
|
|
+ AND tpi.wh_id =
|
|
|
+ any(#{whList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 出库明细报表主表条件列 -->
|
|
|
+ <sql id="Condition_OutboundReport">
|
|
|
+ <where>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="outNo != null and outNo != ''">
|
|
|
+ AND t.out_no LIKE concat('%',my_ex.likequery(#{outNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="supIdlist != null and supIdlist.size()>0">
|
|
|
+ AND t.sup_id = any(#{supIdlist,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">
|
|
|
+ AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="outTypeList != null and outTypeList.size()>0">
|
|
|
+ AND t.out_type =any(#{outTypeList,typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="fromNo != null and fromNo != ''">
|
|
|
+ AND t.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="cusName != null and cusName != ''">
|
|
|
+ AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgIdList != null and orgIdList.size() > 0">
|
|
|
+ AND t.org_id =any(#{orgIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="staffIdList != null and staffIdList.size() > 0">
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outStatusList != null and outStatusList.size() > 0">
|
|
|
+ AND t.out_status =any(#{outStatusList, typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outDateStart != null and outDateEnd != null">
|
|
|
+ AND t.out_date >= #{outDateStart}::timestamp with time zone
|
|
|
+ AND t.out_date < #{outDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 入库明细报表明细条件列 -->
|
|
|
+ <sql id="Condition_IntoboundDetailReport">
|
|
|
+ <where>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="outNo != null and outNo != ''">
|
|
|
+ AND t.out_no LIKE concat('%',my_ex.likequery(#{outNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="supIdlist != null and supIdlist.size()>0">
|
|
|
+ AND t.sup_id = any(#{supIdlist,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">
|
|
|
+ AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="outTypeList != null and outTypeList.size()>0">
|
|
|
+ AND t.out_type =any(#{outTypeList,typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="fromNo != null and fromNo != ''">
|
|
|
+ AND t.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="cusName != null and cusName != ''">
|
|
|
+ AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgIdList != null and orgIdList.size() > 0">
|
|
|
+ AND t.org_id =any(#{orgIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="staffIdList != null and staffIdList.size() > 0">
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outStatusList != null and outStatusList.size() > 0">
|
|
|
+ AND t.out_status =any(#{outStatusList, typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outDateStart != null and outDateEnd != null">
|
|
|
+ AND t.out_date >= #{outDateStart}::timestamp with time zone
|
|
|
+ AND t.out_date < #{outDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <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="goodsSeriesList != null and goodsSeriesList.size()>0">
|
|
|
+ AND tmgs.series_id =
|
|
|
+ any(#{goodsSeriesList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="goodsCategoryList != null and goodsCategoryList.size()>0">
|
|
|
+ AND tmgs.category_id =
|
|
|
+ any(#{goodsCategoryList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="goodsBrandList != null and goodsBrandList.size()>0">
|
|
|
+ AND tmgs.brand_id =
|
|
|
+ any(#{goodsBrandList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="skuName != null and skuName != ''">
|
|
|
+ AND tmgs.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
+ </if>
|
|
|
+ <if test="skuModel != null and skuModel != ''">
|
|
|
+ AND tmgs.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
+ </if>
|
|
|
+ <if test="whList != null and whList.size()>0">
|
|
|
+ AND tpi.wh_id =
|
|
|
+ any(#{whList,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 入库明细报表主表条件列 -->
|
|
|
+ <sql id="Condition_IntoboundReport">
|
|
|
+ <where>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="outNo != null and outNo != ''">
|
|
|
+ AND t.out_no LIKE concat('%',my_ex.likequery(#{outNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="supIdlist != null and supIdlist.size()>0">
|
|
|
+ AND t.sup_id = any(#{supIdlist,typeHandler=UuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="contactPhone != null and contactPhone != ''">
|
|
|
+ AND t.contact_phone LIKE concat('%',my_ex.likequery(#{contactPhone}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="outTypeList != null and outTypeList.size()>0">
|
|
|
+ AND t.out_type =any(#{outTypeList,typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="fromNo != null and fromNo != ''">
|
|
|
+ AND t.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="cusName != null and cusName != ''">
|
|
|
+ AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgIdList != null and orgIdList.size() > 0">
|
|
|
+ AND t.org_id =any(#{orgIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="staffIdList != null and staffIdList.size() > 0">
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outStatusList != null and outStatusList.size() > 0">
|
|
|
+ AND t.out_status =any(#{outStatusList, typeHandler=StringListTypeHandler})
|
|
|
+ </if>
|
|
|
+ <if test="outDateStart != null and outDateEnd != null">
|
|
|
+ AND t.out_date >= #{outDateStart}::timestamp with time zone
|
|
|
+ AND t.out_date < #{outDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
<!-- 采购明细报表主表 -->
|
|
|
<select id="getPurReport" resultType="java.util.Map">
|
|
|
select
|
|
|
@@ -285,8 +509,8 @@
|
|
|
,tpp.intoing_amt as "intoingAmtSum"
|
|
|
,tpp.into_qty as "intoQtySum"
|
|
|
,tpp.into_amt as "intoAmtSum"
|
|
|
- ,tpp.return_qty as "returnQtySum"
|
|
|
- ,tpp.return_amt as "returnAmtSum"
|
|
|
+ ,tpp.return_qty as "returnInQtySum"
|
|
|
+ ,tpp.return_amt as "returnInAmtSum"
|
|
|
,tpp.amt_payable as "amtPayable"
|
|
|
,tpp.amt_residue as "amtResidue"
|
|
|
,tpp.remarks
|
|
|
@@ -477,5 +701,208 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 出库明细报表主表 -->
|
|
|
+ <select id="getOutboundReport" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ t.out_no as "outNo",
|
|
|
+ t.from_no as "fromNo",
|
|
|
+ tmo.org_name as "orgName",
|
|
|
+ tms.staff_name as "staffName",
|
|
|
+ tmc.cus_name as "cusName",
|
|
|
+ tmc.cus_phone as "cusPhone",
|
|
|
+ tmc.cus_from as "cusFrom",
|
|
|
+ tmc.contact_phone as "contactPhone",
|
|
|
+ tmc.address_full as "addressFull",
|
|
|
+ tmdd.data_value as cus_from_name,
|
|
|
+ tmp.sup_name as "supplierName",
|
|
|
+ sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "outStatusName",
|
|
|
+ sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) as "outTypeName",
|
|
|
+ t.outing_qty as "outingQtySum",
|
|
|
+ t.outing_amt as "outingAmtSum",
|
|
|
+ t.out_qty as "outQtySum",
|
|
|
+ t.out_amt as "outAmtSum",
|
|
|
+ t.return_qty as "returnOutQtySum",
|
|
|
+ t.return_amt as "returnOutAmtSum",
|
|
|
+ t.out_date as "outDate",
|
|
|
+ t.remarks,
|
|
|
+ makestaff.staff_name as "makeStaffName"
|
|
|
+ FROM dkic_b.t_psi_outbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_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
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
|
|
|
+ LEFT JOIN sys.t_data_kind tdktype ON tdktype.kind_code = t.out_type
|
|
|
+ <include refid="Condition_OutboundReport"/>
|
|
|
+ order by t.op_create_time desc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 出库明细报表明细 -->
|
|
|
+ <select id="getOutboundDetailReport" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ t.out_no as "outNo"
|
|
|
+ ,t.from_no as "fromNo"
|
|
|
+ ,tmo.org_name as "orgName"
|
|
|
+ ,tms.staff_name as "staffName"
|
|
|
+ ,tmc.cus_name as "cusName"
|
|
|
+ ,tmc.cus_phone as "cusPhone"
|
|
|
+ ,tmc.cus_from as "cusFrom"
|
|
|
+ ,tmc.contact_phone as "contactPhone"
|
|
|
+ ,tmc.address_full as "addressFull"
|
|
|
+ ,tmdd.data_value as cus_from_name
|
|
|
+ ,tmp.sup_name as "supplierName"
|
|
|
+ ,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "outStatusName"
|
|
|
+ ,sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) as "outTypeName"
|
|
|
+ ,t.outing_qty as "outingQtySum"
|
|
|
+ ,t.outing_amt as "outingAmtSum"
|
|
|
+ ,t.out_qty as "outQtySum"
|
|
|
+ ,t.out_amt as "outAmtSum"
|
|
|
+ ,t.return_qty as "returnOutQtySum"
|
|
|
+ ,t.return_amt as "returnOutAmtSum"
|
|
|
+ ,t.out_date as "outDate"
|
|
|
+ ,t.remarks
|
|
|
+ ,makestaff.staff_name as "makeStaffName"
|
|
|
+ ,tmgs.sku_name as "skuName"
|
|
|
+ ,tmgs.sku_model as "skuModel"
|
|
|
+ ,tpi.non_std_code as "nonStdCode"
|
|
|
+ ,tmgb.short_name as "shortName"
|
|
|
+ ,tmgc.cat_name as "catName"
|
|
|
+ ,series.series_name as "whName"
|
|
|
+ ,tmw.wh_name as "seriesName"
|
|
|
+ ,tpoi.outing_qty as "outingQty"
|
|
|
+ ,tpoi.outing_amt as "outingAmt"
|
|
|
+ ,tpoi.out_qty as "outQty"
|
|
|
+ ,tpoi.out_amt as "outAmt"
|
|
|
+ ,tpoi.return_qty as "returnQty"
|
|
|
+ ,tpoi.return_amt as "returnAmt"
|
|
|
+ FROM dkic_b.t_psi_outbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_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
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
|
|
|
+ left join sys.t_data_kind tdktype ON tdktype.kind_code = t.out_type
|
|
|
+ left join dkic_b.t_psi_outbound_item as tpoi on tpoi.out_id = t.out_id
|
|
|
+ left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
|
|
|
+ left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
|
|
|
+ left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
|
|
|
+ left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ <include refid="Condition_OutboundDetailReport"/>
|
|
|
+ order by tpoi.op_create_time desc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 入库明细报表主表 -->
|
|
|
+ <select id="getInboundlReport" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ t.into_no as "intoNo",
|
|
|
+ t.from_no as "fromNo",
|
|
|
+ tmo.org_name as "orgName",
|
|
|
+ tms.staff_name as "staffName",
|
|
|
+ tmc.cus_name as "cusName",
|
|
|
+ tmc.cus_phone as "cusPhone",
|
|
|
+ tmc.cus_from as "cusFrom",
|
|
|
+ tmc.contact_phone as "contactPhone",
|
|
|
+ tmc.address_full as "addressFull",
|
|
|
+ tmdd.data_value as cus_from_name,
|
|
|
+ tmp.sup_name as "supplierName",
|
|
|
+ sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "intoStatusName",
|
|
|
+ sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) as "intoTypeName",
|
|
|
+ t.intoing_qty as "intoingQtySum",
|
|
|
+ t.intoing_amt as "intoingAmtSum",
|
|
|
+ t.into_qty as "intoQtySum",
|
|
|
+ t.into_amt as "intoAmtSum",
|
|
|
+ t.return_qty as "returnintoQtySum",
|
|
|
+ t.return_amt as "returnintoAmtSum",
|
|
|
+ t.into_date as "intoDate",
|
|
|
+ tmw.wh_name as "whName",
|
|
|
+ t.remarks,
|
|
|
+ makestaff.staff_name as "makeStaffName"
|
|
|
+ FROM dkic_b.t_psi_inbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_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
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.into_status
|
|
|
+ left join sys.t_data_kind tdktype ON tdktype.kind_code = t.into_type
|
|
|
+ left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id
|
|
|
+ <include refid="Condition_IntoboundReport"/>
|
|
|
+ order by t.op_create_time desc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 入库明细报表明细 -->
|
|
|
+ <select id="getInboundDetailReport" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ t.into_no as "intoNo"
|
|
|
+ ,t.from_no as "fromNo"
|
|
|
+ ,tmo.org_name as "orgName"
|
|
|
+ ,tms.staff_name as "staffName"
|
|
|
+ ,tmc.cus_name as "cusName"
|
|
|
+ ,tmc.cus_phone as "cusPhone"
|
|
|
+ ,tmc.cus_from as "cusFrom"
|
|
|
+ ,tmc.contact_phone as "contactPhone"
|
|
|
+ ,tmc.address_full as "addressFull"
|
|
|
+ ,tmdd.data_value as cus_from_name
|
|
|
+ ,tmp.sup_name as "supplierName"
|
|
|
+ ,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "intoStatusName"
|
|
|
+ ,sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) as "intoTypeName"
|
|
|
+ ,t.intoing_qty as "intoingQtySum"
|
|
|
+ ,t.intoing_amt as "intoingAmtSum"
|
|
|
+ ,t.into_qty as "intoQtySum"
|
|
|
+ ,t.into_amt as "intoAmtSum"
|
|
|
+ ,t.return_qty as "returnInQtySum"
|
|
|
+ ,t.return_amt as "returnInAmtSum"
|
|
|
+ ,t.into_date as "intoDate"
|
|
|
+ ,t.remarks
|
|
|
+ ,makestaff.staff_name as "makeStaffName"
|
|
|
+ ,tmgs.sku_name as "skuName"
|
|
|
+ ,tmgs.sku_model as "skuModel"
|
|
|
+ ,tpi.non_std_code as "nonStdCode"
|
|
|
+ ,tmgb.short_name as "shortName"
|
|
|
+ ,tmgc.cat_name as "catName"
|
|
|
+ ,series.series_name as "seriesName"
|
|
|
+ ,tpoi.intoing_qty as "intoingQty"
|
|
|
+ ,tpoi.intoing_amt as "intoingAmt"
|
|
|
+ ,tpoi.into_qty as "intoQty"
|
|
|
+ ,tpoi.into_amt as "intoAmt"
|
|
|
+ ,tpoi.return_qty as "returnQty"
|
|
|
+ ,tpoi.return_amt as "returnAmt"
|
|
|
+ FROM dkic_b.t_psi_inbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_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
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.into_status
|
|
|
+ LEFT JOIN sys.t_data_kind tdktype ON tdktype.kind_code = t.into_type
|
|
|
+ left join dkic_b.t_psi_inbound_item as tpoi on tpoi.into_id = t.into_id
|
|
|
+ left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
|
|
|
+ left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
|
|
|
+ left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
|
|
|
+ <include refid="Condition_IntoboundDetailReport"/>
|
|
|
+ order by tpoi.op_create_time desc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|