Newer
Older
huludao / src / main / java / com / newfiber / api / pc / service / impl / PatrolManageLawFileServiceImpl.java
package com.newfiber.api.pc.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.newfiber.api.pc.dao.RiverManage.PatrolManageLawFileMapper;
import com.newfiber.api.pc.model.River.PatrolManageLawFile;
import com.newfiber.api.pc.service.PatrolManageLawFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;


@Service("patrolManageLawFileService")
public class PatrolManageLawFileServiceImpl extends ServiceImpl<PatrolManageLawFileMapper, PatrolManageLawFile> implements PatrolManageLawFileService {

    @Autowired
    private PatrolManageLawFileMapper patrolManageLawFileMapper;

    @Override
    public PageInfo<PatrolManageLawFile> listForPage(String searchStr, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo, pageSize);
        EntityWrapper<PatrolManageLawFile> wapper = new EntityWrapper<>();
        //name 模糊匹配的字段
        wapper.like("name", searchStr);
        List<PatrolManageLawFile> list = patrolManageLawFileMapper.selectList(wapper);
        PageInfo<PatrolManageLawFile> result = new PageInfo<>();
        if (!list.isEmpty()) {
            result = new PageInfo<PatrolManageLawFile>(list);
        }
        return result;
    }


    @Override
    public String selectEventSrc(Integer srcId) {
        return patrolManageLawFileMapper.selectEventSrc(srcId);
    }

    @Override
    public String selectEventLevel(Integer levelId) {
        return patrolManageLawFileMapper.selectEventLevel(levelId);
    }

    @Override
    public String selectEventType(Integer uniqueCode) {
       return patrolManageLawFileMapper.selectEventType(uniqueCode);
    }

    @Override
    public void deleteByTaskNum(String taskNum) {
        if(StringUtils.isEmpty(taskNum)){
            return;
        }
        patrolManageLawFileMapper.deleteByTaskNum(taskNum);
    }
}