package com.goldenwater.hzz.service;
import com.goldenwater.hzz.domain.*;
import com.goldenwater.hzz.mapper.RiverProjectMapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;

@Service
public class RiverProjectService {
    @Autowired private RiverProjectMapper mapper;
    public List<RiverProjectDTO> getShxmAll(String sn) { return mapper.getShxmAll(sn); }
    public List<RiverProjectDTO> getShxmList(String pn, String bs, int p, int s) { PageHelper.startPage(p,s); return mapper.getShxmList(pn,bs); }
    public RiverProjectDTO getShxmById(String g) { return mapper.getShxmById(g); }
    public int saveShxm(RiverProjectDTO dto) { if(dto.getGuid()==null) dto.setGuid(UUID.randomUUID().toString().replace("-","")); return mapper.saveShxm(dto); }
    public int editShxm(RiverProjectDTO dto) { return mapper.editShxm(dto); }
    public int deleteShxm(String g) { return mapper.deleteShxm(g); }
    public List<RiverProjectDTO> getFilesById(String g) { return mapper.getFilesById(g); }
    public int saveShxmFiles(List<RiverProjectDTO> f) { return mapper.saveShxmFiles(f); }
    public List<RiverConstructionDTO> selectConstructionList(RiverConstructionDTO d, int p, int s) { PageHelper.startPage(p,s); return mapper.selectConstructionList(d); }
}
