You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
845 B

package com.yx.controller;
import com.yx.po.BookInfo;
import com.yx.po.TypeInfo;
import com.yx.service.BookInfoService;
import com.yx.service.TypeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
@Controller
public class StatisticsController {
@Autowired
private BookInfoService bookInfoService;
@Autowired
private TypeInfoService typeInfoService;
@GetMapping("statisticIndex")
public String statistics(Model model){
//根据图书类型查询图书数量
List<BookInfo> list = bookInfoService.getBookCountByType();
model.addAttribute("list",list);
return "count/statisticIndex";
}
}