MySQL方法
1、加个判断是否为空
2、返回类型是包装类型 Integer (包装类型可以接收 null 值)
@Query(value = "select ifnull(sum(num),0) from tb_outstock where citem=:citem group by citem", nativeQuery=true)
public Integer countByClothes(String citem);
MySQL方法
1、加个判断是否为空
2、返回类型是包装类型 Integer (包装类型可以接收 null 值)
@Query(value = "select ifnull(sum(num),0) from tb_outstock where citem=:citem group by citem", nativeQuery=true)
public Integer countByClothes(String citem);