提交 ac00ac7b 作者: xiaowang

根据子分类搜索

上级 6ec79f07
......@@ -158,7 +158,14 @@
<where>
gi.is_deleted = 0 and gi.shelf_status = 1 and gi.goods_type = #{type}
<if test="categoryIds != null and categoryIds.size != 0">
<foreach collection="categoryIds" item="item" index="index" open="and gi.category_by_one IN (" close=")"
<foreach collection="categoryIds" item="item" index="index" open="and (gi.category_by_one IN ("
close=")"
separator=",">
#{item}
</foreach>
</if>
<if test="categoryIds != null and categoryIds.size != 0">
<foreach collection="categoryIds" item="item" index="index" open="or gi.category_by_two IN (" close="))"
separator=",">
#{item}
</foreach>
......@@ -185,12 +192,19 @@
<where>
gi.is_deleted = 0 and gi.shelf_status = 1 and gi.goods_type = #{type}
<if test="param.categoryId != null">
<foreach collection="param.categoryId" item="item" index="index" open="and gi.category_by_one IN ("
<foreach collection="param.categoryId" item="item" index="index" open="and (gi.category_by_one IN ("
close=")"
separator=",">
#{item}
</foreach>
</if>
<if test="param.categoryId != null">
<foreach collection="param.categoryId" item="item" index="index" open="and gi.category_by_two IN ("
close="))"
separator=",">
#{item}
</foreach>
</if>
<if test="userIds != null">
<foreach collection="userIds" item="user" index="index" open="and gi.add_goods_user_id IN (" close=")"
separator=",">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论