All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ape9527.core.mapper.BaseObjFieldMapper Maven / Gradle / Ivy

The newest version!
package com.ape9527.core.mapper;

import com.ape9527.core.entity.BaseObj;
import com.ape9527.core.entity.BaseObjField;
import com.ape9527.core.model.base.CorrelatedBaseObj;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 基础数据对象属性数据层
 *
 * @author YuanShuai[[email protected]]
 */
@Mapper
public interface BaseObjFieldMapper {

    List selectList(BaseObjField field);

    BaseObjField selectById(String uuid);

    int insert(BaseObjField field);

    int update(BaseObjField field);

    int updateDelByIds(@Param("uuids") String[] uuids);

    int insertBatch(@Param("fields") List fields);

    int updateObjCodeByObjCode(@Param("oldObjCode") String oldObjCode, @Param("objCode") String objCode);

    void initTable(@Param("baseObj") BaseObj baseObj, @Param("fields") List fields);

    void insertColumn(BaseObjField field);

    void updateColumn(@Param("oldFieldCode") String fieldCode, @Param("field") BaseObjField field);

    List> selectCodeBatch(@Param("uuids") String[] uuids);

    void dropColumns(@Param("codes") List> codes);

    int updateDelByObjCodes(@Param("objCodes") List objCodes);

    BaseObjField selectByFieldCode(@Param("objCode") String objCode, @Param("fieldCode") String fieldCode);

    @Select("SELECT field_code FROM base_obj_field WHERE del = 0 AND obj_code = #{objectCode} AND is_base_obj = 0 ORDER BY create_time ASC")
    List selectFieldCodes(String objectCode);

    @Select("SELECT field_code, correlated_base_obj_code as correlatedBaseObj, correlated_base_obj_field_code as correlatedBaseObjField, default_value as selectField FROM `base_obj_field` " +
            "where obj_code = #{objectCode} " +
            "and del = 0 " +
            "and is_base_obj = 1")
    List selectCorrelatedBaseObj(String objectCode);

    @Select("select field_code from base_obj_field " +
            "where obj_code = #{objectCode} and `unique` = 1 and field_code != 'uuid'")
    List selectUniqueFields(String objectCode);

    @Select("select field_name from base_obj_field " +
            "where obj_code = #{objectCode} and field_code = #{fieldCode} and del = 0")
    String selectFieldName(@Param("objectCode") String objectCode, @Param("fieldCode") String fieldCode);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy