package com.zcloud.controller.depository;

import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.depository.HiddenLibraryService;
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.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 说明：隐患库主表
 * 作者：luoxiaobao
 * 时间：2023-08-03
 * 官网：www.zcloudchina.com
 */
@Controller
@RequestMapping("/app/hiddenLibrary")
public class AppHiddenLibraryController extends BaseController {

	@Autowired
	private HiddenLibraryService hiddenLibraryMapper;

	/**列表
	 * @param page
	 * @throws Exception
	 */
	@RequestMapping(value="/list")
	@ResponseBody
	public Object list(Page page) throws Exception{
		Map<String,Object> map = new HashMap<String,Object>();
		String errInfo = "success";
		PageData pd = this.getPageData();
		PageData condition = new PageData();
//		condition.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
//		condition.put("RISK_UNIT_NAME",pd.getString("RISK_UNIT_NAME"));
		condition.put("HIDDEN_PART",pd.getString("HIDDEN_PART"));
		condition.put("STATUS","1");
		page.setPd(condition);
		List<PageData>	varList = hiddenLibraryMapper.list(page);	//列出HiddenLibrary列表
		map.put("varList", varList);
		map.put("page", page);
		map.put("result", errInfo);
		return map;
	}

}
