package com.rongwei.bscommon.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rongwei.bscommon.sys.dao.AspCheckItemsAreaDao;
import com.rongwei.bscommon.sys.service.AspCheckItemsAreaService;
import com.rongwei.bsentity.domain.AspCheckItemsAreaDo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shangmi
 * @title AspCheckItemsAreaServiceImpl
 * @date 2024/1/22 15:00
 * @description 查询对象所属区域表
 */
@Service
public class AspCheckItemsAreaServiceImpl extends ServiceImpl<AspCheckItemsAreaDao, AspCheckItemsAreaDo> implements AspCheckItemsAreaService {
    @Autowired
    private AspCheckItemsAreaDao checkItemsAreaDao;

    @Override
    public AspCheckItemsAreaDo getByDeptName(String plantId,String rollInDept) {
        LambdaQueryWrapper<AspCheckItemsAreaDo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(AspCheckItemsAreaDo::getFullpid,plantId)
                .eq(AspCheckItemsAreaDo::getAreaname,rollInDept)
                .last("limit 1");
        return checkItemsAreaDao.selectOne(queryWrapper);
    }
}
