package com.yckj.controller;
|
|
import com.yckj.bean.Result;
|
import com.yckj.bean.TbBattdataRt;
|
import com.yckj.service.TbBattdataRtService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import java.util.List;
|
import java.util.logging.Logger;
|
|
/***
|
*
|
*/
|
@Controller
|
@RequestMapping(value = "/TbBattdataRt", method = RequestMethod.POST)
|
public class TbBattdataRtController {
|
private static final Logger logger = Logger.getLogger(String.valueOf(TbBattdataRtController.class));
|
|
@Autowired
|
private TbBattdataRtService tbBattdataRtParamService;
|
|
@RequestMapping(value = "/selectByPrimaryKey.action")
|
@ResponseBody
|
public Result<TbBattdataRt> selectByPrimaryKey(Long num) {
|
// http://localhost:8089/tbBattsysParam/selectByPrimaryKey.action?num=2
|
TbBattdataRt tbBattdataRt = tbBattdataRtParamService.selectByPrimaryKey(num);
|
|
return Result.success(tbBattdataRt);
|
}
|
|
@RequestMapping(value = "/queryAll.action")
|
@ResponseBody
|
public Result queryAll() {
|
List<TbBattdataRt> tbBattdataRts = tbBattdataRtParamService.queryAll();
|
for (int i = 0; i < tbBattdataRts.size(); i++) {
|
System.out.println("tbBattdataRts = " + tbBattdataRts.get(i).toString());
|
}
|
return Result.success(tbBattdataRts);
|
}
|
|
@RequestMapping(value = "/updateByPrimaryKey.action")
|
@ResponseBody
|
public Result updateByPrimaryKey(Long num) {
|
tbBattdataRtParamService.updateByPrimaryKey(num);
|
return Result.success("更新成功");
|
}
|
}
|