package sgc.portal.cd.cd0101.web;

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

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cd.cd0101.dto.CD01010001USearch;
import sgc.portal.cd.cd0101.model.CD01010001U;
import sgc.portal.cd.cd0101.model.CD01010002U;
import sgc.portal.cd.cd0101.model.CD01010003U;
import sgc.portal.cd.cd0101.service.CD01010001UService;

@RestController
@RequestMapping("/cd/cd0101")
public class CD01010001UController {
	
	private final CD01010001UService service;

    public CD01010001UController(CD01010001UService service) {
        this.service = service;
    }
	
    //공종 조회
    @PostMapping("/CD01010001U/selectConDayMstJobtypList")
    public List<EasyHashMap<String, Object>> selectConDayMstJobtypList(@RequestBody CD01010001USearch search) {
        return service.selectConDayMstJobtypList(search);
    }
    
	//공종 등록 수정 삭제
    @PostMapping("/CD01010001U/saveConDayMstJobtyp")
    public Map<String, String> saveConDayMstJobtyp(@RequestBody List<CD01010001U> CD01010001U) {
    	return service.saveConDayMstJobtyp(CD01010001U);
    }
	
    //장비 조회
    @PostMapping("/CD01010001U/selectConDayMstEqpmList")
    public List<EasyHashMap<String, Object>> selectConDayMstEqpmList(@RequestBody CD01010001USearch search) {
        return service.selectConDayMstEqpmList(search);
    }

	//장비 등록 수정 삭제
    @PostMapping("/CD01010001U/saveConDayMstEqpm")
    public Map<String, String> saveConDayMstEqpm(@RequestBody List<CD01010002U> CD01010002U) {
    	return service.saveConDayMstEqpm(CD01010002U);
    }
    
    //자재 조회
    @PostMapping("/CD01010001U/selectConDayMstBdmtList")
    public List<EasyHashMap<String, Object>> selectConDayMstBdmtList(@RequestBody CD01010001USearch search) {
        return service.selectConDayMstBdmtList(search);
    }

	//자재 등록 수정 삭제
    @PostMapping("/CD01010001U/saveConDayMstBdmt")
    public Map<String, String> saveConDayMstBdmt(@RequestBody List<CD01010003U> CD01010003U) {
    	return service.saveConDayMstBdmt(CD01010003U);
    }
}