索引创建与删除

一、索引前缀:

https://blog.csdn.net/a1090144284/article/details/75635185

PK - Primary Key 主键
AK - Unique Index 唯一索引
FK - Foreign Key 外键

二、索引创建与销毁:

https://www.cnblogs.com/event/p/6433544.html

为app_customize表创建名为AK_APP_NAME,name字段的唯一索引

ALTER TABLE app_customize ADD CONSTRAINT AK_APP_NAME UNIQUE (NAME);

为app_customize表删除名为AK_APP_NAME的唯一索引

DROP INDEX AK_APP_NAME ON app_customize;

三、mybatis映射:resultType,resultMap,parameterType,parameterMap

resultType:数据库字段名与实体类属性一一对应;
resultMap:需给数据库字段名另起别名,"user_id" property="userId"/>;

parameterType:将查询结果列值对应到实体类上,推荐使用;
parameterMap:不推荐使用



    
    
        INSERT INTO app_customize
            (id,companyId,name,iconType,icon,type,supportWeb,supportAndroid,supportIos,entrance,depict,createDate,updateDate)
        VALUES
            (#{id},#{companyId},#{name},#{iconType},#{icon},#{type},#{supportWeb},#{supportAndroid},#{supportIos},#{entrance},#{depict},now(),now())
    
    
    
    
        DELETE FROM app_customize WHERE id=#{value}
    
    
    
    
    
    
     UPDATE app_customize   name = #{name},  iconType = #{iconType}, icon = #{icon}, type = #{type}, supportWeb = #{supportWeb}, supportAndroid = #{supportAndroid}, supportIos = #{supportIos}, entrance = #{entrance}, depict = #{depict}, updateDate = now()  WHERE id=#{id}  

你可能感兴趣的:(索引创建与删除)