dao:app
/** * 统计商家的案例数量 * * @param shopId * @return */ long countByShopId(Long shopId);
@Override public long countByShopId(Long shopId) { return super.getSessionTemplate().selectOne(getStatement("countByShopId"), shopId); }
mapper:ide
<select id="countByShopId" parameterType="long" resultType="long"> SELECT count(1) FROM <include refid="t_shop_case"/> WHERE shop_id = #{shopId} </select>
必定要注意spa
parameterType和
resultType这两个的类型不能搞错,否则会出现奇奇怪怪的错误!