package com.pj.tb_iport_order;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.pj.project4sp.SP;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * Controller: tb_iport_order -- 进口申报单
 * @author lbl
 */
@RestController
@RequestMapping("/app/TbIportOrder/")
public class TbIportOrderAppController {

	/** 底层 Service 对象 */
	@Autowired
	TbIportOrderService tbIportOrderService;


	/** 改 */
	@RequestMapping("update")
	public AjaxJson update(TbIportOrder t){
		tbIportOrderService.update(t);
		return AjaxJson.getSuccess();
	}

	/** 查 - 根据id */
	@RequestMapping("getById")
	public AjaxJson getById(Long id){
		TbIportOrder t = tbIportOrderService.getById(id);
		return AjaxJson.getSuccessData(t);
	}

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


}
