admin 发布的文章

通俗的解释一下多线程

多线程用于堆积处理,就像一个大土堆,一个推土机很慢,那么10个推土机一起来处理,当然速度就快了,不过由于位置的限制,如果20个推土机,那么推土机之间会产生相互的避让,相互摩擦,相互拥挤,反而不如10个处理的好,所以,多线程处理,线程数要开的恰当,就可以提高效率。

- 阅读剩余部分 -

今天碰见一个版本冲突问题具体冲突如下:

An attempt was made to call a method that does not exist.
The attempt was made from the following location:

com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.getLanguageDriver
(MybatisMapperAnnotationBuilder.java:369)

The following method did not exist:

com.baomidou.mybatisplus.core.MybatisConfiguration.getLanguageDriver
(Ljava/lang/Class;)Lorg/apache/ibatis/scripting/LanguageDriver;

The method's class, com.baomidou.mybatisplus.core.MybatisConfiguration,
is available from the following locations:
当时的spirngboot版本和mybatis版本如下:(这是修改以后又重新指定了一下mybatis的版本指定为最新版本的了。)

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.7.RELEASE</version>
    <relativePath/>
</parent>
<!--定义版本-->
<properties>
  <mybatis.plus.starter.version>3.1.1</mybatis.plus.starter.version>
</properties>
<!--解决myabatis版本冲突问题-->
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>${mybatis.plus.starter.version}</version>

</dependency>
是这个方法找不到,然后我就添加了如下配置:(最后解决问题)
<parent>

    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.7.RELEASE</version>
    <relativePath/>
</parent>

<!--定义版本-->
<properties>
  <mybatis.plus.starter.version>3.1.1</mybatis.plus.starter.version>
</properties>

        <!--解决myabatis版本冲突问题-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>${mybatis.plus.starter.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>mybatis</artifactId>
                    <groupId>org.mybatis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.6</version>
        </dependency>

mybatis中大于等于小于等于的写法,一般有以下两种。

第一种写法:(推荐使用) 在Mybatis xml中使用XML语法

大于等于

<![CDATA[ >= ]]>

小于等于

<![CDATA[ <= ]]>

例如:sql如下:

create_date_time <![CDATA[ >= ]]> #{startTime} and  create_date_time <![CDATA[ <= ]]> #{endTime}

第二种写法

原符号 < <= > >= & ' "

替换符号 &lt; &lt;= &gt; &gt;= &amp; &apos; &quot;

微信截图_20221125081717.png

例如:sql如下:

create_date_time &gt;= #{startTime} and  create_date_time &lt;= #{endTime}