package com.yice.webadmin.app.model;

import com.baomidou.mybatisplus.annotation.*;
import com.yice.common.core.util.MyCommonUtil;
import com.yice.common.core.base.mapper.BaseModelMapper;
import com.yice.webadmin.app.vo.ModelSquareVo;
import lombok.Data;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

/**
 * ModelSquare实体对象。
 *
 * @author linking
 * @date 2023-04-13
 */
@Data
@TableName(value = "lmp_model_square")
public class ModelSquare {

    /**
     * 模型ID。
     */
    @TableId(value = "model_id")
    private Long modelId;

    /**
     * 模型名称。
     */
    private String modelName;

    /**
     * 模型类型。
     */
    private Integer modelType;

    /**
     * 模型描述。
     */
    private String modelDescribe;

    /**
     * 版本数量。
     */
    private Integer versionCount;

    /**
     * model_name LIKE搜索字符串。
     */
    @TableField(exist = false)
    private String searchString;

    public void setSearchString(String searchString) {
        this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
    }

    @Mapper
    public interface ModelSquareModelMapper extends BaseModelMapper<ModelSquareVo, ModelSquare> {
    }
    public static final ModelSquareModelMapper INSTANCE = Mappers.getMapper(ModelSquareModelMapper.class);
}
