代码调整

This commit is contained in:
2023-06-01 14:15:39 +08:00
parent 5d3f915ca6
commit 074a2ae28d
15 changed files with 23 additions and 61 deletions

View File

@@ -28,12 +28,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
<version>1.5.1-RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>

View File

@@ -19,9 +19,9 @@ import java.util.stream.Stream;
*/
public class GenerateCode {
private static final String TARGET_DIR = "C://code";
private static final String TARGET_DIR = "D://code";
private static final String DB_URL = "jdbc:mysql://192.168.1.18:13306/pqsinfo_test";
private static final String DB_URL = "jdbc:mysql://192.168.1.18:13306/pqsinfo_hb_pv";
private static final String USERNAME = "root";
@@ -30,8 +30,8 @@ public class GenerateCode {
public static void main(String[] args) {
List<Module> modules = Stream.of(
new Module("xuyang", "com.njcn.access", "zl", Stream.of(
"ele_epd_pqd"
new Module("hongawen", "com.hongawen.mybatis", "zl", Stream.of(
"r_dis_mp_measure_phase_report_d"
).collect(Collectors.toList()), "")
).collect(Collectors.toList());
generateJavaFile(modules);

View File

@@ -26,6 +26,10 @@
<artifactId>common-web</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
</dependency>
<!--数据库相关********satrt-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
@@ -53,11 +57,7 @@
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.jeffreyning</groupId>-->
<!-- <artifactId>mybatisplus-plus</artifactId>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
<!--数据库相关********end-->
</dependencies>

View File

@@ -43,10 +43,10 @@ public class MybatisConfig {
* @date 2023/5/30 14:53
* @return BatchInjector
*/
// @Bean
// public BatchInjector BatchInjector() {
// return new BatchInjector();
// }
@Bean
public BatchInjector BatchInjector() {
return new BatchInjector();
}
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
import com.github.jeffreyning.mybatisplus.base.MppSqlInjector;
import java.util.List;
@@ -12,7 +13,7 @@ import java.util.List;
* @version 1.0.0
* @date 2023年05月30日 14:51
*/
public class BatchInjector extends DefaultSqlInjector {
public class BatchInjector extends MppSqlInjector {
@Override
public List<AbstractMethod> getMethodList(Class<?> mapperClass) {

View File

@@ -9,7 +9,7 @@ import java.util.List;
* @version 1.0.0
* @date 2023年05月30日 14:54
*/
public interface BatchMapper<T> extends BaseMapper<T> {
public interface BatchBaseMapper<T> extends BaseMapper<T> {
/**
* 真正的批量插入

View File

@@ -22,13 +22,6 @@
<artifactId>common-device-biz</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -90,12 +90,6 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
<version>1.5.1-RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>

View File

@@ -1,12 +1,10 @@
package com.njcn.prepare;
import com.github.jeffreyning.mybatisplus.conf.EnableMPP;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.DependsOn;
/**
* @author hongawen
@@ -17,7 +15,6 @@ import org.springframework.context.annotation.DependsOn;
@MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn")
@EnableMPP
public class PrepareApplication {
public static void main(String[] args) {

View File

@@ -54,12 +54,7 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
<version>1.5.1-RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>prepare-api</artifactId>

View File

@@ -67,12 +67,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
<version>1.5.1-RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>

View File

@@ -1,6 +1,5 @@
package com.njcn.process;
import com.github.jeffreyning.mybatisplus.conf.EnableMPP;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
@@ -17,7 +16,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn")
@EnableMPP
public class ProcessApplication {
public static void main(String[] args) {

View File

@@ -39,10 +39,7 @@
<version>4.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>

View File

@@ -1,6 +1,5 @@
package com.njcn.system;
import com.github.jeffreyning.mybatisplus.conf.EnableMPP;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
@@ -16,7 +15,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn")
@EnableMPP
public class SystemBootMain {
public static void main(String[] args) {
SpringApplication.run(SystemBootMain.class, args);

View File

@@ -1,11 +1,10 @@
package com.njcn.system.mapper;
import com.njcn.db.mapper.BatchMapper;
import com.njcn.db.mapper.BatchBaseMapper;
import com.njcn.system.excel.UserLogExcel;
import com.njcn.system.pojo.po.UserLog;
import org.apache.ibatis.annotations.Param;
import java.util.HashSet;
import java.util.List;
@@ -17,7 +16,7 @@ import java.util.List;
* @author hongawen
* @since 2021-12-13
*/
public interface UserLogMapper extends BatchMapper<UserLog> {
public interface UserLogMapper extends BatchBaseMapper<UserLog> {
/**