package com.tofly.waterMaking.service.impl;

import com.tofly.waterMaking.mapper.UserZhswMapper;
import com.tofly.waterMaking.service.UserZhswService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
@AllArgsConstructor
public class UserZhswServiceImpl implements UserZhswService {

    private final UserZhswMapper userZhswMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean testInsert(Date time, Double pac, Double pam, Double cn, Double qsl) {
        return userZhswMapper.insertData(time, pac, pam, cn, qsl);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteIndex(Date time) {
        return userZhswMapper.deleteData(time);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateIndex(Date time, Double pac, Double pam, Double cn, Double qsl) {
        return userZhswMapper.updateData(time, pac, pam, cn, qsl);
    }
}
