package com.foreverwin.mesnac.console.mybatis.override;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.methods.Insert;
import com.baomidou.mybatisplus.extension.injector.methods.*;

/**
 *
 * @description:
 * @author: syngna
 * @create: 2021-04-18 17:14
 */
public class MethodFactory {

    public static AbstractMethod getInstance(String methodName) {
        if("insert".equals(methodName)) {
            return new Insert();
        } else if("delete".equals(methodName)) {
            return new LogicDelete();
        } else if("deleteByMap".equals(methodName)) {
            return new LogicDeleteByMap();
        } else if("deleteById".equals(methodName)) {
            return new LogicDeleteById();
        } else if("deleteBatchByIds".equals(methodName)) {
            return new LogicDeleteBatchByIds();
        } else if("update".equals(methodName)) {
            return new LogicUpdate();
        } else if("updateById".equals(methodName)) {
            return new LogicUpdateById();
        } else if("selectById".equals(methodName)) {
            return new LogicSelectById();
        } else if("selectBatchByIds".equals(methodName)) {
            return new LogicSelectBatchByIds();
        } else if("selectByMap".equals(methodName)) {
            return new LogicSelectByMap();
        } else if("selectOne".equals(methodName)) {
            return new LogicSelectOne();
        } else if("selectCount".equals(methodName)) {
            return new LogicSelectCount();
        } else if("selectMaps".equals(methodName)) {
            return new LogicSelectMaps();
        } else if("selectMapsPage".equals(methodName)) {
            return new LogicSelectMapsPage();
        } else if("selectObjs".equals(methodName)) {
            return new LogicSelectObjs();
        } else if("selectList".equals(methodName)) {
            return new LogicSelectList();
        } else if("selectPage".equals(methodName)) {
            return new LogicSelectPage();
        }
        return null;
    }
}