package com.huiju.estateagents.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huiju.estateagents.common.CommConstant;
import com.huiju.estateagents.entity.TpMessageEvent;
import com.huiju.estateagents.mapper.TpMessageEventMapper;
import com.huiju.estateagents.service.ITpMessageEventService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yansen
 * @since 2020-12-22
 */
@Service
public class TpMessageEventServiceImpl extends ServiceImpl<TpMessageEventMapper, TpMessageEvent> implements ITpMessageEventService {

    @Override
    public List<TpMessageEvent> getByOrgId(Integer orgId, String evtType) {
        QueryWrapper<TpMessageEvent> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("org_id", orgId);
        queryWrapper.eq("evt_type", evtType);
        queryWrapper.gt("status", CommConstant.STATUS_DELETE);
        return list(queryWrapper);
    }
}
