dao:

    /**
     * 统计商家的案例数量
     *
     * @param shopId
     * @return
     */
    long countByShopId(Long shopId);
@Override
    public long countByShopId(Long shopId) {
        return super.getSessionTemplate().selectOne(getStatement("countByShopId"), shopId);
    }

mapper:

    <select id="countByShopId" parameterType="long" resultType="long">
        SELECT count(1) FROM
        <include refid="t_shop_case"/>
        WHERE shop_id = #{shopId}
    </select>

一定要注意

parameterType和
resultType这两个的类型不能搞错,不然会出现奇奇怪怪的错误!

相关文章:

  • 2022-01-08
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
猜你喜欢
  • 2021-12-06
  • 2022-12-23
  • 2021-11-19
  • 2022-01-08
  • 2021-11-11
  • 2021-06-11
相关资源
相似解决方案