使用分页查询二次查询相同商品,查询不显示(使用的mybatis-plus)
1、操作流程,现使用分页,查询到某个具体的分页数页面
2、此时我用条件筛选查询其中名为“草菇”的商品
点击查询之后,显示结果为空
3、重置之后,再次使用 “草菇” 筛选商品数据
数据就有了
想请问一下诸位大佬,这是个什么原因导致的问题?是否与mybatis-plus的机制有关,或者是个人原因导致的,以下是sql语句,筛选只使用了名字
select
g.id,
g.goods_id,
g.supplier_id,
g.supplier_name,
g.purveyor_id,
g.goods_name,
g.goods_identifying,
g.identify_code,
g.goods_type,
g.goods_type_name,
g.goods_brand,
g.standards,
g.standards_code,
g.goods_unit,
g.status,
g.img_url ,
g.description,
g.remark,
g.good_num,
g.good_bar_code,
g.commonly_name,
g.simple_name,
g.tax_rate,
g.prepackaged,
g.coefficient,
g.basic_unit,
g.settlement_unit,
g.purchasing_unit,
g.minimum_order,
g.increment_value,
g.basket_weight,
g.supply_price,
g.sorting_threshold,
g.production_place,
g.shelf_life,
g.examine
from t_goods_info g
where g.del_flag = 0
<if test="param.goodsName!=null and param.goodsName !='' ">
and g.goods_name like concat('%',#{param.goodsName},'%')
</if>
<if test="param.goodsIdentifying!=null and param.goodsIdentifying !='' ">
and g.identify_code like concat('%',#{param.goodsIdentifying},'%')
</if>
<if test="param.goodsType!=null and param.goodsType !='' ">
and g.goods_type like concat('%',#{param.goodsType},'%')
</if>
<if test="param.supplierId!=null and param.supplierId !='' ">
and g.supplier_id = #{param.supplierId}
</if>
<if test="param.purveyorId!=null and param.purveyorId !='' ">
and g.purveyor_id = #{param.purveyorId}
</if>
<if test="param.supplierName!=null and param.supplierName !='' ">
and g.supplier_name like concat('%',#{param.supplierName},'%')
</if>
<if test="param.goodsBrand!=null and param.goodsBrand !='' ">
and g.goods_brand like concat('%',#{param.goodsBrand},'%')
</if>
<if test="param.standards!=null and param.standards !='' ">
and g.standards like concat('%',#{param.standards},'%')
</if>
<if test="param.status!=null">
and g.status = #{param.status}
</if>
<if test="param.type!=null and param.type !='' ">
and g.type = #{param.type}
</if>
<if test="param.ids != null and param.ids != ''">
and g.supplier_id in
<foreach collection="param.ids" item="supplierId" open="(" close=")" separator=",">
#{supplierId}
</foreach>
</if>
<if test="param.supplyPrice!=null and param.supplyPrice !='' ">
and g.supply_price like concat('%',#{param.supplyPrice},'%')
</if>
<if test="param.goodsId != null and param.goodsId != ''">
and g.id not in
<foreach collection="param.goodsId" item="goodId" open="(" close=")" separator=",">
#{goodId}
</foreach>
</if>
<if test="param.pullStatus != null and param.pullFlag != ''">
and g.supplier_dept_codes like concat('%',#{param.deptCode},'%')
</if>
<if test="param.pullStatus != null and param.pullFlag ==''">
and (g.supplier_dept_codes not like concat('%',#{param.deptCode},'%') or g.supplier_dept_codes is null)
</if>
<if test="param.examine!=null and param.examine !='' ">
and g.examine = #{param.examine}
</if>