Newer
Older
huludao / src / main / java / com / newfiber / api / mobile / service / PatrolProblemStateService.java
package com.newfiber.api.mobile.service;

import com.newfiber.api.core.base.BaseService;
import com.newfiber.api.mobile.dao.PatrolProblemStateDao;
import com.newfiber.api.mobile.model.domain.PatrolProblemState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * patrolProblemState 业务层
 *
 * @author luzhan
 * @date 2021-07-08
 */
@Service("patrolProblemStateService")
public class PatrolProblemStateService extends BaseService<PatrolProblemStateDao,PatrolProblemState> {

    @Autowired
    private PatrolProblemStateDao patrolProblemStateDao;

    int save(List<PatrolProblemState> patrolProblemStates){
        return this.insertBatch(patrolProblemStates)?1:0;
    }

    int save(PatrolProblemState patrolProblemStates){
        return this.insert(patrolProblemStates)?1:0;
    }

    public PatrolProblemState selectByNameAndNo(String userName, String patrolProblemNo) {
        return patrolProblemStateDao.selectByNameAndNo(userName,patrolProblemNo);
    }

    public Boolean existData(String userName, String patrolProblemNo) {
        boolean flag = false;
        if(this.selectByNameAndNo(userName, patrolProblemNo)!=null){
            flag = true;
        }
        return flag;
    }

    public int updateByUserNameAndNo(String userName, String patrolProblemNo, Integer patrolProblemState) {
        return patrolProblemStateDao.updateByUserNameAndNo(userName,patrolProblemNo,patrolProblemState);
    }
}