Browse Source

api搜索商品时候详情逻辑调整

master
xyiege 3 years ago
parent
commit
e3bd667ab5
  1. 4
      src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java
  2. 2
      src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java
  3. 9
      src/main/resources/mapper/szwh/GoodsMapper.xml

4
src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java

@ -147,8 +147,8 @@ public class GoodsController extends BaseController {
} }
// goods islicode // goods islicode
String goodsIsliCode = request.getParameter("goods_islicode"); String goodsIsliCode = request.getParameter("goods_islicode");
if(StringUtils.isNotBlank(goodsIsliCode) && qmap.size()==0){ if(StringUtils.isNotBlank(goodsIsliCode) && qmap.size()==1){
qmap.put("gisli",goodsIsliCode); qmap.put("g.gisli",goodsIsliCode);
} }
// 系统标识,必须字段,不能为空 // 系统标识,必须字段,不能为空
String appkey=request.getParameter("appkey"); String appkey=request.getParameter("appkey");

2
src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java

@ -185,6 +185,8 @@ public class GoodsServiceImpl implements GoodsService {
orderkey="gd.price"; orderkey="gd.price";
break; break;
} }
}else{
gmap.remove("orderway");
} }
} }

9
src/main/resources/mapper/szwh/GoodsMapper.xml

@ -71,7 +71,7 @@
<if test="map!=null"> <if test="map!=null">
<foreach collection="map" item="v" index="k" separator="and"> <foreach collection="map" item="v" index="k" separator="and">
<if test="v != null and v != '' and k!='orderway' and k!='id' <if test="v != null and v != '' and k!='orderway' and k!='id'
and k!='gd.goods_name' and k!='g.entrust_name' and k!='gisli' and k!='gd.goods_name' and k!='g.entrust_name' and k!='g.gisli'
and k!='createtime' and k!='ishow'"> and k!='createtime' and k!='ishow'">
${k} = #{v} ${k} = #{v}
</if> </if>
@ -82,7 +82,7 @@
gd.goods_name like concat('%',#{v},'%') gd.goods_name like concat('%',#{v},'%')
OR g.goods_islicode like concat('%',#{v},'%') OR g.goods_islicode like concat('%',#{v},'%')
</if> </if>
<if test="k=='gisli'"> <if test="k=='g.gisli'">
g.goods_islicode=#{v} g.goods_islicode=#{v}
</if> </if>
<if test="k=='g.entrust_name'"> <if test="k=='g.entrust_name'">
@ -110,7 +110,7 @@
<if test="map!=null"> <if test="map!=null">
<foreach collection="map" item="v" index="k" separator="and"> <foreach collection="map" item="v" index="k" separator="and">
<if test="v != null and v != '' and k!='orderway' and k!='id' and k!='gd.goods_name' <if test="v != null and v != '' and k!='orderway' and k!='id' and k!='gd.goods_name'
and k!='g.entrust_name' and k!='createtime' and k!='g.entrust_name' and k!='createtime' and k!='g.gisli'
and k!='ishow'"> and k!='ishow'">
${k} = #{v} ${k} = #{v}
</if> </if>
@ -124,6 +124,9 @@
<if test="k=='g.entrust_name'"> <if test="k=='g.entrust_name'">
g.username like concat('%',#{v},'%') g.username like concat('%',#{v},'%')
</if> </if>
<if test="k=='g.gisli'">
g.goods_islicode=#{v}
</if>
<if test="k=='createtime'"> <if test="k=='createtime'">
${v} ${v}
</if> </if>

Loading…
Cancel
Save