9-5testQueryShopListAndCount单测结果返回为0
来源:9-5 店铺列表页后端的开发
啊jimes
2019-10-09
SELECT
count(1)
FROM
tb_shop s,
tb_area a,
tb_shop_category sc
and s.shop_category_id=
#{shopCondition.shopCategory.shopCategoryId}
and s.shop_category_id in (select shop_category_id from
tb_shop_category
WHERE parent_id =
#{shopCondition.shopCategory.parent.shopCategoryId})
and s.area_id=
#{shopCondition.area.areaId}
<if
test="shopCondition.shopName!=null">
and s.shop_name like '%#{shopCondition.shopName}%'
</if>
<if
test="shopCondition.enableStatus!=null">
and s.enable_status =#{shopCondition.enableStatus}
</if>
<if
test="shopCondition.owner!=null and shopCondition.owner.userId!=null">
and s.owner_id = #{shopCondition.owner.userId}
</if>
AND
s.area_id=a.area_id
AND
s.shop_category_id=sc.shop_category_id
</where>
</select>
查询结果
写回答
1回答
-
翔仔
2019-10-10
同学好,你看你的查询结果那张控制台截图,里面有preparing的执行语句,将它复制出来,粘贴到的你的mysql客户端,然后用Parameters的参数替换掉问号的内容,记得是一一替换,然后执行一下。看看能否查出结果,查不出请检查数据问题或者sql问题,sql问题就看看mapper为什么会生成了错误的Sql,锻炼一下调试和解决问题的能力
012019-10-10
相似问题