package com.pj.project.tb_business_item;

import com.pj.utils.sg.AjaxJson;
import com.pj.utils.so.SoMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * Controller: tb_business_item -- 业务作业项
 * @author qzy 
 */
@RestController
@RequestMapping("/TbBusinessItem/")
public class TbBusinessItemController {

	/** 底层 Service 对象 */
	@Autowired
    TbBusinessItemService tbBusinessItemService;

	/** 改 */  
	@RequestMapping("update")
	public AjaxJson update(TbBusinessItem t){
		tbBusinessItemService.updateById(t);
		return AjaxJson.getSuccess();
	}

	/** 查 - 根据id */  
	@RequestMapping("getById")
	public AjaxJson getById(String id){
		TbBusinessItem t = tbBusinessItemService.getById(id);
		return AjaxJson.getSuccessData(t);
	}

	/** 查集合 - 根据条件（参数为空时代表忽略指定条件） */  
	@RequestMapping("getList")
	public AjaxJson getList() {
		SoMap so = SoMap.getRequestSoMap();
		List<TbBusinessItem> list = tbBusinessItemService.getList(so.startPage());
		return AjaxJson.getPageData(so.getDataCount(), list);
	}
	

	
	
	
	
	

}
