mybatis两个参数的书写方法

  这两个参数都是Long型

mapper.xml

<select id="selectGoodsStockByshopIdandgoodId" parameterType="Long" resultMap="GoodsStockResult">
        <include refid="selectGoodsStockVo"/>
        where shop_id = #{shopId} and goods_id = #{goodsId}
    </select>

dao接口 @Param(“shopId”) #{shopId} 相对应

    public GoodsStock selectGoodsStockByshopIdandgoodId
    (@Param("shopId")Long shopId, @Param("goodsId")Long goodsId);

posted @ 2022-04-06 16:12  正伯Pro  阅读(9)  评论(0)    收藏  举报  来源