|
|
@@ -98,6 +98,15 @@
|
|
|
<if test="freezeQty != null">
|
|
|
AND tpi.freeze_qty = #{freezeQty}
|
|
|
</if>
|
|
|
+ <if test="categoryId != null and categoryId != ''">
|
|
|
+ AND tmgs.category_id = #{categoryId}::UUID
|
|
|
+ </if>
|
|
|
+ <if test="searchText != null">
|
|
|
+ AND (tmgs.sku_code like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tpi.non_std_code like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
|
@@ -127,6 +136,12 @@
|
|
|
FROM dkic_b.t_psi_inventory tpi
|
|
|
<include refid="Join_Table"/>
|
|
|
<include refid="Condition"/>
|
|
|
+ <if test="desc != null and desc != ''">
|
|
|
+ order by tpi.usable_qty desc
|
|
|
+ </if>
|
|
|
+ <if test="desc == null or desc == ''">
|
|
|
+ order by tpi.usable_qty
|
|
|
+ </if>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|