package com.sptg.estate.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.estate.api.entity.PositionRecord;
import com.sptg.estate.biz.mapper.PositionRecordMapper;
import com.sptg.estate.biz.service.PositionRecordServiceInterface;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * title: ProjectServiceImpl
 * package: com.sptg.estate.biz.security
 * description: 实施项目定位-服务层实现层
 *
 *               
 *                     
 */
@Service
public class PositionRecordServiceImpl extends ServiceImpl<PositionRecordMapper, PositionRecord> implements PositionRecordServiceInterface {

    @Override
    public List<PositionRecord> getListByPositionId(long positionId){
        Wrapper<PositionRecord> wrapper= new EntityWrapper<>();
        wrapper.eq("l_position_id",positionId);
        List<PositionRecord> positionRecords = this.selectList(wrapper);
        return positionRecords;
    }

    @Override
    public ResultBean<Boolean> deleteByByPositionId(Long positionId) {
        Wrapper<PositionRecord> wrapper = new EntityWrapper<>();
        wrapper.eq("l_position_id",positionId);
        return new ResultBean<>(ResultEnum.SUCCESS,this.delete(wrapper));
    }
}
