package cn.sikey.hmd.dal.mysql;

import cn.sikey.hmd.dal.dataobject.PlansDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * 套餐表
 *
 * @author qin
 */
@Mapper
public interface PlansMapper extends BaseMapper<PlansDO> {

    default PlansDO queryPlansDO(int validity) {
        QueryWrapper<PlansDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("validity", validity);
        queryWrapper.eq("deleted", false);
        return selectOne(queryWrapper);
    }
}
