package sgc.portal.cw.cw0902.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cs.cs0402.dto.CS04020001USearch;
import sgc.portal.cw.cw0902.dto.CW09020001USearch;
import sgc.portal.cw.cw0902.service.CW09020001UService;

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

@RestController
@RequestMapping("/cw/cw0902")
public class CW09020001UController {
	
    private final CW09020001UService service;

    public CW09020001UController(CW09020001UService service) {
        this.service = service;
    }
    
    @PostMapping("/CW09020001U/selectTotalDeptZehrWeekWorkList")
    public Map<String, Object> selectTotalDeptZehrWeekWorkList(@RequestBody CW09020001USearch search) {
    	
    	Map<String, Object> resultMap = new HashMap<String, Object>();
    	
    	List<EasyHashMap<String, Object>>  list1 = service.selectDeptZehrWeekWorkList(search);
    	List<EasyHashMap<String, Object>>  list2 = service.selectHeaderUpList(search);
    	List<EasyHashMap<String, Object>>  list3 = service.selectHeaderDownList(search);
    	
    	resultMap.put("dcdataList1"			, list1);
    	resultMap.put("dsHeaderUpList"		, list2);
        resultMap.put("dsHeaderDownList"	, list3);
        
        return resultMap;
    }

    @PostMapping("/CW09020001U/selectDeptZehrWeekWorkPopList")
    public List<EasyHashMap<String, Object>> selectDeptZehrWeekWorkPopList(@RequestBody CW09020001USearch search) {
        return service.selectDeptZehrWeekWorkPopList(search);
    }
    
    @PostMapping("/CW09020001U/selectDeptZehrWeekWorkPopTitleList")
    public EasyHashMap<String, Object> selectDeptZehrWeekWorkPopTitleList(@RequestBody CW09020001USearch search) {
        return service.selectDeptZehrWeekWorkPopTitleList(search);
    }
    
    @PostMapping("/CW09020001U/selectDeptZehrWeekWorkPopFileList")
    public List<EasyHashMap<String, Object>> selectDeptZehrWeekWorkPopFileList(@RequestBody CW09020001USearch search) {
        return service.selectDeptZehrWeekWorkPopFileList(search);
    }
}