guoshilong
2024-03-31 a4cd27af8c445e2b043aa146ee38f04222c992e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package cn.gistack.sm.sjztdw.service.impl;
 
import cn.gistack.sm.sjztdw.entity.DwsResSlDi;
import cn.gistack.sm.sjztdw.mapper.DwsResSlDiMapper;
import cn.gistack.sm.sjztdw.service.IDwsResSlDiService;
import cn.gistack.sm.sjztdw.vo.DbExcelVO;
import cn.gistack.sm.sjztods.entity.DsmSpgSpqnmp;
import cn.gistack.sm.sjztods.service.IDsmSpgSpqnmpService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
 
import java.util.Date;
import java.util.List;
 
@Service
@DS("ztdw")
@AllArgsConstructor
public class DwsResSlDiServiceImpl extends ServiceImpl<DwsResSlDiMapper, DwsResSlDi> implements IDwsResSlDiService {
 
    private IDsmSpgSpqnmpService dsmSpgSpqnmpService;
 
    @Override
    public Integer updateCustomize(DwsResSlDi dwsResSlDi) {
        return baseMapper.updateCustomize(dwsResSlDi);
    }
 
    @Override
    public Integer updateByBasic(DbExcelVO dbExcel) {
 
        //从渗流测点表中根据断面和水库注册登记码获取测点编码
        DsmSpgSpqnmp paramSl = new DsmSpgSpqnmp();
        paramSl.setCh(dbExcel.getCh());
        paramSl.setRscd(dbExcel.getResRegCode());
        List<DsmSpgSpqnmp> list = dsmSpgSpqnmpService.getList(paramSl);
 
 
        //有渗流站点才添加
        if (list != null && list.size()>0){
            String cd = "";
 
            if (list != null && list.size()>0){
                cd = list.get(0).getMpcd();
            }
 
            DbExcelVO updateParams = new DbExcelVO();
 
 
            updateParams.setAvgSpqnValue(dbExcel.getAvgSpqnValue());
 
            updateParams.setCd(cd);
            updateParams.setMonitorDate(dbExcel.getMonitorDate());
            updateParams.setResCd(dbExcel.getResCd());
 
            return baseMapper.updateByBasic(updateParams);
        }
 
        return 0;
    }
 
    @Override
    public Integer removeByBasic(DbExcelVO dbExcelVO) {
        return baseMapper.removeByBasic(dbExcelVO);
    }
}