|
|
@@ -63,6 +63,41 @@
|
|
|
<if test="whId != null">
|
|
|
AND tpi.wh_id = #{whId} ::uuid
|
|
|
</if>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!--库存查询count-->
|
|
|
+ <select id="getIvtDetailReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ from dkic_b.t_psi_inventory as tpi
|
|
|
+ inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
|
|
|
+ left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
|
|
|
+ left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
|
|
|
+ where tpi.flg_valid
|
|
|
+ AND tpi.cp_id = #{cpId}
|
|
|
+ AND tpi.inv_qty != 0
|
|
|
+ <if test="skuId != null">
|
|
|
+ AND tpi.sku_id = #{skuId} ::uuid
|
|
|
+ </if>
|
|
|
+ <if test="nonStdCode != null">
|
|
|
+ AND tpi.non_std_code = #{nonStdCode}
|
|
|
+ </if>
|
|
|
+ <if test="skuCode != null">
|
|
|
+ AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="skuName != null">
|
|
|
+ AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="whName != null">
|
|
|
+ AND tmgs.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="whId != null">
|
|
|
+ AND tpi.wh_id = #{whId} ::uuid
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<!-- 采购明细报表明细条件列 -->
|
|
|
<sql id="Condition_PurDetailReport">
|